mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Tweak _.uniqueId to avoid problems with buggy minifiers.
Former-commit-id: e940c336b227ce89661cd6ada5f3e722a0204318
This commit is contained in:
2
lodash.min.js
vendored
2
lodash.min.js
vendored
@@ -33,6 +33,6 @@ u(i)||o.push(i)}return o},r.wrap=function(n,t){return function(){var r=[n];retur
|
||||
},r.isNull=function(n){return n===W},r.isNumber=O,r.isObject=x,r.isPlainObject=dr,r.isRegExp=function(n){return n instanceof RegExp||$t.call(n)==Ut},r.isString=A,r.isUndefined=function(n){return n===void 0},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?It(0,e+r):Tt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=H,r.noConflict=function(){return n._=at,this},r.random=function(n,t){return n==W&&t==W&&(t=1),n=+n||0,t==W&&(t=n,n=0),n+Ot(Bt()*((+t||0)-n+1))},r.reduce=T,r.reduceRight=B,r.result=function(n,t){var r=n?n[t]:W;
|
||||
return j(r)?n[t]():r},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:gr(n).length},r.some=M,r.sortedIndex=L,r.template=function(n,t,e){n||(n=""),e||(e={});var u,o,i=r.templateSettings,a=0,f=e.interpolate||i.interpolate||_t,l="__p+='",p=e.variable||i.variable,s=p;n.replace(RegExp((e.escape||i.escape||_t).source+"|"+f.source+"|"+(f===mt?yt:_t).source+"|"+(e.evaluate||i.evaluate||_t).source+"|$","g"),function(t,r,e,o,i,f){return e||(e=o),l+=n.slice(a,f).replace(bt,c),r&&(l+="'+__e("+r+")+'"),i&&(l+="';"+i+";__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),u||(u=i||ft.test(r||e)),a=f+t.length,t
|
||||
}),l+="';\n",s||(p="obj",u?l="with("+p+"){"+l+"}":(e=RegExp("(\\(\\s*)"+p+"\\."+p+"\\b","g"),l=l.replace(gt,"$&"+p+".").replace(e,"$1__d"))),l=(u?l.replace(lt,""):l).replace(pt,"$1").replace(st,"$1;"),l="function("+p+"){"+(s?"":p+"||("+p+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(s?"":",__d="+p+"."+p+"||"+p)+";")+l+"return __p}";try{o=Function("_","return "+l)(r)}catch(v){throw v.source=l,v}return t?o(t):(o.source=l,o)},r.unescape=function(n){return n==W?"":(n+"").replace(ct,g)
|
||||
},r.uniqueId=function(n){return(n==W?"":n+"")+ ++ut},r.all=$,r.any=M,r.detect=N,r.foldl=T,r.foldr=B,r.include=k,r.inject=T,vr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return St.apply(t,arguments),n.apply(r,t)})}),r.first=P,r.last=function(n,t,r){if(n){var e=n.length;return t==W||r?n[e-1]:v(n,It(0,e-t))}},r.take=P,r.head=P,vr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return t==W||e?u:new r(u)})}),r.VERSION="1.0.0-rc.3",r.prototype.toString=function(){return this.__wrapped__+""
|
||||
},r.uniqueId=function(n){var t=++ut;return(n==W?"":n+"")+t},r.all=$,r.any=M,r.detect=N,r.foldl=T,r.foldr=B,r.include=k,r.inject=T,vr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return St.apply(t,arguments),n.apply(r,t)})}),r.first=P,r.last=function(n,t,r){if(n){var e=n.length;return t==W||r?n[e-1]:v(n,It(0,e-t))}},r.take=P,r.head=P,vr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return t==W||e?u:new r(u)})}),r.VERSION="1.0.0-rc.3",r.prototype.toString=function(){return this.__wrapped__+""
|
||||
},r.prototype.value=J,r.prototype.valueOf=J,lr(["join","pop","shift"],function(n){var t=rt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),lr(["push","reverse","sort","unshift"],function(n){var t=rt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),lr(["concat","slice","splice"],function(n){var t=rt[n];r.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return new r(n)}}),Wt&&lr(["pop","shift","splice"],function(n){var t=rt[n],e="splice"==n;
|
||||
r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r})):Y?typeof module=="object"&&module&&module.exports==Y?(module.exports=r)._=r:Y._=r:n._=r})(this);
|
||||
Reference in New Issue
Block a user