Cleanup stringToPath.

This commit is contained in:
John-David Dalton
2017-01-10 17:25:48 -08:00
parent c5d4bb8dcb
commit 003c11c36b
2 changed files with 3 additions and 2 deletions

View File

@@ -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;
}