hexo/node_modules/moize/dist/moize.js.map

1 line
88 KiB
Plaintext

{"version":3,"file":"moize.js","sources":["../src/constants.ts","../src/utils.ts","../src/maxAge.ts","../src/stats.ts","../src/instance.ts","../src/component.ts","../src/maxArgs.ts","../src/serialize.ts","../src/options.ts","../src/updateCacheForKey.ts","../src/index.ts"],"sourcesContent":["import type { AnyFn, Options } from '../index.d';\n\n/**\n * @private\n *\n * @constant DEFAULT_OPTIONS\n */\nexport const DEFAULT_OPTIONS: Options<AnyFn> = {\n isDeepEqual: false,\n isPromise: false,\n isReact: false,\n isSerialized: false,\n isShallowEqual: false,\n matchesArg: undefined,\n matchesKey: undefined,\n maxAge: undefined,\n maxArgs: undefined,\n maxSize: 1,\n onExpire: undefined,\n profileName: undefined,\n serializer: undefined,\n updateCacheForKey: undefined,\n transformArgs: undefined,\n updateExpire: false,\n};\n","import { DEFAULT_OPTIONS } from './constants';\n\nimport type {\n AnyFn,\n Expiration,\n IsEqual,\n IsMatchingKey,\n Key,\n Moizeable,\n Moized,\n Options,\n} from '../index.d';\n\n/**\n * @private\n *\n * @description\n * method to combine functions and return a single function that fires them all\n *\n * @param functions the functions to compose\n * @returns the composed function\n */\nexport function combine<Args extends any[], Result>(\n ...functions: Array<(...args: Args) => any>\n): ((...args: Args) => Result) | undefined {\n return functions.reduce(function (f: any, g: any) {\n if (typeof f === 'function') {\n return typeof g === 'function'\n ? function (this: any) {\n f.apply(this, arguments);\n g.apply(this, arguments);\n }\n : f;\n }\n\n if (typeof g === 'function') {\n return g;\n }\n });\n}\n\n/**\n * @private\n *\n * @description\n * method to compose functions and return a single function\n *\n * @param functions the functions to compose\n * @returns the composed function\n */\nexport function compose<Method>(...functions: Method[]): Method {\n return functions.reduce(function (f: any, g: any) {\n if (typeof f === 'function') {\n return typeof g === 'function'\n ? function (this: any) {\n return f(g.apply(this, arguments));\n }\n : f;\n }\n\n if (typeof g === 'function') {\n return g;\n }\n });\n}\n\n/**\n * @private\n *\n * @description\n * find the index of the expiration based on the key\n *\n * @param expirations the list of expirations\n * @param key the key to match\n * @returns the index of the expiration\n */\nexport function findExpirationIndex(expirations: Expiration[], key: Key) {\n for (let index = 0; index < expirations.length; index++) {\n if (expirations[index].key === key) {\n return index;\n }\n }\n\n return -1;\n}\n\n/**\n * @private\n *\n * @description\n * create function that finds the index of the key in the list of cache keys\n *\n * @param isEqual the function to test individual argument equality\n * @param isMatchingKey the function to test full key equality\n * @returns the function that finds the index of the key\n */\nexport function createFindKeyIndex(\n isEqual: IsEqual,\n isMatchingKey: IsMatchingKey | undefined\n) {\n const areKeysEqual: IsMatchingKey =\n typeof isMatchingKey === 'function'\n ? isMatchingKey\n : function (cacheKey: Key, key: Key) {\n for (let index = 0; index < key.length; index++) {\n if (!isEqual(cacheKey[index], key[index])) {\n return false;\n }\n }\n\n return true;\n };\n\n return function (keys: Key[], key: Key) {\n for (let keysIndex = 0; keysIndex < keys.length; keysIndex++) {\n if (\n keys[keysIndex].length === key.length &&\n areKeysEqual(keys[keysIndex], key)\n ) {\n return keysIndex;\n }\n }\n\n return -1;\n };\n}\n\ntype MergedOptions<\n OriginalOptions extends Options<Moizeable>,\n NewOptions extends Options<Moizeable>\n> = Omit<OriginalOptions, keyof NewOptions> & NewOptions;\n\n/**\n * @private\n *\n * @description\n * merge two options objects, combining or composing functions as necessary\n *\n * @param originalOptions the options that already exist on the method\n * @param newOptions the new options to merge\n * @returns the merged options\n */\nexport function mergeOptions<\n OriginalOptions extends Options<Moizeable>,\n NewOptions extends Options<Moizeable>\n>(\n originalOptions: OriginalOptions,\n newOptions: NewOptions | undefined\n): MergedOptions<OriginalOptions, NewOptions> {\n if (!newOptions || newOptions === DEFAULT_OPTIONS) {\n return originalOptions as unknown as MergedOptions<\n OriginalOptions,\n NewOptions\n >;\n }\n\n return {\n ...originalOptions,\n ...newOptions,\n onCacheAdd: combine(originalOptions.onCacheAdd, newOptions.onCacheAdd),\n onCacheChange: combine(\n originalOptions.onCacheChange,\n newOptions.onCacheChange\n ),\n onCacheHit: combine(originalOptions.onCacheHit, newOptions.onCacheHit),\n transformArgs: compose(\n originalOptions.transformArgs,\n newOptions.transformArgs\n ),\n };\n}\n\nexport function isMoized(\n fn: Moizeable | Moized | Options<AnyFn>\n): fn is Moized {\n return typeof fn === 'function' && (fn as Moizeable).isMoized;\n}\n\nexport function setName(\n fn: Moized,\n originalFunctionName: string,\n profileName: string\n) {\n try {\n const name = profileName || originalFunctionName || 'anonymous';\n\n Object.defineProperty(fn, 'name', {\n configurable: true,\n enumerable: false,\n value: `moized(${name})`,\n writable: true,\n });\n } catch {\n // For engines where `function.name` is not configurable, do nothing.\n }\n}\n","import { createFindKeyIndex, findExpirationIndex } from './utils';\n\nimport type {\n AnyFn,\n Cache,\n Expiration,\n IsEqual,\n IsMatchingKey,\n Key,\n OnCacheOperation,\n Options,\n} from '../index.d';\n\n/**\n * @private\n *\n * @description\n * clear an active expiration and remove it from the list if applicable\n *\n * @param expirations the list of expirations\n * @param key the key to clear\n * @param shouldRemove should the expiration be removed from the list\n */\nexport function clearExpiration(\n expirations: Expiration[],\n key: Key,\n shouldRemove?: boolean\n) {\n const expirationIndex = findExpirationIndex(expirations, key);\n\n if (expirationIndex !== -1) {\n clearTimeout(expirations[expirationIndex].timeoutId);\n\n if (shouldRemove) {\n expirations.splice(expirationIndex, 1);\n }\n }\n}\n\n/**\n * @private\n *\n * @description\n * Create the timeout for the given expiration method. If the ability to `unref`\n * exists, then apply it to avoid process locks in NodeJS.\n *\n * @param expirationMethod the method to fire upon expiration\n * @param maxAge the time to expire after\n * @returns the timeout ID\n */\nexport function createTimeout(expirationMethod: () => void, maxAge: number) {\n const timeoutId = setTimeout(expirationMethod, maxAge);\n\n if (typeof timeoutId.unref === 'function') {\n timeoutId.unref();\n }\n\n return timeoutId;\n}\n\n/**\n * @private\n *\n * @description\n * create a function that, when an item is added to the cache, adds an expiration for it\n *\n * @param expirations the mutable expirations array\n * @param options the options passed on initialization\n * @param isEqual the function to check argument equality\n * @param isMatchingKey the function to check complete key equality\n * @returns the onCacheAdd function to handle expirations\n */\nexport function createOnCacheAddSetExpiration<MoizeableFn extends AnyFn>(\n expirations: Expiration[],\n options: Options<MoizeableFn>,\n isEqual: IsEqual,\n isMatchingKey: IsMatchingKey\n): OnCacheOperation<MoizeableFn> {\n const { maxAge } = options;\n\n return function onCacheAdd(\n cache: Cache<MoizeableFn>,\n moizedOptions: Options<MoizeableFn>,\n moized: MoizeableFn\n ) {\n const key: any = cache.keys[0];\n\n if (findExpirationIndex(expirations, key) === -1) {\n const expirationMethod = function () {\n const findKeyIndex = createFindKeyIndex(isEqual, isMatchingKey);\n\n const keyIndex: number = findKeyIndex(cache.keys, key);\n const value: any = cache.values[keyIndex];\n\n if (~keyIndex) {\n cache.keys.splice(keyIndex, 1);\n cache.values.splice(keyIndex, 1);\n\n if (typeof options.onCacheChange === 'function') {\n options.onCacheChange(cache, moizedOptions, moized);\n }\n }\n\n clearExpiration(expirations, key, true);\n\n if (\n typeof options.onExpire === 'function' &&\n options.onExpire(key) === false\n ) {\n cache.keys.unshift(key);\n cache.values.unshift(value);\n\n onCacheAdd(cache, moizedOptions, moized);\n\n if (typeof options.onCacheChange === 'function') {\n options.onCacheChange(cache, moizedOptions, moized);\n }\n }\n };\n\n expirations.push({\n expirationMethod,\n key,\n timeoutId: createTimeout(expirationMethod, maxAge),\n });\n }\n };\n}\n\n/**\n * @private\n *\n * @description\n * creates a function that, when a cache item is hit, reset the expiration\n *\n * @param expirations the mutable expirations array\n * @param options the options passed on initialization\n * @returns the onCacheAdd function to handle expirations\n */\nexport function createOnCacheHitResetExpiration<MoizeableFn extends AnyFn>(\n expirations: Expiration[],\n options: Options<MoizeableFn>\n): OnCacheOperation<MoizeableFn> {\n return function onCacheHit(cache: Cache<MoizeableFn>) {\n const key = cache.keys[0];\n const expirationIndex = findExpirationIndex(expirations, key);\n\n if (~expirationIndex) {\n clearExpiration(expirations, key, false);\n\n expirations[expirationIndex].timeoutId = createTimeout(\n expirations[expirationIndex].expirationMethod,\n options.maxAge\n );\n }\n };\n}\n\n/**\n * @private\n *\n * @description\n * get the micro-memoize options specific to the maxAge option\n *\n * @param expirations the expirations for the memoized function\n * @param options the options passed to the moizer\n * @param isEqual the function to test equality of the key on a per-argument basis\n * @param isMatchingKey the function to test equality of the whole key\n * @returns the object of options based on the entries passed\n */\nexport function getMaxAgeOptions<MoizeableFn extends AnyFn>(\n expirations: Expiration[],\n options: Options<MoizeableFn>,\n isEqual: IsEqual,\n isMatchingKey: IsMatchingKey\n): {\n onCacheAdd: OnCacheOperation<MoizeableFn> | undefined;\n onCacheHit: OnCacheOperation<MoizeableFn> | undefined;\n} {\n const onCacheAdd =\n typeof options.maxAge === 'number' && isFinite(options.maxAge)\n ? createOnCacheAddSetExpiration(\n expirations,\n options,\n isEqual,\n isMatchingKey\n )\n : undefined;\n\n return {\n onCacheAdd,\n onCacheHit:\n onCacheAdd && options.updateExpire\n ? createOnCacheHitResetExpiration(expirations, options)\n : undefined,\n };\n}\n","import type {\n GlobalStatsObject,\n Moizeable,\n OnCacheOperation,\n Options,\n StatsCache,\n StatsProfile,\n} from '../index.d';\n\nexport const statsCache: StatsCache = {\n anonymousProfileNameCounter: 1,\n isCollectingStats: false,\n profiles: {},\n};\n\nlet hasWarningDisplayed = false;\n\nexport function clearStats(profileName?: string) {\n if (profileName) {\n delete statsCache.profiles[profileName];\n } else {\n statsCache.profiles = {};\n }\n}\n\n/**\n * @private\n *\n * @description\n * activate stats collection\n *\n * @param isCollectingStats should stats be collected\n */\nexport function collectStats(isCollectingStats = true) {\n statsCache.isCollectingStats = isCollectingStats;\n}\n\n/**\n * @private\n *\n * @description\n * create a function that increments the number of calls for the specific profile\n */\nexport function createOnCacheAddIncrementCalls<MoizeableFn extends Moizeable>(\n options: Options<MoizeableFn>\n) {\n const { profileName } = options;\n\n return function () {\n if (profileName && !statsCache.profiles[profileName]) {\n statsCache.profiles[profileName] = {\n calls: 0,\n hits: 0,\n };\n }\n\n statsCache.profiles[profileName].calls++;\n };\n}\n\n/**\n * @private\n *\n * @description\n * create a function that increments the number of calls and cache hits for the specific profile\n */\nexport function createOnCacheHitIncrementCallsAndHits<\n MoizeableFn extends Moizeable\n>(options: Options<MoizeableFn>) {\n return function () {\n const { profiles } = statsCache;\n const { profileName } = options;\n\n if (!profiles[profileName]) {\n profiles[profileName] = {\n calls: 0,\n hits: 0,\n };\n }\n\n profiles[profileName].calls++;\n profiles[profileName].hits++;\n };\n}\n\n/**\n * @private\n *\n * @description\n * get the profileName for the function when one is not provided\n *\n * @param fn the function to be memoized\n * @returns the derived profileName for the function\n */\nexport function getDefaultProfileName<MoizeableFn extends Moizeable>(\n fn: MoizeableFn\n) {\n return (\n fn.displayName ||\n fn.name ||\n `Anonymous ${statsCache.anonymousProfileNameCounter++}`\n );\n}\n\n/**\n * @private\n *\n * @description\n * get the usage percentage based on the number of hits and total calls\n *\n * @param calls the number of calls made\n * @param hits the number of cache hits when called\n * @returns the usage as a percentage string\n */\nexport function getUsagePercentage(calls: number, hits: number) {\n return calls ? `${((hits / calls) * 100).toFixed(4)}%` : '0.0000%';\n}\n\n/**\n * @private\n *\n * @description\n * get the statistics for a given method or all methods\n *\n * @param [profileName] the profileName to get the statistics for (get all when not provided)\n * @returns the object with stats information\n */\nexport function getStats(profileName?: string): GlobalStatsObject {\n if (!statsCache.isCollectingStats && !hasWarningDisplayed) {\n console.warn(\n 'Stats are not currently being collected, please run \"collectStats\" to enable them.'\n ); // eslint-disable-line no-console\n\n hasWarningDisplayed = true;\n }\n\n const { profiles } = statsCache;\n\n if (profileName) {\n if (!profiles[profileName]) {\n return {\n calls: 0,\n hits: 0,\n usage: '0.0000%',\n };\n }\n\n const { [profileName]: profile } = profiles;\n\n return {\n ...profile,\n usage: getUsagePercentage(profile.calls, profile.hits),\n };\n }\n\n const completeStats: StatsProfile = Object.keys(statsCache.profiles).reduce(\n (completeProfiles, profileName) => {\n completeProfiles.calls += profiles[profileName].calls;\n completeProfiles.hits += profiles[profileName].hits;\n\n return completeProfiles;\n },\n {\n calls: 0,\n hits: 0,\n }\n );\n\n return {\n ...completeStats,\n profiles: Object.keys(profiles).reduce(\n (computedProfiles, profileName) => {\n computedProfiles[profileName] = getStats(profileName);\n\n return computedProfiles;\n },\n {} as Record<string, StatsProfile>\n ),\n usage: getUsagePercentage(completeStats.calls, completeStats.hits),\n };\n}\n\n/**\n * @private\n *\n * @function getStatsOptions\n *\n * @description\n * get the options specific to storing statistics\n *\n * @param {Options} options the options passed to the moizer\n * @returns {Object} the options specific to keeping stats\n */\nexport function getStatsOptions<MoizeableFn extends Moizeable>(\n options: Options<MoizeableFn>\n): {\n onCacheAdd?: OnCacheOperation<MoizeableFn>;\n onCacheHit?: OnCacheOperation<MoizeableFn>;\n} {\n return statsCache.isCollectingStats\n ? {\n onCacheAdd: createOnCacheAddIncrementCalls(options),\n onCacheHit: createOnCacheHitIncrementCallsAndHits(options),\n }\n : {};\n}\n","import { clearExpiration } from './maxAge';\nimport { clearStats, getStats } from './stats';\nimport { createFindKeyIndex } from './utils';\n\nimport type {\n Key,\n Memoized,\n Moizeable,\n MoizeConfiguration,\n Moized,\n Options,\n StatsProfile,\n} from '../index.d';\n\nconst ALWAYS_SKIPPED_PROPERTIES: Record<string, boolean> = {\n arguments: true,\n callee: true,\n caller: true,\n constructor: true,\n length: true,\n name: true,\n prototype: true,\n};\n\n/**\n * @private\n *\n * @description\n * copy the static properties from the original function to the moized\n * function\n *\n * @param originalFn the function copying from\n * @param newFn the function copying to\n * @param skippedProperties the list of skipped properties, if any\n */\nexport function copyStaticProperties<\n OriginalMoizeableFn extends Moizeable,\n NewMoizeableFn extends Moizeable\n>(\n originalFn: OriginalMoizeableFn,\n newFn: NewMoizeableFn,\n skippedProperties: string[] = []\n) {\n Object.getOwnPropertyNames(originalFn).forEach((property) => {\n if (\n !ALWAYS_SKIPPED_PROPERTIES[property] &&\n skippedProperties.indexOf(property) === -1\n ) {\n const descriptor = Object.getOwnPropertyDescriptor(\n originalFn,\n property\n );\n\n if (descriptor.get || descriptor.set) {\n Object.defineProperty(newFn, property, descriptor);\n } else {\n // @ts-expect-error - properites may not align\n newFn[property] = originalFn[property];\n }\n }\n });\n}\n\n/**\n * @private\n *\n * @description\n * add methods to the moized fuction object that allow extra features\n *\n * @param memoized the memoized function from micro-memoize\n */\nexport function addInstanceMethods<MoizeableFn extends Moizeable>(\n memoized: Moizeable,\n { expirations }: MoizeConfiguration<MoizeableFn>\n) {\n const { options } = memoized;\n\n const findKeyIndex = createFindKeyIndex(\n options.isEqual,\n options.isMatchingKey\n );\n\n const moized = memoized as unknown as Moized<\n MoizeableFn,\n Options<MoizeableFn>\n >;\n\n moized.clear = function () {\n const {\n _microMemoizeOptions: { onCacheChange },\n cache,\n } = moized;\n\n cache.keys.length = 0;\n cache.values.length = 0;\n\n if (onCacheChange) {\n onCacheChange(cache, moized.options, moized);\n }\n\n return true;\n };\n\n moized.clearStats = function () {\n clearStats(moized.options.profileName);\n };\n\n moized.get = function (key: Key) {\n const {\n _microMemoizeOptions: { transformKey },\n cache,\n } = moized;\n\n const cacheKey = transformKey ? transformKey(key) : key;\n const keyIndex = findKeyIndex(cache.keys, cacheKey);\n\n return keyIndex !== -1 ? moized.apply(this, key) : undefined;\n };\n\n moized.getStats = function (): StatsProfile {\n return getStats(moized.options.profileName);\n };\n\n moized.has = function (key: Key) {\n const { transformKey } = moized._microMemoizeOptions;\n\n const cacheKey = transformKey ? transformKey(key) : key;\n\n return findKeyIndex(moized.cache.keys, cacheKey) !== -1;\n };\n\n moized.keys = function () {\n return moized.cacheSnapshot.keys;\n };\n\n moized.remove = function (key: Key) {\n const {\n _microMemoizeOptions: { onCacheChange, transformKey },\n cache,\n } = moized;\n\n const keyIndex = findKeyIndex(\n cache.keys,\n transformKey ? transformKey(key) : key\n );\n\n if (keyIndex === -1) {\n return false;\n }\n\n const existingKey = cache.keys[keyIndex];\n\n cache.keys.splice(keyIndex, 1);\n cache.values.splice(keyIndex, 1);\n\n if (onCacheChange) {\n onCacheChange(cache, moized.options, moized);\n }\n\n clearExpiration(expirations, existingKey, true);\n\n return true;\n };\n\n moized.set = function (key: Key, value: any) {\n const { _microMemoizeOptions, cache, options } = moized;\n const { onCacheAdd, onCacheChange, transformKey } =\n _microMemoizeOptions;\n\n const cacheKey = transformKey ? transformKey(key) : key;\n const keyIndex = findKeyIndex(cache.keys, cacheKey);\n\n if (keyIndex === -1) {\n const cutoff = options.maxSize - 1;\n\n if (cache.size > cutoff) {\n cache.keys.length = cutoff;\n cache.values.length = cutoff;\n }\n\n cache.keys.unshift(cacheKey);\n cache.values.unshift(value);\n\n if (options.isPromise) {\n cache.updateAsyncCache(moized);\n }\n\n if (onCacheAdd) {\n onCacheAdd(cache, options, moized);\n }\n\n if (onCacheChange) {\n onCacheChange(cache, options, moized);\n }\n } else {\n const existingKey = cache.keys[keyIndex];\n\n cache.values[keyIndex] = value;\n\n if (keyIndex > 0) {\n cache.orderByLru(existingKey, value, keyIndex);\n }\n\n if (options.isPromise) {\n cache.updateAsyncCache(moized);\n }\n\n if (typeof onCacheChange === 'function') {\n onCacheChange(cache, options, moized);\n }\n }\n };\n\n moized.values = function () {\n return moized.cacheSnapshot.values;\n };\n}\n\n/**\n * @private\n *\n * @description\n * add propeties to the moized fuction object that surfaces extra information\n *\n * @param memoized the memoized function\n * @param expirations the list of expirations for cache items\n * @param options the options passed to the moizer\n * @param originalFunction the function that is being memoized\n */\nexport function addInstanceProperties<MoizeableFn extends Moizeable>(\n memoized: Memoized<MoizeableFn>,\n {\n expirations,\n options: moizeOptions,\n originalFunction,\n }: MoizeConfiguration<MoizeableFn>\n) {\n const { options: microMemoizeOptions } = memoized;\n\n Object.defineProperties(memoized, {\n _microMemoizeOptions: {\n configurable: true,\n get() {\n return microMemoizeOptions;\n },\n },\n\n cacheSnapshot: {\n configurable: true,\n get() {\n const { cache: currentCache } = memoized;\n\n return {\n keys: currentCache.keys.slice(0),\n size: currentCache.size,\n values: currentCache.values.slice(0),\n };\n },\n },\n\n expirations: {\n configurable: true,\n get() {\n return expirations;\n },\n },\n\n expirationsSnapshot: {\n configurable: true,\n get() {\n return expirations.slice(0);\n },\n },\n\n isMoized: {\n configurable: true,\n get() {\n return true;\n },\n },\n\n options: {\n configurable: true,\n get() {\n return moizeOptions;\n },\n },\n\n originalFunction: {\n configurable: true,\n get() {\n return originalFunction;\n },\n },\n });\n\n const moized = memoized as unknown as Moized<\n MoizeableFn,\n Options<MoizeableFn>\n >;\n\n copyStaticProperties(originalFunction, moized);\n}\n\n/**\n * @private\n *\n * @description\n * add methods and properties to the memoized function for more features\n *\n * @param memoized the memoized function\n * @param configuration the configuration object for the instance\n * @returns the memoized function passed\n */\nexport function createMoizeInstance<\n MoizeableFn extends Moizeable,\n CombinedOptions extends Options<MoizeableFn>\n>(\n memoized: Memoized<MoizeableFn>,\n configuration: MoizeConfiguration<MoizeableFn>\n) {\n addInstanceMethods<MoizeableFn>(memoized, configuration);\n addInstanceProperties<MoizeableFn>(memoized, configuration);\n\n return memoized as Moized<MoizeableFn, CombinedOptions>;\n}\n","import { copyStaticProperties } from './instance';\nimport { setName } from './utils';\n\nimport type {\n Moize,\n Moized as MoizedFunction,\n Moizeable,\n Options,\n} from '../index.d';\n\n// This was stolen from React internals, which allows us to create React elements without needing\n// a dependency on the React library itself.\nconst REACT_ELEMENT_TYPE =\n typeof Symbol === 'function' && Symbol.for\n ? Symbol.for('react.element')\n : 0xeac7;\n\n/**\n * @private\n *\n * @description\n * Create a component that memoizes based on `props` and legacy `context`\n * on a per-instance basis. This requires creating a component class to\n * store the memoized function. The cost is quite low, and avoids the\n * need to have access to the React dependency by basically re-creating\n * the basic essentials for a component class and the results of the\n * `createElement` function.\n *\n * @param moizer the top-level moize method\n * @param fn the component to memoize\n * @param options the memoization options\n * @returns the memoized component\n */\nexport function createMoizedComponent<MoizeableFn extends Moizeable>(\n moizer: Moize,\n fn: MoizeableFn,\n options: Options<MoizeableFn>\n) {\n /**\n * This is a hack override setting the necessary options\n * for a React component to be memoized. In the main `moize`\n * method, if the `isReact` option is set it is short-circuited\n * to call this function, and these overrides allow the\n * necessary transformKey method to be derived.\n *\n * The order is based on:\n * 1) Set the necessary aspects of transformKey for React components.\n * 2) Allow setting of other options and overrides of those aspects\n * if desired (for example, `isDeepEqual` will use deep equality).\n * 3) Always set `isReact` to false to prevent infinite loop.\n */\n const reactMoizer = moizer({\n maxArgs: 2,\n isShallowEqual: true,\n ...options,\n isReact: false,\n });\n\n if (!fn.displayName) {\n // @ts-ignore - allow setting of displayName\n fn.displayName = fn.name || 'Component';\n }\n\n function Moized<Props extends Record<string, unknown>, Context, Updater>(\n this: any,\n props: Props,\n context: Context,\n updater: Updater\n ) {\n this.props = props;\n this.context = context;\n this.updater = updater;\n\n this.MoizedComponent = reactMoizer(fn);\n }\n\n Moized.prototype.isReactComponent = {};\n\n Moized.prototype.render = function (): ReturnType<MoizeableFn> {\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: this.MoizedComponent,\n props: this.props,\n ref: null,\n key: null,\n _owner: null,\n } as ReturnType<MoizeableFn>;\n };\n\n copyStaticProperties(fn, Moized, ['contextType', 'contextTypes']);\n\n Moized.displayName = `Moized(${fn.displayName || fn.name || 'Component'})`;\n\n setName(Moized as MoizedFunction, fn.name, options.profileName);\n\n return Moized;\n}\n","import type { Key } from '../index.d';\n\nexport function createGetInitialArgs(size: number) {\n /**\n * @private\n *\n * @description\n * take the first N number of items from the array (faster than slice)\n *\n * @param args the args to take from\n * @returns the shortened list of args as an array\n */\n return function (args: Key): Key {\n if (size >= args.length) {\n return args;\n }\n\n if (size === 0) {\n return [];\n }\n\n if (size === 1) {\n return [args[0]];\n }\n\n if (size === 2) {\n return [args[0], args[1]];\n }\n\n if (size === 3) {\n return [args[0], args[1], args[2]];\n }\n\n const clone = [];\n\n for (let index = 0; index < size; index++) {\n clone[index] = args[index];\n }\n\n return clone;\n };\n}\n","import type { Key, Moizeable, Options } from '../index.d';\n\n/**\n * @function getCutoff\n *\n * @description\n * faster `Array.prototype.indexOf` implementation build for slicing / splicing\n *\n * @param array the array to match the value in\n * @param value the value to match\n * @returns the matching index, or -1\n */\nfunction getCutoff(array: any[], value: any) {\n const { length } = array;\n\n for (let index = 0; index < length; ++index) {\n if (array[index] === value) {\n return index + 1;\n }\n }\n\n return 0;\n}\n\n/**\n * @private\n *\n * @description\n * custom replacer for the stringify function\n *\n * @returns if function then toString of it, else the value itself\n */\nexport function createDefaultReplacer() {\n const cache: any[] = [];\n const keys: string[] = [];\n\n return function defaultReplacer(key: string, value: any) {\n const type = typeof value;\n\n if (type === 'function' || type === 'symbol') {\n return value.toString();\n }\n\n if (typeof value === 'object') {\n if (cache.length) {\n const thisCutoff = getCutoff(cache, this);\n\n if (thisCutoff === 0) {\n cache[cache.length] = this;\n } else {\n cache.splice(thisCutoff);\n keys.splice(thisCutoff);\n }\n\n keys[keys.length] = key;\n\n const valueCutoff = getCutoff(cache, value);\n\n if (valueCutoff !== 0) {\n return `[ref=${\n keys.slice(0, valueCutoff).join('.') || '.'\n }]`;\n }\n } else {\n cache[0] = value;\n keys[0] = key;\n }\n\n return value;\n }\n\n return '' + value;\n };\n}\n\n/**\n * @private\n *\n * @description\n * get the stringified version of the argument passed\n *\n * @param arg argument to stringify\n * @returns the stringified argument\n */\nexport function getStringifiedArgument<Type>(arg: Type) {\n const typeOfArg = typeof arg;\n\n return arg && (typeOfArg === 'object' || typeOfArg === 'function')\n ? JSON.stringify(arg, createDefaultReplacer())\n : arg;\n}\n\n/**\n * @private\n *\n * @description\n * serialize the arguments passed\n *\n * @param options the options passed to the moizer\n * @param options.maxArgs the cap on the number of arguments used in serialization\n * @returns argument serialization method\n */\nexport function defaultArgumentSerializer(args: Key) {\n let key = '|';\n\n for (let index = 0; index < args.length; index++) {\n key += getStringifiedArgument(args[index]) + '|';\n }\n\n return [key];\n}\n\n/**\n * @private\n *\n * @description\n * based on the options passed, either use the serializer passed or generate the internal one\n *\n * @param options the options passed to the moized function\n * @returns the function to use in serializing the arguments\n */\nexport function getSerializerFunction<MoizeableFn extends Moizeable>(\n options: Options<MoizeableFn>\n) {\n return typeof options.serializer === 'function'\n ? options.serializer\n : defaultArgumentSerializer;\n}\n\n/**\n * @private\n *\n * @description\n * are the serialized keys equal to one another\n *\n * @param cacheKey the cache key to compare\n * @param key the key to test\n * @returns are the keys equal\n */\nexport function getIsSerializedKeyEqual(cacheKey: Key, key: Key) {\n return cacheKey[0] === key[0];\n}\n","import { deepEqual, sameValueZeroEqual, shallowEqual } from 'fast-equals';\nimport { createGetInitialArgs } from './maxArgs';\nimport { getIsSerializedKeyEqual, getSerializerFunction } from './serialize';\nimport { compose } from './utils';\n\nimport type {\n Cache,\n IsEqual,\n IsMatchingKey,\n MicroMemoizeOptions,\n Moizeable,\n Moized,\n OnCacheOperation,\n Options,\n TransformKey,\n} from '../index.d';\n\nexport function createOnCacheOperation<MoizeableFn extends Moizeable>(\n fn?: OnCacheOperation<MoizeableFn>\n): OnCacheOperation<MoizeableFn> {\n if (typeof fn === 'function') {\n return (\n _cacheIgnored: Cache<MoizeableFn>,\n _microMemoizeOptionsIgnored: MicroMemoizeOptions<MoizeableFn>,\n memoized: Moized\n ): void => fn(memoized.cache, memoized.options, memoized);\n }\n}\n\n/**\n * @private\n *\n * @description\n * get the isEqual method passed to micro-memoize\n *\n * @param options the options passed to the moizer\n * @returns the isEqual method to apply\n */\nexport function getIsEqual<MoizeableFn extends Moizeable>(\n options: Options<MoizeableFn>\n): IsEqual {\n return (\n options.matchesArg ||\n (options.isDeepEqual && deepEqual) ||\n (options.isShallowEqual && shallowEqual) ||\n sameValueZeroEqual\n );\n}\n\n/**\n * @private\n *\n * @description\n * get the isEqual method passed to micro-memoize\n *\n * @param options the options passed to the moizer\n * @returns the isEqual method to apply\n */\nexport function getIsMatchingKey<MoizeableFn extends Moizeable>(\n options: Options<MoizeableFn>\n): IsMatchingKey | undefined {\n return (\n options.matchesKey ||\n (options.isSerialized && getIsSerializedKeyEqual) ||\n undefined\n );\n}\n\n/**\n * @private\n *\n * @description\n * get the function that will transform the key based on the arguments passed\n *\n * @param options the options passed to the moizer\n * @returns the function to transform the key with\n */\nexport function getTransformKey<MoizeableFn extends Moizeable>(\n options: Options<MoizeableFn>\n): TransformKey | undefined {\n return compose(\n options.isSerialized && getSerializerFunction(options),\n typeof options.transformArgs === 'function' && options.transformArgs,\n typeof options.maxArgs === 'number' &&\n createGetInitialArgs(options.maxArgs)\n ) as TransformKey;\n}\n","import { copyStaticProperties } from './instance';\n\nimport type { Moized } from '../index.d';\n\nexport function createRefreshableMoized<MoizedFn extends Moized>(\n moized: MoizedFn\n) {\n const {\n options: { updateCacheForKey },\n } = moized;\n\n /**\n * @private\n *\n * @description\n * Wrapper around already-`moize`d function which will intercept the memoization\n * and call the underlying function directly with the purpose of updating the cache\n * for the given key.\n *\n * Promise values use a tweak of the logic that exists at cache.updateAsyncCache, which\n * reverts to the original value if the promise is rejected and there was already a cached\n * value.\n */\n const refreshableMoized = function refreshableMoized(\n this: any,\n ...args: Parameters<typeof moized.fn>\n ) {\n if (!updateCacheForKey(args)) {\n return moized.apply(this, args);\n }\n\n const result = moized.fn.apply(this, args);\n\n moized.set(args, result);\n\n return result;\n } as typeof moized;\n\n copyStaticProperties(moized, refreshableMoized);\n\n return refreshableMoized;\n}\n","import memoize from 'micro-memoize';\nimport { createMoizedComponent } from './component';\nimport { DEFAULT_OPTIONS } from './constants';\nimport { createMoizeInstance } from './instance';\nimport { getMaxAgeOptions } from './maxAge';\nimport {\n createOnCacheOperation,\n getIsEqual,\n getIsMatchingKey,\n getTransformKey,\n} from './options';\nimport {\n clearStats,\n collectStats,\n getDefaultProfileName,\n getStats,\n getStatsOptions,\n statsCache,\n} from './stats';\nimport { createRefreshableMoized } from './updateCacheForKey';\nimport { combine, compose, isMoized, mergeOptions, setName } from './utils';\n\nimport type {\n Expiration,\n IsEqual,\n IsMatchingKey,\n MicroMemoizeOptions,\n Moize,\n Moizeable,\n Moized,\n OnExpire,\n Options,\n Serialize,\n TransformKey,\n UpdateCacheForKey,\n} from '../index.d';\n\n/**\n * @module moize\n */\n\n/**\n * @description\n * memoize a function based its arguments passed, potentially improving runtime performance\n *\n * @example\n * import moize from 'moize';\n *\n * // standard implementation\n * const fn = (foo, bar) => `${foo} ${bar}`;\n * const memoizedFn = moize(fn);\n *\n * // implementation with options\n * const fn = async (id) => get(`http://foo.com/${id}`);\n * const memoizedFn = moize(fn, {isPromise: true, maxSize: 5});\n *\n * // implementation with convenience methods\n * const Foo = ({foo}) => <div>{foo}</div>;\n * const MemoizedFoo = moize.react(Foo);\n *\n * @param fn the function to memoized, or a list of options when currying\n * @param [options=DEFAULT_OPTIONS] the options to apply\n * @returns the memoized function\n */\nconst moize: Moize = function <\n MoizeableFn extends Moizeable,\n PassedOptions extends Options<MoizeableFn>\n>(fn: MoizeableFn | PassedOptions, passedOptions?: PassedOptions) {\n type CombinedOptions = Omit<Options<MoizeableFn>, keyof PassedOptions> &\n PassedOptions;\n\n const options: Options<MoizeableFn> = passedOptions || DEFAULT_OPTIONS;\n\n if (isMoized(fn)) {\n const moizeable = fn.originalFunction as MoizeableFn;\n const mergedOptions = mergeOptions(\n fn.options,\n options\n ) as CombinedOptions;\n\n return moize<MoizeableFn, CombinedOptions>(moizeable, mergedOptions);\n }\n\n if (typeof fn === 'object') {\n return function <\n CurriedFn extends Moizeable,\n CurriedOptions extends Options<CurriedFn>\n >(\n curriedFn: CurriedFn | CurriedOptions,\n curriedOptions: CurriedOptions\n ) {\n type CombinedCurriedOptions = Omit<\n CombinedOptions,\n keyof CurriedOptions\n > &\n CurriedOptions;\n\n if (typeof curriedFn === 'function') {\n const mergedOptions = mergeOptions(\n fn as CombinedOptions,\n curriedOptions\n ) as CombinedCurriedOptions;\n\n return moize(curriedFn, mergedOptions);\n }\n\n const mergedOptions = mergeOptions(\n fn as CombinedOptions,\n curriedFn as CurriedOptions\n );\n\n return moize(mergedOptions);\n };\n }\n\n if (options.isReact) {\n return createMoizedComponent(moize, fn, options);\n }\n\n const coalescedOptions: Options<MoizeableFn> = {\n ...DEFAULT_OPTIONS,\n ...options,\n maxAge:\n typeof options.maxAge === 'number' && options.maxAge >= 0\n ? options.maxAge\n : DEFAULT_OPTIONS.maxAge,\n maxArgs:\n typeof options.maxArgs === 'number' && options.maxArgs >= 0\n ? options.maxArgs\n : DEFAULT_OPTIONS.maxArgs,\n maxSize:\n typeof options.maxSize === 'number' && options.maxSize >= 0\n ? options.maxSize\n : DEFAULT_OPTIONS.maxSize,\n profileName: options.profileName || getDefaultProfileName(fn),\n };\n const expirations: Array<Expiration> = [];\n\n const {\n matchesArg: equalsIgnored,\n isDeepEqual: isDeepEqualIgnored,\n isPromise,\n isReact: isReactIgnored,\n isSerialized: isSerialzedIgnored,\n isShallowEqual: isShallowEqualIgnored,\n matchesKey: matchesKeyIgnored,\n maxAge: maxAgeIgnored,\n maxArgs: maxArgsIgnored,\n maxSize,\n onCacheAdd,\n onCacheChange,\n onCacheHit,\n onExpire: onExpireIgnored,\n profileName: profileNameIgnored,\n serializer: serializerIgnored,\n updateCacheForKey,\n transformArgs: transformArgsIgnored,\n updateExpire: updateExpireIgnored,\n ...customOptions\n } = coalescedOptions;\n\n const isEqual = getIsEqual(coalescedOptions);\n const isMatchingKey = getIsMatchingKey(coalescedOptions);\n\n const maxAgeOptions = getMaxAgeOptions(\n expirations,\n coalescedOptions,\n isEqual,\n isMatchingKey\n );\n const statsOptions = getStatsOptions(coalescedOptions);\n\n const transformKey = getTransformKey(coalescedOptions);\n\n const microMemoizeOptions: MicroMemoizeOptions<MoizeableFn> = {\n ...customOptions,\n isEqual,\n isMatchingKey,\n isPromise,\n maxSize,\n onCacheAdd: createOnCacheOperation(\n combine(\n onCacheAdd,\n maxAgeOptions.onCacheAdd,\n statsOptions.onCacheAdd\n )\n ),\n onCacheChange: createOnCacheOperation(onCacheChange),\n onCacheHit: createOnCacheOperation(\n combine(\n onCacheHit,\n maxAgeOptions.onCacheHit,\n statsOptions.onCacheHit\n )\n ),\n transformKey,\n };\n\n const memoized = memoize(fn, microMemoizeOptions);\n\n let moized = createMoizeInstance<MoizeableFn, CombinedOptions>(memoized, {\n expirations,\n options: coalescedOptions,\n originalFunction: fn,\n });\n\n if (updateCacheForKey) {\n moized = createRefreshableMoized<typeof moized>(moized);\n }\n\n setName(moized, (fn as Moizeable).name, options.profileName);\n\n return moized;\n};\n\n/**\n * @function\n * @name clearStats\n * @memberof module:moize\n * @alias moize.clearStats\n *\n * @description\n * clear all existing stats stored\n */\nmoize.clearStats = clearStats;\n\n/**\n * @function\n * @name collectStats\n * @memberof module:moize\n * @alias moize.collectStats\n *\n * @description\n * start collecting statistics\n */\nmoize.collectStats = collectStats;\n\n/**\n * @function\n * @name compose\n * @memberof module:moize\n * @alias moize.compose\n *\n * @description\n * method to compose moized methods and return a single moized function\n *\n * @param moized the functions to compose\n * @returns the composed function\n */\nmoize.compose = function (...moized: Moize[]) {\n return compose<Moize>(...moized) || moize;\n};\n\n/**\n * @function\n * @name deep\n * @memberof module:moize\n * @alias moize.deep\n *\n * @description\n * should deep equality check be used\n *\n * @returns the moizer function\n */\nmoize.deep = moize({ isDeepEqual: true });\n\n/**\n * @function\n * @name getStats\n * @memberof module:moize\n * @alias moize.getStats\n *\n * @description\n * get the statistics of a given profile, or overall usage\n *\n * @returns statistics for a given profile or overall usage\n */\nmoize.getStats = getStats;\n\n/**\n * @function\n * @name infinite\n * @memberof module:moize\n * @alias moize.infinite\n *\n * @description\n * a moized method that will remove all limits from the cache size\n *\n * @returns the moizer function\n */\nmoize.infinite = moize({ maxSize: Infinity });\n\n/**\n * @function\n * @name isCollectingStats\n * @memberof module:moize\n * @alias moize.isCollectingStats\n *\n * @description\n * are stats being collected\n *\n * @returns are stats being collected\n */\nmoize.isCollectingStats = function isCollectingStats(): boolean {\n return statsCache.isCollectingStats;\n};\n\n/**\n * @function\n * @name isMoized\n * @memberof module:moize\n * @alias moize.isMoized\n *\n * @description\n * is the fn passed a moized function\n *\n * @param fn the object to test\n * @returns is fn a moized function\n */\nmoize.isMoized = function isMoized(fn: any): fn is Moized {\n return typeof fn === 'function' && !!fn.isMoized;\n};\n\n/**\n * @function\n * @name matchesArg\n * @memberof module:moize\n * @alias moize.matchesArg\n *\n * @description\n * a moized method where the arg matching method is the custom one passed\n *\n * @param keyMatcher the method to compare against those in cache\n * @returns the moizer function\n */\nmoize.matchesArg = function (argMatcher: IsEqual) {\n return moize({ matchesArg: argMatcher });\n};\n\n/**\n * @function\n * @name matchesKey\n * @memberof module:moize\n * @alias moize.matchesKey\n *\n * @description\n * a moized method where the key matching method is the custom one passed\n *\n * @param keyMatcher the method to compare against those in cache\n * @returns the moizer function\n */\nmoize.matchesKey = function (keyMatcher: IsMatchingKey) {\n return moize({ matchesKey: keyMatcher });\n};\n\nfunction maxAge<MaxAge extends number>(\n maxAge: MaxAge\n): Moize<{ maxAge: MaxAge }>;\nfunction maxAge<MaxAge extends number, UpdateExpire extends boolean>(\n maxAge: MaxAge,\n expireOptions: UpdateExpire\n): Moize<{ maxAge: MaxAge; updateExpire: UpdateExpire }>;\nfunction maxAge<MaxAge extends number, ExpireHandler extends OnExpire>(\n maxAge: MaxAge,\n expireOptions: ExpireHandler\n): Moize<{ maxAge: MaxAge; onExpire: ExpireHandler }>;\nfunction maxAge<\n MaxAge extends number,\n ExpireHandler extends OnExpire,\n ExpireOptions extends {\n onExpire: ExpireHandler;\n }\n>(\n maxAge: MaxAge,\n expireOptions: ExpireOptions\n): Moize<{ maxAge: MaxAge; onExpire: ExpireOptions['onExpire'] }>;\nfunction maxAge<\n MaxAge extends number,\n UpdateExpire extends boolean,\n ExpireOptions extends {\n updateExpire: UpdateExpire;\n }\n>(\n maxAge: MaxAge,\n expireOptions: ExpireOptions\n): Moize<{ maxAge: MaxAge; updateExpire: UpdateExpire }>;\nfunction maxAge<\n MaxAge extends number,\n ExpireHandler extends OnExpire,\n UpdateExpire extends boolean,\n ExpireOptions extends {\n onExpire: ExpireHandler;\n updateExpire: UpdateExpire;\n }\n>(\n maxAge: MaxAge,\n expireOptions: ExpireOptions\n): Moize<{\n maxAge: MaxAge;\n onExpire: ExpireHandler;\n updateExpire: UpdateExpire;\n}>;\nfunction maxAge<\n MaxAge extends number,\n ExpireHandler extends OnExpire,\n UpdateExpire extends boolean,\n ExpireOptions extends {\n onExpire?: ExpireHandler;\n updateExpire?: UpdateExpire;\n }\n>(\n maxAge: MaxAge,\n expireOptions?: ExpireHandler | UpdateExpire | ExpireOptions\n) {\n if (expireOptions === true) {\n return moize({\n maxAge,\n updateExpire: expireOptions,\n });\n }\n\n if (typeof expireOptions === 'object') {\n const { onExpire, updateExpire } = expireOptions;\n\n return moize({\n maxAge,\n onExpire,\n updateExpire,\n });\n }\n\n if (typeof expireOptions === 'function') {\n return moize({\n maxAge,\n onExpire: expireOptions,\n updateExpire: true,\n });\n }\n\n return moize({ maxAge });\n}\n\n/**\n * @function\n * @name maxAge\n * @memberof module:moize\n * @alias moize.maxAge\n *\n * @description\n * a moized method where the age of the cache is limited to the number of milliseconds passed\n *\n * @param maxAge the TTL of the value in cache\n * @returns the moizer function\n */\nmoize.maxAge = maxAge;\n\n/**\n * @function\n * @name maxArgs\n * @memberof module:moize\n * @alias moize.maxArgs\n *\n * @description\n * a moized method where the number of arguments used for determining cache is limited to the value passed\n *\n * @param maxArgs the number of args to base the key on\n * @returns the moizer function\n */\nmoize.maxArgs = function maxArgs(maxArgs: number) {\n return moize({ maxArgs });\n};\n\n/**\n * @function\n * @name maxSize\n * @memberof module:moize\n * @alias moize.maxSize\n *\n * @description\n * a moized method where the total size of the cache is limited to the value passed\n *\n * @param maxSize the maximum size of the cache\n * @returns the moizer function\n */\nmoize.maxSize = function maxSize(maxSize: number) {\n return moize({ maxSize });\n};\n\n/**\n * @function\n * @name profile\n * @memberof module:moize\n * @alias moize.profile\n *\n * @description\n * a moized method with a profile name\n *\n * @returns the moizer function\n */\nmoize.profile = function (profileName: string) {\n return moize({ profileName });\n};\n\n/**\n * @function\n * @name promise\n * @memberof module:moize\n * @alias moize.promise\n *\n * @description\n * a moized method specific to caching resolved promise / async values\n *\n * @returns the moizer function\n */\nmoize.promise = moize({\n isPromise: true,\n updateExpire: true,\n});\n\n/**\n * @function\n * @name react\n * @memberof module:moize\n * @alias moize.react\n *\n * @description\n * a moized method specific to caching React element values\n *\n * @returns the moizer function\n */\nmoize.react = moize({ isReact: true });\n\n/**\n * @function\n * @name serialize\n * @memberof module:moize\n * @alias moize.serialize\n *\n * @description\n * a moized method that will serialize the arguments passed to use as the cache key\n *\n * @returns the moizer function\n */\nmoize.serialize = moize({ isSerialized: true });\n\n/**\n * @function\n * @name serializeWith\n * @memberof module:moize\n * @alias moize.serializeWith\n *\n * @description\n * a moized method that will serialize the arguments passed to use as the cache key\n * based on the serializer passed\n *\n * @returns the moizer function\n */\nmoize.serializeWith = function (serializer: Serialize) {\n return moize({ isSerialized: true, serializer });\n};\n\n/**\n * @function\n * @name shallow\n * @memberof module:moize\n * @alias moize.shallow\n *\n * @description\n * should shallow equality check be used\n *\n * @returns the moizer function\n */\nmoize.shallow = moize({ isShallowEqual: true });\n\n/**\n * @function\n * @name transformArgs\n * @memberof module:moize\n * @alias moize.transformArgs\n *\n * @description\n * transform the args to allow for specific cache key comparison\n *\n * @param transformArgs the args transformer\n * @returns the moizer function\n */\nmoize.transformArgs = <Transformer extends TransformKey>(\n transformArgs: Transformer\n) => moize({ transformArgs });\n\n/**\n * @function\n * @name updateCacheForKey\n * @memberof module:moize\n * @alias moize.updateCacheForKey\n *\n * @description\n * update the cache for a given key when the method passed returns truthy\n *\n * @param updateCacheForKey the method to determine when to update cache\n * @returns the moizer function\n */\nmoize.updateCacheForKey = <UpdateWhen extends UpdateCacheForKey>(\n updateCacheForKey: UpdateWhen\n) => moize({ updateCacheForKey });\n\n// Add self-referring `default` property for edge-case cross-compatibility of mixed ESM/CommonJS usage.\n// This property is frozen and non-enumerable to avoid visibility on iteration or accidental overrides.\nObject.defineProperty(moize, 'default', {\n configurable: false,\n enumerable: false,\n value: moize,\n writable: false,\n});\n\nexport default moize;\n"],"names":["DEFAULT_OPTIONS","isDeepEqual","isPromise","isReact","isSerialized","isShallowEqual","matchesArg","undefined","matchesKey","maxAge","maxArgs","maxSize","onExpire","profileName","serializer","updateCacheForKey","transformArgs","updateExpire","combine","_len","arguments","length","functions","Array","_key","reduce","f","g","apply","compose","_len2","_key2","findExpirationIndex","expirations","key","index","createFindKeyIndex","isEqual","isMatchingKey","areKeysEqual","cacheKey","keys","keysIndex","mergeOptions","originalOptions","newOptions","_extends","onCacheAdd","onCacheChange","onCacheHit","isMoized","fn","setName","originalFunctionName","name","Object","defineProperty","configurable","enumerable","value","writable","_unused","clearExpiration","shouldRemove","expirationIndex","clearTimeout","timeoutId","splice","createTimeout","expirationMethod","setTimeout","unref","createOnCacheAddSetExpiration","options","cache","moizedOptions","moized","findKeyIndex","keyIndex","values","unshift","push","createOnCacheHitResetExpiration","getMaxAgeOptions","isFinite","statsCache","anonymousProfileNameCounter","isCollectingStats","profiles","hasWarningDisplayed","clearStats","collectStats","createOnCacheAddIncrementCalls","calls","hits","createOnCacheHitIncrementCallsAndHits","getDefaultProfileName","displayName","getUsagePercentage","toFixed","getStats","console","warn","usage","profile","completeStats","completeProfiles","computedProfiles","getStatsOptions","ALWAYS_SKIPPED_PROPERTIES","callee","caller","constructor","prototype","copyStaticProperties","originalFn","newFn","skippedProperties","getOwnPropertyNames","forEach","property","indexOf","descriptor","getOwnPropertyDescriptor","get","set","addInstanceMethods","memoized","_ref","clear","_microMemoizeOptions","transformKey","has","cacheSnapshot","remove","_moized$_microMemoize","existingKey","cutoff","size","updateAsyncCache","orderByLru","addInstanceProperties","_ref2","moizeOptions","originalFunction","microMemoizeOptions","defineProperties","currentCache","slice","expirationsSnapshot","createMoizeInstance","configuration","REACT_ELEMENT_TYPE","Symbol","for","createMoizedComponent","moizer","reactMoizer","Moized","props","context","updater","MoizedComponent","isReactComponent","render","$$typeof","type","ref","_owner","createGetInitialArgs","args","clone","getCutoff","array","createDefaultReplacer","defaultReplacer","toString","thisCutoff","valueCutoff","join","getStringifiedArgument","arg","typeOfArg","JSON","stringify","defaultArgumentSerializer","getSerializerFunction","getIsSerializedKeyEqual","createOnCacheOperation","_cacheIgnored","_microMemoizeOptionsIgnored","getIsEqual","deepEqual","shallowEqual","sameValueZeroEqual","getIsMatchingKey","getTransformKey","createRefreshableMoized","refreshableMoized","result","moize","passedOptions","moizeable","mergedOptions","curriedFn","curriedOptions","coalescedOptions","customOptions","_objectWithoutPropertiesLoose","_excluded","maxAgeOptions","statsOptions","memoize","deep","infinite","Infinity","argMatcher","keyMatcher","expireOptions","promise","react","serialize","serializeWith","shallow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;EACA;EACO,IAAMA,eAA+B,GAAG;EAC3CC,EAAAA,WAAW,EAAE,KAAK;EAClBC,EAAAA,SAAS,EAAE,KAAK;EAChBC,EAAAA,OAAO,EAAE,KAAK;EACdC,EAAAA,YAAY,EAAE,KAAK;EACnBC,EAAAA,cAAc,EAAE,KAAK;EACrBC,EAAAA,UAAU,EAAEC,SAAS;EACrBC,EAAAA,UAAU,EAAED,SAAS;EACrBE,EAAAA,MAAM,EAAEF,SAAS;EACjBG,EAAAA,OAAO,EAAEH,SAAS;EAClBI,EAAAA,OAAO,EAAE,CAAC;EACVC,EAAAA,QAAQ,EAAEL,SAAS;EACnBM,EAAAA,WAAW,EAAEN,SAAS;EACtBO,EAAAA,UAAU,EAAEP,SAAS;EACrBQ,EAAAA,iBAAiB,EAAER,SAAS;EAC5BS,EAAAA,aAAa,EAAET,SAAS;EACxBU,EAAAA,YAAY,EAAE,KAAA;EAClB,CAAC;;ECXD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACO,SAASC,OAAOA,GAEoB;EAAA,EAAA,KAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EADpCC,SAAS,GAAAC,IAAAA,KAAA,CAAAJ,IAAA,GAAAK,IAAA,G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