mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Update docs and builds.
Former-commit-id: 6bb15d3ad0d4d189ad5e27e1dd79d2a070a568b2
This commit is contained in:
11
dist/lodash.underscore.js
vendored
11
dist/lodash.underscore.js
vendored
@@ -18,9 +18,9 @@
|
||||
/** Detect free variable `module` */
|
||||
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
|
||||
|
||||
/** Detect free variable `global` and use it as `window` */
|
||||
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
|
||||
var freeGlobal = typeof global == 'object' && global;
|
||||
if (freeGlobal.global === freeGlobal) {
|
||||
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
||||
window = freeGlobal;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
/** Used internally to indicate various things */
|
||||
var indicatorObject = {};
|
||||
|
||||
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
|
||||
var keyPrefix = +new Date + '';
|
||||
|
||||
/** Used to match empty string literals in compiled template source */
|
||||
var reEmptyStringLeading = /\b__p \+= '';/g,
|
||||
reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
|
||||
@@ -122,7 +125,7 @@
|
||||
toString = objectRef.toString;
|
||||
|
||||
/* Native method shortcuts for methods with the same name as other `lodash` methods */
|
||||
var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind,
|
||||
var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
|
||||
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
|
||||
nativeIsFinite = window.isFinite,
|
||||
nativeIsNaN = window.isNaN,
|
||||
@@ -3530,7 +3533,7 @@
|
||||
function memoize(func, resolver) {
|
||||
var cache = {};
|
||||
return function() {
|
||||
var key = String(resolver ? resolver.apply(this, arguments) : arguments[0]);
|
||||
var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
|
||||
return hasOwnProperty.call(cache, key)
|
||||
? cache[key]
|
||||
: (cache[key] = func.apply(this, arguments));
|
||||
|
||||
Reference in New Issue
Block a user