mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Cleanup _.sample and add missing dependency.
Former-commit-id: 428bbdb266bd1d66119007ed6121c3f810bd2cd1
This commit is contained in:
2
dist/lodash.compat.min.js
vendored
2
dist/lodash.compat.min.js
vendored
@@ -48,7 +48,7 @@ return a},_.tap=function(n,t){return t(n),n},_.throttle=function(n,t,e){var r=m,
|
||||
},_.isString=_t,_.isUndefined=function(n){return typeof n=="undefined"},_.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Be(0,r+e):Pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},_.mixin=Ht,_.noConflict=function(){return r._=ce,this},_.parseInt=ir,_.random=Ut,_.reduce=It,_.reduceRight=Bt,_.result=function(n,t){var e=n?n[t]:y;return mt(e)?n[t]():e},_.runInContext=v,_.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:We(n).length},_.some=Nt,_.sortedIndex=Lt,_.template=function(n,t,e){var r=_.templateSettings;
|
||||
n||(n=""),e=Ze({},e,r);var u,o=Ze({},e.imports,r.imports),r=We(o),o=wt(o),a=0,f=e.interpolate||D,l="__p+='",f=re((e.escape||D).source+"|"+f.source+"|"+(f===R?P:D).source+"|"+(e.evaluate||D).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace($,i),e&&(l+="'+__e("+e+")+'"),f&&(u=m,l+="';"+f+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t}),l+="';\n",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(A,""):l).replace(I,"$1").replace(B,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";
|
||||
try{var c=Zt(r,"return "+l).apply(y,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},_.unescape=function(n){return n==d?"":ue(n).replace(Ve,st)},_.uniqueId=function(n){var t=++j;return ue(n==d?"":n)+t},_.all=kt,_.any=Nt,_.detect=Ct,_.findWhere=Ct,_.foldl=It,_.foldr=Bt,_.include=jt,_.inject=It,tr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return de.apply(t,arguments),t=n.apply(_,t),e?new w(t,e):t})}),_.first=Dt,_.last=function(n,t,e){if(n){var r=0,u=n.length;
|
||||
if(typeof t!="number"&&t!=d){var o=u;for(t=_.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,r==d||e)return n[u-1];return h(n,Be(0,u-r))}},_.sample=function(n,t,e){qe(n)||(n=Rt(n));var r=n.length-1;return t==d||e?n[Ut(r)]:(n=Pt(n),n.length=Pe(Be(0,t),n.length),n)},_.take=Dt,_.head=Dt,tr(_,function(n,t){var e="sample"!==t;_.prototype[t]||(_.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||t!=d&&(!r||e&&typeof t=="function")?new w(o,u):o})}),_.VERSION="1.3.1",_.prototype.chain=function(){return this.__chain__=m,this
|
||||
if(typeof t!="number"&&t!=d){var o=u;for(t=_.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,r==d||e)return n[u-1];return h(n,Be(0,u-r))}},_.sample=function(n,t,e){return qe(n)||(n=Rt(n)),t==d||e?n[Ut(n.length-1)]:(n=Pt(n),n.length=Pe(Be(0,t),n.length),n)},_.take=Dt,_.head=Dt,tr(_,function(n,t){var e="sample"!==t;_.prototype[t]||(_.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||t!=d&&(!r||e&&typeof t=="function")?new w(o,u):o})}),_.VERSION="1.3.1",_.prototype.chain=function(){return this.__chain__=m,this
|
||||
},_.prototype.toString=function(){return ue(this.__wrapped__)},_.prototype.value=Vt,_.prototype.valueOf=Vt,Xe(["join","pop","shift"],function(n){var t=ae[n];_.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new w(e,n):e}}),Xe(["push","reverse","sort","unshift"],function(n){var t=ae[n];_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xe(["concat","slice","splice"],function(n){var t=ae[n];_.prototype[n]=function(){return new w(t.apply(this.__wrapped__,arguments),this.__chain__)
|
||||
}}),Te.spliceObjects||Xe(["pop","shift","splice"],function(n){var t=ae[n],e="splice"==n;_.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new w(u,n):u}}),_}var y,m=!0,d=null,b=!1,_=[],w=[],j=0,x={},C=+new Date+"",E=75,O=40,S=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",A=/\b__p\+='';/g,I=/\b(__p\+=)''\+/g,B=/(__e\(.*?\)|\b__t\))\+'';/g,P=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,N=/\w*$/,R=/<%=([\s\S]+?)%>/g,F=RegExp("^["+S+"]*0+(?=.$)"),D=/($^)/,$=/['\n\r\t\u2028\u2029\\]/g,z="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),T="[object Arguments]",q="[object Array]",K="[object Boolean]",W="[object Date]",G="[object Error]",J="[object Function]",M="[object Number]",H="[object Object]",U="[object RegExp]",V="[object String]",Q={};
|
||||
Q[J]=b,Q[T]=Q[q]=Q[K]=Q[W]=Q[M]=Q[H]=Q[U]=Q[V]=m;var X={"boolean":b,"function":m,object:m,number:b,string:b,undefined:b},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof exports]&&exports,nt=X[typeof module]&&module&&module.exports==Z&&module,tt=X[typeof global]&&global;!tt||tt.global!==tt&&tt.window!==tt||(n=tt);var et=v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=et, define(function(){return et})):Z&&!Z.nodeType?nt?(nt.exports=et)._=et:Z._=et:n._=et
|
||||
|
||||
Reference in New Issue
Block a user