mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
1.9 KiB
JSON
1 line
1.9 KiB
JSON
{"ast":null,"code":"import memoize from './memoize.js';\n/** Used as the maximum memoize cache size. */\n\nvar MAX_MEMOIZE_SIZE = 500;\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n\nfunction memoizeCapped(func) {\n var result = memoize(func, function (key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n\n return key;\n });\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;","map":{"version":3,"sources":["/app/node_modules/lodash-es/_memoizeCapped.js"],"names":["memoize","MAX_MEMOIZE_SIZE","memoizeCapped","func","result","key","cache","size","clear"],"mappings":"AAAA,OAAOA,OAAP,MAAoB,cAApB;AAEA;;AACA,IAAIC,gBAAgB,GAAG,GAAvB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT,CAAuBC,IAAvB,EAA6B;AAC3B,MAAIC,MAAM,GAAGJ,OAAO,CAACG,IAAD,EAAO,UAASE,GAAT,EAAc;AACvC,QAAIC,KAAK,CAACC,IAAN,KAAeN,gBAAnB,EAAqC;AACnCK,MAAAA,KAAK,CAACE,KAAN;AACD;;AACD,WAAOH,GAAP;AACD,GALmB,CAApB;AAOA,MAAIC,KAAK,GAAGF,MAAM,CAACE,KAAnB;AACA,SAAOF,MAAP;AACD;;AAED,eAAeF,aAAf","sourcesContent":["import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n"]},"metadata":{},"sourceType":"module"} |