mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import memoizeCapped from './.internal/memoizeCapped.js';
|
||||
|
||||
/** Used to match property names within property paths. */
|
||||
const reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
||||
const reLeadingDot = /^\./;
|
||||
const rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
||||
|
||||
/** Used to match backslashes in property paths. */
|
||||
const reEscapeChar = /\\(\\)?/g;
|
||||
|
||||
Reference in New Issue
Block a user