mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Cleanup stringToPath.
This commit is contained in:
@@ -13,13 +13,13 @@ const MAX_MEMOIZE_SIZE = 500;
|
||||
*/
|
||||
function memoizeCapped(func) {
|
||||
const result = memoize(func, key => {
|
||||
const { cache } = result;
|
||||
if (cache.size === MAX_MEMOIZE_SIZE) {
|
||||
cache.clear();
|
||||
}
|
||||
return key;
|
||||
});
|
||||
|
||||
const cache = result.cache;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user