From e9a15d918946a9c788f99ad05f57955b53ab0f73 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 11 Jan 2014 21:48:10 -0800 Subject: [PATCH] Remove `keyPrefix` for using a simple `_` prefix. --- dist/lodash.compat.js | 41 ++++++------- dist/lodash.compat.min.js | 118 +++++++++++++++++++------------------- dist/lodash.js | 38 ++++++------ dist/lodash.min.js | 108 +++++++++++++++++----------------- lodash.js | 12 +--- 5 files changed, 150 insertions(+), 167 deletions(-) diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 25b64725d..d3cb3f378 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -19,12 +19,6 @@ /** Used to generate unique IDs */ var idCounter = 0; - /** Used internally to indicate various things */ - var indicatorObject = {}; - - /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */ - var keyPrefix = '__1335248838000__'; - /** Used as the size when optimizations are enabled for large arrays */ var largeArraySize = 75; @@ -230,8 +224,7 @@ } /** - * The base implementation of `_.indexOf` without support for binary searches - * or `fromIndex` constraints. + * The base implementation of `_.indexOf` without support for binary searches. * * @private * @param {Array} array The array to search. @@ -270,7 +263,7 @@ if (type != 'number' && type != 'string') { type = 'object'; } - var key = type == 'number' ? value : keyPrefix + value; + var key = type == 'number' ? value : '_' + value; cache = (cache = cache[type]) && cache[key]; return type == 'object' @@ -294,7 +287,7 @@ if (type != 'number' && type != 'string') { type = 'object'; } - var key = type == 'number' ? value : keyPrefix + value, + var key = type == 'number' ? value : '_' + value, typeCache = cache[type] || (cache[type] = {}); if (type == 'object') { @@ -327,7 +320,7 @@ * * @private * @param {string} string The string to inspect. - * @returns {number} Returns the index of the first non-whitespace character. + * @returns {number} Returns the index of the first character not found in `chars`. */ function charsLeftIndex(string, chars) { var index = -1, @@ -346,7 +339,7 @@ * * @private * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. + * @returns {number} Returns the index of the last character not found in `chars`. */ function charsRightIndex(string, chars) { var index = string.length; @@ -507,7 +500,7 @@ * Releases `array` back to the array pool. * * @private - * @param {Array} [array] The array to release. + * @param {Array} array The array to release. */ function releaseArray(array) { array.length = 0; @@ -520,7 +513,7 @@ * Releases `object` back to the object pool. * * @private - * @param {Object} [object] The object to release. + * @param {Object} object The object to release. */ function releaseObject(object) { var cache = object.cache; @@ -850,7 +843,7 @@ * * @private * @param {*} value The value to wrap in a `lodash` instance. - * @param {boolean} chainAll A flag to enable chaining for all methods + * @param {boolean} [chainAll=false] A flag to enable chaining for all methods * @returns {Object} Returns a `lodash` instance. */ function lodashWrapper(value, chainAll) { @@ -1280,7 +1273,7 @@ * @param {Object} prototype The object to inherit from. * @returns {Object} Returns the new object. */ - function baseCreate(prototype, properties) { + function baseCreate(prototype) { return isObject(prototype) ? nativeCreate(prototype) : {}; } // fallback for environments without `Object.create` @@ -3830,7 +3823,7 @@ * @param {Array|Object|string} collection The collection to iterate over. * @param {Function|string} methodName The name of the method to invoke or * the function invoked per iteration. - * @param {...*} [arg] Arguments to invoke the method with. + * @param {...*} [args] Arguments to invoke the method with. * @returns {Array} Returns a new array of the results of each invoked method. * @example * @@ -4536,7 +4529,7 @@ * @category Functions * @param {Function} func The function to bind. * @param {*} [thisArg] The `this` binding of `func`. - * @param {...*} [arg] Arguments to be partially applied. + * @param {...*} [args] Arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * @@ -4605,7 +4598,7 @@ * @category Functions * @param {Object} object The object the method belongs to. * @param {string} key The key of the method. - * @param {...*} [arg] Arguments to be partially applied. + * @param {...*} [args] Arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * @@ -4866,7 +4859,7 @@ * @memberOf _ * @category Functions * @param {Function} func The function to defer. - * @param {...*} [arg] Arguments to invoke the function with. + * @param {...*} [args] Arguments to invoke the function with. * @returns {number} Returns the timer id. * @example * @@ -4890,7 +4883,7 @@ * @category Functions * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay execution. - * @param {...*} [arg] Arguments to invoke the function with. + * @param {...*} [args] Arguments to invoke the function with. * @returns {number} Returns the timer id. * @example * @@ -4948,7 +4941,7 @@ } var memoized = function() { var cache = memoized.cache, - key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0]; + key = resolver ? resolver.apply(this, arguments) : '_' + arguments[0]; return hasOwnProperty.call(cache, key) ? cache[key] @@ -5007,7 +5000,7 @@ * @memberOf _ * @category Functions * @param {Function} func The function to partially apply arguments to. - * @param {...*} [arg] Arguments to be partially applied. + * @param {...*} [args] Arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * @@ -5031,7 +5024,7 @@ * @memberOf _ * @category Functions * @param {Function} func The function to partially apply arguments to. - * @param {...*} [arg] Arguments to be partially applied. + * @param {...*} [args] Arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index ed7464177..30d9b5a4f 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -3,62 +3,62 @@ * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE * Build: `lodash -o ./dist/lodash.compat.js` */ -;(function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202=A&&o===t,l=[];if(i){var c=f(e);c?(o=r,e=c):i=false}for(;++uo(e,c)&&l.push(c);return i&&y(e),l}function lt(n,t,r){var e=-1,u=n,o=n?n.length:0;if(t=t&&typeof r=="undefined"?t:k(t,r,3),typeof o=="number")for(te.unindexedChars&&er(u)&&(u=u.split(""));++e=A&&a===t,p=u||c?s():l;for(c&&(p=f(p),a=r);++oa(p,g))&&((u||c)&&p.push(g),l.push(h))}return c?(v(p.g),y(p)):u&&v(p),l}function dt(n){return function(t,r,u){var o={}; -if(r=e.createCallback(r,u,3),fe(t)){u=-1;for(var a=t.length;++uu;u++)e+="l='"+n.d[u]+"';if((!(k&&n[l])&&h.call(p,l))",n.f||(e+="||(!n[l]&&p[l]!==q[l])"),e+="){"+n.c+"}"; -e+="}"}return t("a,f,g,h,j,q,r,o,v,w,y",r+(e+"return s;")+"}")(k,Z,wr,Tr,Ct,jr,pt,ne,ut,xr,Or)}function wt(){var n=(n=e.indexOf)===Ot?t:n;return n}function jt(n){return typeof n=="function"&&Er.test(Nr.call(n))}function xt(n){var t,r;return!n||Or.call(n)!=rt||!Tr.call(n,"constructor")&&(t=n.constructor,nr(t)&&!(t instanceof t))||!te.argsClass&&Ct(n)||!te.nodeClass&&g(n)?false:te.ownLast?(le(n,function(n,t,e){return r=Tr.call(e,t),false}),false!==r):(le(n,function(n,t){r=t}),typeof r=="undefined"||Tr.call(n,r)) -}function Ct(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Or.call(n)==H||false}function kt(n,t,r){var u=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=-1;for(t=e.createCallback(t,r,3);++ae?Vr(0,u+e):e||0}else if(e)return e=At(n,r),n[e]===r?e:-1;return t(n,r,e)}function Et(n,t,r){if(typeof t!="number"&&null!=t){var u=0,o=-1,a=n?n.length:0; -for(t=e.createCallback(t,r,3);++ot?t=Vr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Vr(u+r,0):r>u&&(r=u),u=r-t||0,r=cr(u);++e>>1,r(n[u])r?0:r);++t=e)return false;if(typeof n=="string"||!fe(n)&&er(n))return Br?Br.call(n,t,r):-1r?Vr(0,e+r):r)||0,-1a&&(a=l)}}else t=null==t&&er(n)?u:e.createCallback(t,r,3),lt(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,a=n)});return a}function zt(n,t,r,u){var o=3>arguments.length;if(t=e.createCallback(t,u,4),fe(n)){var a=-1,i=n.length; -for(o&&i&&(r=n[++a]);++aarguments.length;return t=e.createCallback(t,u,4),Lt(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u)}),r}function Mt(n){var t=-1,r=n?n.length:0,e=cr(typeof r=="number"?r:0);return $t(n,function(n){var r=vt(0,++t);e[t]=e[r],e[r]=n}),e}function Ut(n,t,r){var u;if(t=e.createCallback(t,r,3),fe(n)){r=-1;for(var o=n.length;++r=y;m?(u&&(u=Ar(u)),c=a,o=n.apply(i,e)):u||(u=qr(v,y))}return m&&l?l=Ar(l):l||t===p||(l=qr(g,t)),r&&(m=true,o=n.apply(i,e)),!m||l||u||(e=i=null),o}}function Gt(n,t,r){var e=arguments,u=0,o=ct[typeof r]&&e[3]&&e[3][r]===t?2:e.length;if(3--n?t.apply(this,arguments):void 0}},e.assign=Gt,e.at=function(n,t){var r=arguments,e=-1,u=ft(r,true,false,1),r=ct[typeof t]&&r[2]&&r[2][t]===n?1:u.length,o=cr(r);for(te.unindexedChars&&er(n)&&(n=n.split(""));++e=A&&f(e?n[e]:l)))}var i=n[0],p=-1,h=i?i.length:0,g=[];n:for(;++p(m?r(m,c):a(l,c))){for(e=u,(m||l).push(c);--e;)if(m=o[e],0>(m?r(m,c):a(n[e],c)))continue n;g.push(c) -}}for(;u--;)(m=o[u])&&y(m);return v(o),v(l),g},e.invert=function(n,t){for(var r=-1,e=pe(n),u=e.length,o={};++rr?Vr(0,e+r):Xr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=ir,e.noConflict=function(){return n._=kr,this},e.noop=lr,e.now=ve,e.parseInt=ye,e.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Hr(),Xr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):vt(n,t) -},e.reduce=zt,e.reduceRight=Kt,e.result=function(n,t){if(n){var r=n[t];return nr(r)?n[t]():r}},e.runInContext=x,e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:pe(n).length},e.some=Ut,e.sortedIndex=At,e.template=function(n,t,r){var u=e.templateSettings;n=dr(n||""),r=Ht({},r,u);var o,a=Ht({},r.imports,u.imports),u=pe(a),a=ur(a),i=0,l=r.interpolate||M,f="__p+='",l=mr((r.escape||M).source+"|"+l.source+"|"+(l===L?B:M).source+"|"+(r.evaluate||M).source+"|$","g");n.replace(l,function(t,r,e,u,a,l){return e||(e=u),f+=n.slice(i,l).replace(V,p),r&&(f+="'+__e("+r+")+'"),a&&(o=true,f+="';"+a+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),i=l+t.length,t -}),f+="';",l=r=r.variable,l||(r="obj",f="with("+r+"){"+f+"}"),f=(o?f.replace(R,""):f).replace(T,"$1").replace(P,"$1;"),f="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=hr(u,"return "+f).apply(C,a)}catch(s){throw s.source=f,s}return t?c(t):(c.source=f,c)},e.trim=se,e.trimLeft=he,e.trimRight=ge,e.unescape=function(n){return null==n?"":(n=dr(n),0>n.indexOf(";")?n:n.replace(D,j)) -},e.uniqueId=function(n){var t=++E;return dr(null==n?"":n)+t},e.all=Dt,e.any=Ut,e.detect=Ft,e.findWhere=Ft,e.foldl=zt,e.foldr=Kt,e.include=Pt,e.inject=zt,ir(function(){var n={};return Jt(e,function(t,r){e.prototype[r]||(n[r]=t)}),n}(),false),e.first=kt,e.last=function(n,t,r){var u=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=o;for(t=e.createCallback(t,r,3);a--&&t(n[a],a,n);)u++}else if(u=t,null==u||r)return n?n[o-1]:C;return u=o-u,St(n,0"']/g,F=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,L=/<%=([\s\S]+?)%>/g,B=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,W=/\w*$/,z=/^\s*function[ \n\r\t]+\w/,K=/^0[xX]/,M=/($^)/,U=/\bthis\b/,V=/['\n\r\t\u2028\u2029\\]/g,X="Array Boolean Date Error Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),G="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),H="[object Arguments]",J="[object Array]",Q="[object Boolean]",Y="[object Date]",Z="[object Error]",nt="[object Function]",tt="[object Number]",rt="[object Object]",et="[object RegExp]",ut="[object String]",ot={}; -ot[nt]=false,ot[H]=ot[J]=ot[Q]=ot[Y]=ot[tt]=ot[rt]=ot[et]=ot[ut]=true;var at={leading:false,maxWait:0,trailing:false},it={configurable:false,enumerable:false,value:null,writable:false},lt={"&":"&","<":"<",">":">",'"':""","'":"'"},ft={"&":"&","<":"<",">":">",""":'"',"'":"'"},ct={"boolean":false,"function":false,object:false,number:true,string:true,undefined:false},pt={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},st={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},ht=pt[typeof window]&&window||this,gt=pt[typeof exports]&&exports&&!exports.nodeType&&exports,vt=pt[typeof global]&&global; -!vt||vt.global!==vt&&vt.window!==vt||(ht=vt);var yt=(vt=pt[typeof module]&&module&&!module.nodeType&&module)&&vt.exports===gt&>,mt=x();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(ht._=mt, define(function(){return mt})):gt&&vt?yt?(vt.exports=mt)._=mt:gt._=mt:ht._=mt}).call(this); \ No newline at end of file +;(function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202=S&&o===t,l=[];if(i){var c=f(e);c?(o=r,e=c):i=false}for(;++uo(e,c)&&l.push(c);return i&&y(e),l}function it(n,t,r){var e=-1,u=n,o=n?n.length:0;if(t=t&&typeof r=="undefined"?t:k(t,r,3),typeof o=="number")for(ne.unindexedChars&&rr(u)&&(u=u.split(""));++e=S&&a===t,p=u||c?s():l;for(c&&(p=f(p),a=r);++oa(p,g))&&((u||c)&&p.push(g),l.push(h))}return c?(v(p.g),y(p)):u&&v(p),l}function mt(n){return function(t,r,u){var o={}; +if(r=e.createCallback(r,u,3),le(t)){u=-1;for(var a=t.length;++uu;u++)e+="l='"+n.d[u]+"';if((!(k&&n[l])&&h.call(p,l))",n.f||(e+="||(!n[l]&&p[l]!==q[l])"),e+="){"+n.c+"}"; +e+="}"}return t("a,f,g,h,j,q,r,o,v,w,y",r+(e+"return s;")+"}")(k,Y,_r,Rr,xt,wr,ct,Zr,et,jr,kr)}function _t(){var n=(n=e.indexOf)===kt?t:n;return n}function wt(n){return typeof n=="function"&&Or.test(Ir.call(n))}function jt(n){var t,r;return!n||kr.call(n)!=tt||!Rr.call(n,"constructor")&&(t=n.constructor,Zt(t)&&!(t instanceof t))||!ne.argsClass&&xt(n)||!ne.nodeClass&&g(n)?false:ne.ownLast?(ie(n,function(n,t,e){return r=Rr.call(e,t),false}),false!==r):(ie(n,function(n,t){r=t}),typeof r=="undefined"||Rr.call(n,r)) +}function xt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&kr.call(n)==G||false}function Ct(n,t,r){var u=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=-1;for(t=e.createCallback(t,r,3);++ae?Ur(0,u+e):e||0}else if(e)return e=St(n,r),n[e]===r?e:-1;return t(n,r,e)}function Ot(n,t,r){if(typeof t!="number"&&null!=t){var u=0,o=-1,a=n?n.length:0; +for(t=e.createCallback(t,r,3);++ot?t=Ur(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Ur(u+r,0):r>u&&(r=u),u=r-t||0,r=fr(u);++e>>1,r(n[u])r?0:r);++t=e)return false;if(typeof n=="string"||!le(n)&&rr(n))return Lr?Lr.call(n,t,r):-1r?Ur(0,e+r):r)||0,-1a&&(a=l)}}else t=null==t&&rr(n)?u:e.createCallback(t,r,3),it(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,a=n)});return a}function Wt(n,t,r,u){var o=3>arguments.length;if(t=e.createCallback(t,u,4),le(n)){var a=-1,i=n.length; +for(o&&i&&(r=n[++a]);++aarguments.length;return t=e.createCallback(t,u,4),$t(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u)}),r}function Kt(n){var t=-1,r=n?n.length:0,e=fr(typeof r=="number"?r:0);return Ft(n,function(n){var r=gt(0,++t);e[t]=e[r],e[r]=n}),e}function Mt(n,t,r){var u;if(t=e.createCallback(t,r,3),le(n)){r=-1;for(var o=n.length;++r=y;m?(a&&(a=Sr(a)),s=l,i=n.apply(f,o)):a||(a=Dr(e,y))}return m&&c?c=Sr(c):c||t===h||(c=Dr(u,t)),r&&(m=true,i=n.apply(f,o)),!m||c||a||(o=f=null),i}}function Xt(n,t,r){var e=arguments,u=0,o=ft[typeof r]&&e[3]&&e[3][r]===t?2:e.length;if(3--n?t.apply(this,arguments):void 0}},e.assign=Xt,e.at=function(n,t){var r=arguments,e=-1,u=lt(r,true,false,1),r=ft[typeof t]&&r[2]&&r[2][t]===n?1:u.length,o=fr(r);for(ne.unindexedChars&&rr(n)&&(n=n.split(""));++e=S&&f(e?n[e]:l)))}var i=n[0],p=-1,h=i?i.length:0,g=[];n:for(;++p(m?r(m,c):a(l,c))){for(e=u,(m||l).push(c);--e;)if(m=o[e],0>(m?r(m,c):a(n[e],c)))continue n;g.push(c) +}}for(;u--;)(m=o[u])&&y(m);return v(o),v(l),g},e.invert=function(n,t){for(var r=-1,e=ce(n),u=e.length,o={};++rr?Ur(0,e+r):Vr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=ar,e.noConflict=function(){return n._=Cr,this},e.noop=ir,e.now=ge,e.parseInt=ve,e.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Gr(),Vr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):gt(n,t) +},e.reduce=Wt,e.reduceRight=zt,e.result=function(n,t){if(n){var r=n[t];return Zt(r)?n[t]():r}},e.runInContext=x,e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ce(n).length},e.some=Mt,e.sortedIndex=St,e.template=function(n,t,r){var u=e.templateSettings;n=mr(n||""),r=Gt({},r,u);var o,a=Gt({},r.imports,u.imports),u=ce(a),a=er(a),i=0,l=r.interpolate||K,f="__p+='",l=yr((r.escape||K).source+"|"+l.source+"|"+(l===$?L:K).source+"|"+(r.evaluate||K).source+"|$","g");n.replace(l,function(t,r,e,u,a,l){return e||(e=u),f+=n.slice(i,l).replace(U,p),r&&(f+="'+__e("+r+")+'"),a&&(o=true,f+="';"+a+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),i=l+t.length,t +}),f+="';",l=r=r.variable,l||(r="obj",f="with("+r+"){"+f+"}"),f=(o?f.replace(N,""):f).replace(R,"$1").replace(T,"$1;"),f="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=sr(u,"return "+f).apply(C,a)}catch(s){throw s.source=f,s}return t?c(t):(c.source=f,c)},e.trim=pe,e.trimLeft=se,e.trimRight=he,e.unescape=function(n){return null==n?"":(n=mr(n),0>n.indexOf(";")?n:n.replace(P,j)) +},e.uniqueId=function(n){var t=++E;return mr(null==n?"":n)+t},e.all=Pt,e.any=Mt,e.detect=qt,e.findWhere=qt,e.foldl=Wt,e.foldr=zt,e.include=Tt,e.inject=Wt,ar(function(){var n={};return Ht(e,function(t,r){e.prototype[r]||(n[r]=t)}),n}(),false),e.first=Ct,e.last=function(n,t,r){var u=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=o;for(t=e.createCallback(t,r,3);a--&&t(n[a],a,n);)u++}else if(u=t,null==u||r)return n?n[o-1]:C;return u=o-u,Et(n,0"']/g,q=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,L=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,B=/\w*$/,W=/^\s*function[ \n\r\t]+\w/,z=/^0[xX]/,K=/($^)/,M=/\bthis\b/,U=/['\n\r\t\u2028\u2029\\]/g,V="Array Boolean Date Error Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),X="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),G="[object Arguments]",H="[object Array]",J="[object Boolean]",Q="[object Date]",Y="[object Error]",Z="[object Function]",nt="[object Number]",tt="[object Object]",rt="[object RegExp]",et="[object String]",ut={}; +ut[Z]=false,ut[G]=ut[H]=ut[J]=ut[Q]=ut[nt]=ut[tt]=ut[rt]=ut[et]=true;var ot={leading:false,maxWait:0,trailing:false},at={configurable:false,enumerable:false,value:null,writable:false},it={"&":"&","<":"<",">":">",'"':""","'":"'"},lt={"&":"&","<":"<",">":">",""":'"',"'":"'"},ft={"boolean":false,"function":false,object:false,number:true,string:true,undefined:false},ct={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},pt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},st=ct[typeof window]&&window||this,ht=ct[typeof exports]&&exports&&!exports.nodeType&&exports,gt=ct[typeof global]&&global; +!gt||gt.global!==gt&>.window!==gt||(st=gt);var vt=(gt=ct[typeof module]&&module&&!module.nodeType&&module)&>.exports===ht&&ht,yt=x();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(st._=yt, define(function(){return yt})):ht&>?vt?(gt.exports=yt)._=yt:ht._=yt:st._=yt}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index e0216bcf3..de03fd870 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -19,9 +19,6 @@ /** Used to generate unique IDs */ var idCounter = 0; - /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */ - var keyPrefix = '__1335248838000__'; - /** Used as the size when optimizations are enabled for large arrays */ var largeArraySize = 75; @@ -220,8 +217,7 @@ } /** - * The base implementation of `_.indexOf` without support for binary searches - * or `fromIndex` constraints. + * The base implementation of `_.indexOf` without support for binary searches. * * @private * @param {Array} array The array to search. @@ -260,7 +256,7 @@ if (type != 'number' && type != 'string') { type = 'object'; } - var key = type == 'number' ? value : keyPrefix + value; + var key = type == 'number' ? value : '_' + value; cache = (cache = cache[type]) && cache[key]; return type == 'object' @@ -284,7 +280,7 @@ if (type != 'number' && type != 'string') { type = 'object'; } - var key = type == 'number' ? value : keyPrefix + value, + var key = type == 'number' ? value : '_' + value, typeCache = cache[type] || (cache[type] = {}); if (type == 'object') { @@ -317,7 +313,7 @@ * * @private * @param {string} string The string to inspect. - * @returns {number} Returns the index of the first non-whitespace character. + * @returns {number} Returns the index of the first character not found in `chars`. */ function charsLeftIndex(string, chars) { var index = -1, @@ -336,7 +332,7 @@ * * @private * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. + * @returns {number} Returns the index of the last character not found in `chars`. */ function charsRightIndex(string, chars) { var index = string.length; @@ -484,7 +480,7 @@ * Releases `array` back to the array pool. * * @private - * @param {Array} [array] The array to release. + * @param {Array} array The array to release. */ function releaseArray(array) { array.length = 0; @@ -497,7 +493,7 @@ * Releases `object` back to the object pool. * * @private - * @param {Object} [object] The object to release. + * @param {Object} object The object to release. */ function releaseObject(object) { var cache = object.cache; @@ -805,7 +801,7 @@ * * @private * @param {*} value The value to wrap in a `lodash` instance. - * @param {boolean} chainAll A flag to enable chaining for all methods + * @param {boolean} [chainAll=false] A flag to enable chaining for all methods * @returns {Object} Returns a `lodash` instance. */ function lodashWrapper(value, chainAll) { @@ -1053,7 +1049,7 @@ * @param {Object} prototype The object to inherit from. * @returns {Object} Returns the new object. */ - function baseCreate(prototype, properties) { + function baseCreate(prototype) { return isObject(prototype) ? nativeCreate(prototype) : {}; } // fallback for environments without `Object.create` @@ -3518,7 +3514,7 @@ * @param {Array|Object|string} collection The collection to iterate over. * @param {Function|string} methodName The name of the method to invoke or * the function invoked per iteration. - * @param {...*} [arg] Arguments to invoke the method with. + * @param {...*} [args] Arguments to invoke the method with. * @returns {Array} Returns a new array of the results of each invoked method. * @example * @@ -4221,7 +4217,7 @@ * @category Functions * @param {Function} func The function to bind. * @param {*} [thisArg] The `this` binding of `func`. - * @param {...*} [arg] Arguments to be partially applied. + * @param {...*} [args] Arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * @@ -4290,7 +4286,7 @@ * @category Functions * @param {Object} object The object the method belongs to. * @param {string} key The key of the method. - * @param {...*} [arg] Arguments to be partially applied. + * @param {...*} [args] Arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * @@ -4551,7 +4547,7 @@ * @memberOf _ * @category Functions * @param {Function} func The function to defer. - * @param {...*} [arg] Arguments to invoke the function with. + * @param {...*} [args] Arguments to invoke the function with. * @returns {number} Returns the timer id. * @example * @@ -4575,7 +4571,7 @@ * @category Functions * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay execution. - * @param {...*} [arg] Arguments to invoke the function with. + * @param {...*} [args] Arguments to invoke the function with. * @returns {number} Returns the timer id. * @example * @@ -4633,7 +4629,7 @@ } var memoized = function() { var cache = memoized.cache, - key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0]; + key = resolver ? resolver.apply(this, arguments) : '_' + arguments[0]; return hasOwnProperty.call(cache, key) ? cache[key] @@ -4692,7 +4688,7 @@ * @memberOf _ * @category Functions * @param {Function} func The function to partially apply arguments to. - * @param {...*} [arg] Arguments to be partially applied. + * @param {...*} [args] Arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * @@ -4716,7 +4712,7 @@ * @memberOf _ * @category Functions * @param {Function} func The function to partially apply arguments to. - * @param {...*} [arg] Arguments to be partially applied. + * @param {...*} [args] Arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 187e517ee..87fba26db 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -3,57 +3,57 @@ * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE * Build: `lodash modern -o ./dist/lodash.js` */ -;(function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202=E&&o===t,f=[];if(a){var c=l(e);c?(o=r,e=c):a=false}for(;++uo(e,c)&&f.push(c);return a&&g(e),f}function lt(n,t,r,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e=E&&i===t,p=u||c?s():f;for(c&&(p=l(p),i=r);++oi(p,y))&&((u||c)&&p.push(y),f.push(h))}return c?(v(p.g),g(p)):u&&v(p),f}function yt(n){return function(t,r,e){var u={};r=i.createCallback(r,e,3),e=-1;var o=t?t.length:0;if(typeof o=="number")for(;++ee?Lr(0,u+e):e||0}else if(e)return e=Ot(n,r),n[e]===r?e:-1;return t(n,r,e)}function xt(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=i.createCallback(t,r,3);++ut?t=Lr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Lr(u+r,0):r>u&&(r=u),u=r-t||0,r=ar(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!re(n)&&nr(n))return Fr?Fr.call(n,t,r):-1r?Lr(0,e+r):r)||0,-1o&&(o=f)}}else t=null==t&&nr(n)?u:i.createCallback(t,r,3),Ft(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function Wt(n,t,r,e){var u=3>arguments.length;t=i.createCallback(t,e,4);var o=-1,a=n?n.length:0;if(typeof a=="number")for(u&&a&&(r=n[++o]);++oarguments.length;return t=i.createCallback(t,e,4),$t(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o) -}),r}function Lt(n){var t=-1,r=n?n.length:0,e=ar(typeof r=="number"?r:0);return Ft(n,function(n){var r=ht(0,++t);e[t]=e[r],e[r]=n}),e}function Pt(n,t,r){var e;t=i.createCallback(t,r,3),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r=y;m?(i&&(i=Cr(i)),s=f,a=n.apply(l,o)):i||(i=Ir(e,y))}return m&&c?c=Cr(c):c||t===h||(c=Ir(u,t)),r&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a -}}function Ut(n,t,r){var e=arguments,u=0,o=at[typeof r]&&e[3]&&e[3][r]===t?2:e.length;if(3--n?t.apply(this,arguments):void 0}},i.assign=Ut,i.at=function(n,t){for(var r=arguments,e=-1,u=lt(r,true,false,1),r=at[typeof t]&&r[2]&&r[2][t]===n?1:u.length,o=ar(r);++e=E&&l(e?n[e]:f)))}var a=n[0],p=-1,h=a?a.length:0,y=[];n:for(;++p(m?r(m,c):i(f,c))){for(e=u,(m||f).push(c);--e;)if(m=o[e],0>(m?r(m,c):i(n[e],c)))continue n;y.push(c)}}for(;u--;)(m=o[u])&&g(m);return v(o),v(f),y},i.invert=function(n,t){for(var r=-1,e=ue(n),u=e.length,o={};++rr?Lr(0,e+r):Pr(r,e-1))+1);e--;)if(n[e]===t)return e; -return-1},i.mixin=ur,i.noConflict=function(){return n._=wr,this},i.noop=or,i.now=fe,i.parseInt=le,i.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Mr(),Pr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):ht(n,t)},i.reduce=Wt,i.reduceRight=zt,i.result=function(n,t){if(n){var r=n[t];return Qt(r)?n[t]():r}},i.runInContext=j,i.size=function(n){var t=n?n.length:0; -return typeof t=="number"?t:ue(n).length},i.some=Pt,i.sortedIndex=Ot,i.template=function(n,t,r){var e=i.templateSettings;n=gr(n||""),r=Vt({},r,e);var u,o=Vt({},r.imports,e.imports),e=ue(o),o=tr(o),a=0,f=r.interpolate||K,l="__p+='",f=vr((r.escape||K).source+"|"+f.source+"|"+(f===q?W:K).source+"|"+(r.evaluate||K).source+"|$","g");n.replace(f,function(t,r,e,o,i,f){return e||(e=o),l+=n.slice(a,f).replace(U,p),r&&(l+="'+__e("+r+")+'"),i&&(u=true,l+="';"+i+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t -}),l+="';",f=r=r.variable,f||(r="obj",l="with("+r+"){"+l+"}"),l=(u?l.replace(I,""):l).replace(S,"$1").replace(T,"$1;"),l="function("+r+"){"+(f?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=cr(e,"return "+l).apply(k,o)}catch(s){throw s.source=l,s}return t?c(t):(c.source=l,c)},i.trim=oe,i.trimLeft=ie,i.trimRight=ae,i.unescape=function(n){return null==n?"":(n=gr(n),0>n.indexOf(";")?n:n.replace(D,w)) -},i.uniqueId=function(n){var t=++O;return gr(null==n?"":n)+t},i.all=St,i.any=Pt,i.detect=Dt,i.findWhere=Dt,i.foldl=Wt,i.foldr=zt,i.include=It,i.inject=Wt,ur(function(){var n={};return Xt(i,function(t,r){i.prototype[r]||(n[r]=t)}),n}(),false),i.first=jt,i.last=function(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=i.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n?n[u-1]:k;return e=u-e,Ct(n,0"']/g,$=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,W=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,z=/\w*$/,L=/^\s*function[ \n\r\t]+\w/,P=/^0[xX]/,K=/($^)/,M=/\bthis\b/,U=/['\n\r\t\u2028\u2029\\]/g,V="Array Boolean Date Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),X="[object Arguments]",G="[object Array]",H="[object Boolean]",J="[object Date]",Q="[object Function]",Y="[object Number]",Z="[object Object]",nt="[object RegExp]",tt="[object String]",rt={}; -rt[Q]=false,rt[X]=rt[G]=rt[H]=rt[J]=rt[Y]=rt[Z]=rt[nt]=rt[tt]=true;var et={leading:false,maxWait:0,trailing:false},ut={configurable:false,enumerable:false,value:null,writable:false},ot={"&":"&","<":"<",">":">",'"':""","'":"'"},it={"&":"&","<":"<",">":">",""":'"',"'":"'"},at={"boolean":false,"function":false,object:false,number:true,string:true,undefined:false},ft={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},lt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},ct=ft[typeof window]&&window||this,pt=ft[typeof exports]&&exports&&!exports.nodeType&&exports,st=ft[typeof global]&&global; -!st||st.global!==st&&st.window!==st||(ct=st);var ht=(st=ft[typeof module]&&module&&!module.nodeType&&module)&&st.exports===pt&&pt,vt=j();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(ct._=vt, define(function(){return vt})):pt&&st?ht?(st.exports=vt)._=vt:pt._=vt:ct._=vt}).call(this); \ No newline at end of file +;(function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202=A&&o===t,f=[];if(a){var c=l(e);c?(o=r,e=c):a=false}for(;++uo(e,c)&&f.push(c);return a&&v(e),f}function ft(n,t,r,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e=A&&i===t,p=u||c?s():f;for(c&&(p=l(p),i=r);++oi(p,y))&&((u||c)&&p.push(y),f.push(h))}return c?(g(p.g),v(p)):u&&g(p),f}function vt(n){return function(t,r,e){var u={};r=i.createCallback(r,e,3),e=-1;var o=t?t.length:0;if(typeof o=="number")for(;++ee?zr(0,u+e):e||0}else if(e)return e=Ct(n,r),n[e]===r?e:-1;return t(n,r,e)}function kt(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=i.createCallback(t,r,3);++ut?t=zr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=zr(u+r,0):r>u&&(r=u),u=r-t||0,r=ir(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!te(n)&&Zt(n))return Dr?Dr.call(n,t,r):-1r?zr(0,e+r):r)||0,-1o&&(o=f)}}else t=null==t&&Zt(n)?u:i.createCallback(t,r,3),Dt(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function qt(n,t,r,e){var u=3>arguments.length;t=i.createCallback(t,e,4);var o=-1,a=n?n.length:0;if(typeof a=="number")for(u&&a&&(r=n[++o]);++oarguments.length;return t=i.createCallback(t,e,4),Ft(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o) +}),r}function zt(n){var t=-1,r=n?n.length:0,e=ir(typeof r=="number"?r:0);return Dt(n,function(n){var r=st(0,++t);e[t]=e[r],e[r]=n}),e}function Lt(n,t,r){var e;t=i.createCallback(t,r,3),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r=y;m?(i&&(i=xr(i)),s=f,a=n.apply(l,o)):i||(i=Rr(e,y))}return m&&c?c=xr(c):c||t===h||(c=Rr(u,t)),r&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a +}}function Mt(n,t,r){var e=arguments,u=0,o=it[typeof r]&&e[3]&&e[3][r]===t?2:e.length;if(3--n?t.apply(this,arguments):void 0}},i.assign=Mt,i.at=function(n,t){for(var r=arguments,e=-1,u=ft(r,true,false,1),r=it[typeof t]&&r[2]&&r[2][t]===n?1:u.length,o=ir(r);++e=A&&l(e?n[e]:f)))}var a=n[0],p=-1,h=a?a.length:0,y=[];n:for(;++p(m?r(m,c):i(f,c))){for(e=u,(m||f).push(c);--e;)if(m=o[e],0>(m?r(m,c):i(n[e],c)))continue n;y.push(c)}}for(;u--;)(m=o[u])&&v(m);return g(o),g(f),y},i.invert=function(n,t){for(var r=-1,e=ee(n),u=e.length,o={};++rr?zr(0,e+r):Lr(r,e-1))+1);e--;)if(n[e]===t)return e; +return-1},i.mixin=er,i.noConflict=function(){return n._=_r,this},i.noop=ur,i.now=ae,i.parseInt=fe,i.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Kr(),Lr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):st(n,t)},i.reduce=qt,i.reduceRight=Wt,i.result=function(n,t){if(n){var r=n[t];return Jt(r)?n[t]():r}},i.runInContext=j,i.size=function(n){var t=n?n.length:0; +return typeof t=="number"?t:ee(n).length},i.some=Lt,i.sortedIndex=Ct,i.template=function(n,t,r){var e=i.templateSettings;n=gr(n||""),r=Ut({},r,e);var u,o=Ut({},r.imports,e.imports),e=ee(o),o=nr(o),a=0,f=r.interpolate||P,l="__p+='",f=hr((r.escape||P).source+"|"+f.source+"|"+(f===B?q:P).source+"|"+(r.evaluate||P).source+"|$","g");n.replace(f,function(t,r,e,o,i,f){return e||(e=o),l+=n.slice(a,f).replace(M,p),r&&(l+="'+__e("+r+")+'"),i&&(u=true,l+="';"+i+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t +}),l+="';",f=r=r.variable,f||(r="obj",l="with("+r+"){"+l+"}"),l=(u?l.replace(R,""):l).replace(I,"$1").replace(S,"$1;"),l="function("+r+"){"+(f?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=lr(e,"return "+l).apply(k,o)}catch(s){throw s.source=l,s}return t?c(t):(c.source=l,c)},i.trim=ue,i.trimLeft=oe,i.trimRight=ie,i.unescape=function(n){return null==n?"":(n=gr(n),0>n.indexOf(";")?n:n.replace(T,w)) +},i.uniqueId=function(n){var t=++O;return gr(null==n?"":n)+t},i.all=It,i.any=Lt,i.detect=Tt,i.findWhere=Tt,i.foldl=qt,i.foldr=Wt,i.include=Rt,i.inject=qt,er(function(){var n={};return Vt(i,function(t,r){i.prototype[r]||(n[r]=t)}),n}(),false),i.first=wt,i.last=function(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=i.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n?n[u-1]:k;return e=u-e,xt(n,0"']/g,F=/<%-([\s\S]+?)%>/g,$=/<%([\s\S]+?)%>/g,B=/<%=([\s\S]+?)%>/g,q=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,W=/\w*$/,z=/^\s*function[ \n\r\t]+\w/,L=/^0[xX]/,P=/($^)/,K=/\bthis\b/,M=/['\n\r\t\u2028\u2029\\]/g,U="Array Boolean Date Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),V="[object Arguments]",X="[object Array]",G="[object Boolean]",H="[object Date]",J="[object Function]",Q="[object Number]",Y="[object Object]",Z="[object RegExp]",nt="[object String]",tt={}; +tt[J]=false,tt[V]=tt[X]=tt[G]=tt[H]=tt[Q]=tt[Y]=tt[Z]=tt[nt]=true;var rt={leading:false,maxWait:0,trailing:false},et={configurable:false,enumerable:false,value:null,writable:false},ut={"&":"&","<":"<",">":">",'"':""","'":"'"},ot={"&":"&","<":"<",">":">",""":'"',"'":"'"},it={"boolean":false,"function":false,object:false,number:true,string:true,undefined:false},at={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},ft={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},lt=at[typeof window]&&window||this,ct=at[typeof exports]&&exports&&!exports.nodeType&&exports,pt=at[typeof global]&&global; +!pt||pt.global!==pt&&pt.window!==pt||(lt=pt);var st=(pt=at[typeof module]&&module&&!module.nodeType&&module)&&pt.exports===ct&&ct,ht=j();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(lt._=ht, define(function(){return ht})):ct&&pt?st?(pt.exports=ht)._=ht:ct._=ht:lt._=ht}).call(this); \ No newline at end of file diff --git a/lodash.js b/lodash.js index c0e368f5b..bd1979bbc 100644 --- a/lodash.js +++ b/lodash.js @@ -18,12 +18,6 @@ /** Used to generate unique IDs */ var idCounter = 0; - /** Used internally to indicate various things */ - var indicatorObject = {}; - - /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */ - var keyPrefix = '__1335248838000__'; - /** Used as the size when optimizations are enabled for large arrays */ var largeArraySize = 75; @@ -268,7 +262,7 @@ if (type != 'number' && type != 'string') { type = 'object'; } - var key = type == 'number' ? value : keyPrefix + value; + var key = type == 'number' ? value : '_' + value; cache = (cache = cache[type]) && cache[key]; return type == 'object' @@ -292,7 +286,7 @@ if (type != 'number' && type != 'string') { type = 'object'; } - var key = type == 'number' ? value : keyPrefix + value, + var key = type == 'number' ? value : '_' + value, typeCache = cache[type] || (cache[type] = {}); if (type == 'object') { @@ -4965,7 +4959,7 @@ } var memoized = function() { var cache = memoized.cache, - key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0]; + key = resolver ? resolver.apply(this, arguments) : '_' + arguments[0]; return hasOwnProperty.call(cache, key) ? cache[key]