diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 59d81152c..15d8c7b74 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -6846,6 +6846,7 @@ * * @static * @memberOf _ + * @alias callback * @category Utilities * @param {*} [func=identity] The value to convert to a callback. * @param {*} [thisArg] The `this` binding of the created callback. @@ -7367,6 +7368,7 @@ lodash.zipObject = zipObject; // add aliases + lodash.callback = createCallback; lodash.collect = map; lodash.drop = rest; lodash.each = forEach; diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 6f68e2146..df43516df 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -9,60 +9,59 @@ */ (function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202=S&&(o=r,e=le(e));++uo(e,l)&&i.push(l)}return i}function ht(n,t){var r=-1,e=n,u=n?n.length:0; -if(typeof u=="number")for(ie.unindexedChars&&ir(e)&&(e=e.split(""));++r=S,f=[];if(l)var p=le(),a=r;else p=u?c():f;for(;++oa(p,h))&&((u||l)&&p.push(h),f.push(g))}return!l&&u&&s(p),f}function xt(n){return function(t,r,e){var o={};if(r=u.createCallback(r,e,3),ye(t)){e=-1;for(var a=t.length;++er&&(r=0),e=[n,t,r,e,u,o],t==j||t==(j|O)?m(e):st(e))}function kt(n){n.d=Y;var t=mr,r="return function("+n.a+"){",e="var r="+n.b+";if(!j(p)){return r}"; -ie.nonEnumArgs&&(e+="var m=p.length;if(m&&i(p)){l=-1;while(++lu;u++)e+="l='"+n.d[u]+"';if((!(k&&n[l])&&g.call(p,l))",n.e||(e+="||(!n[l]&&p[l]!==q[l])"),e+="){"+n.c+"}"; -e+="}"}return t("e,f,g,i,j,q,o,u,v,w",r+(e+"return r;")+"}")(et,kr,$r,At,or,Or,ae,lt,Er,Ir)}function Ot(){var n=(n=u.indexOf)===Nt?t:n;return n}function Et(n){return typeof n=="function"&&Nr.test(qr.call(n))}function St(n){var t,r;return!n||Ir.call(n)!=at||!$r.call(n,"constructor")&&(t=n.constructor,ur(t)&&!(t instanceof t))||!ie.argsClass&&At(n)||!ie.nodeClass&&p(n)?false:ie.ownLast?(ce(n,function(n,t,e){return r=$r.call(e,t),false}),false!==r):(ce(n,function(n,t){r=t}),typeof r=="undefined"||$r.call(n,r)) -}function At(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ir.call(n)==Z||false}function It(n,t,r){var e=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=-1;for(t=u.createCallback(t,r,3);++ae?Qr(0,u+e):e||0;else if(e)return e=Pt(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function Rt(n,t,r){if(typeof t!="number"&&null!=t){var e=0,o=-1,a=n?n.length:0; -for(t=u.createCallback(t,r,3);++ot?t=Qr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Qr(u+r,0):r>u&&(r=u),u=r-t||0,r=hr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!ye(n)&&ir(n))return Ur?Ur.call(n,t,r):-1r?Qr(0,e+r):r)||0,-1a&&(a=l)}else t=null==t&&ir(n)?e:u.createCallback(t,r,3),ht(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,a=n)});return a}function Xt(n,t,r,e){var o=3>arguments.length; -if(t=u.createCallback(t,e,4),ye(n)){var a=-1,i=n.length;for(o&&i&&(r=n[++a]);++aarguments.length;return t=u.createCallback(t,e,4),Mt(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u)}),r}function Ht(n){var t=-1,r=n?n.length:0,e=hr(typeof r=="number"?r:0);return ht(n,function(n){var r=wt(0,++t);e[t]=e[r],e[r]=n}),e}function Jt(n,t,r){var e;if(t=u.createCallback(t,r,3),ye(n)){r=-1;for(var o=n.length;++rarguments.length)return Ct(n,j,null,t);var r=n&&(n[N]?n[N][2]:n.length),e=Tt(arguments,2),r=r-e.length;return Ct(n,j|O,r,t,e)}function Yt(n,t,r){var e,u,o,a,i,l,f,c=0,p=false,s=true;if(!ur(n))throw new xr;if(t=Qr(0,t)||0,true===r)var g=true,s=false;else or(r)&&(g=r.leading,p="maxWait"in r&&(Qr(t,r.maxWait)||0),s="trailing"in r?r.trailing:s);var h=function(){var r=t-(je()-a);0=y;m?(u&&(u=Tr(u)),c=a,o=n.apply(i,e)):u||(u=Wr(v,y))}return m&&l?l=Tr(l):l||t===p||(l=Wr(h,t)),r&&(m=true,o=n.apply(i,e)),!m||l||u||(e=i=null),o}}function Zt(n,t,r){var e=arguments,u=0,o=e.length,a=typeof r;if("number"!=a&&"string"!=a||!e[3]||e[3][r]!==t||(o=2),3--n?t.apply(this,arguments):void 0}},u.assign=Zt,u.at=function(n,t){var r=arguments,e=-1,u=vt(r,true,false,1),o=u.length,a=typeof t;for("number"!=a&&"string"!=a||!r[2]||r[2][t]!==n||(o=1),ie.unindexedChars&&ir(n)&&(n=n.split("")),r=hr(o);++earguments.length?Ct(t,j|x,null,n):Ct(t,j|x|O,null,n,Tt(arguments,2))},u.chain=function(n){return n=new o(n),n.__chain__=true,n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t=S&&le(e?n[e]:l)))}var i=n[0],p=-1,g=i?i.length:0,h=[];n:for(;++p(v?r(v,f):a(l,f))){for(e=u,(v||l).push(f);--e;)if(v=o[e],0>(v?r(v,f):a(n[e],f)))continue n;h.push(f)}}return s(o),s(l),h},u.invert=function(n,t){for(var r=-1,e=de(n),u=e.length,o={};++rr?Qr(0,e+r):Yr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=pr,u.noConflict=function(){return n._=Ar,this},u.noop=sr,u.now=je,u.parseInt=xe,u.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=te(),Yr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):wt(n,t) -},u.reduce=Xt,u.reduceRight=Gt,u.result=function(n,t,r){return null==n?r:(r="undefined"!=typeof n[t]?n[t]:r,ur(r)?n[t]():r)},u.runInContext=_,u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:de(n).length},u.some=Jt,u.sortedIndex=Pt,u.template=function(n,t,r){var e=u.templateSettings;n=jr(n||""),r=nr({},r,e);var o,a=nr({},r.imports,e.imports),e=de(a),a=lr(a),i=0,l=r.interpolate||U,c="__p+='",l=wr((r.escape||U).source+"|"+l.source+"|"+(l===D?W:U).source+"|"+(r.evaluate||U).source+"|$","g"); -n.replace(l,function(t,r,e,u,a,l){return e||(e=u),c+=n.slice(i,l).replace(X,f),r&&(c+="'+__e("+r+")+'"),a&&(o=true,c+="';"+a+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),i=l+t.length,t}),c+="';",l=r=r.variable,l||(r="obj",c="with("+r+"){"+c+"}"),c=(o?c.replace(T,""):c).replace(P,"$1").replace(q,"$1;"),c="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var p=mr(e,"return "+c).apply(w,a) -}catch(s){throw s.source=c,s}return t?p(t):(p.source=c,p)},u.trim=be,u.trimLeft=_e,u.trimRight=we,u.unescape=function(n){return null==n?"":(n=jr(n),0>n.indexOf(";")?n:n.replace(F,b))},u.uniqueId=function(n){var t=++R;return jr(null==n?"":n)+t},u.all=Dt,u.any=Jt,u.detect=zt,u.findWhere=zt,u.foldl=Xt,u.foldr=Gt,u.include=Bt,u.inject=Xt,pr(function(){var n={};return mt(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),false),u.first=It,u.last=function(n,t,r){var e=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=o; -for(t=u.createCallback(t,r,3);a--&&t(n[a],a,n);)e++}else if(e=t,null==e||r)return n?n[o-1]:w;return e=o-e,Tt(n,0"']/g,L=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,D=/<%=([\s\S]+?)%>/g,W=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,z=/\w*$/,K=/^\s*function[ \n\r\t]+\w/,M=/^0[xX]/,U=/($^)/,V=/\bthis\b/,X=/['\n\r\t\u2028\u2029\\]/g,G=" \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",H=[],J=[],Q="Array Boolean Date Error Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Y="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Z="[object Arguments]",nt="[object Array]",tt="[object Boolean]",rt="[object Date]",et="[object Error]",ut="[object Function]",ot="[object Number]",at="[object Object]",it="[object RegExp]",lt="[object String]",ft={}; +}function m(n){for(var t=-1,r=n.length;++te||13e||8202r||13r||8202=S&&(o=r,e=fe(e));++uo(e,l)&&i.push(l)}return i}function ht(n,t){var r=-1,e=n,u=n?n.length:0; +if(typeof u=="number")for(le.unindexedChars&&ir(e)&&(e=e.split(""));++r=S,f=[];if(l)var p=fe(),a=r;else p=u?c():f;for(;++oa(p,h))&&((u||l)&&p.push(h),f.push(g))}return!l&&u&&s(p),f}function xt(n){return function(t,r,e){var o={};if(r=u.createCallback(r,e,3),me(t)){e=-1;for(var a=t.length;++er&&(r=0),e=[n,t,r,e,u,o],t==j||t==(j|O)?m(e):st(e))}function kt(n){n.d=Y;var t=dr,r="return function("+n.a+"){",e="var r="+n.b+";if(!j(p)){return r}"; +le.nonEnumArgs&&(e+="var m=p.length;if(m&&i(p)){l=-1;while(++lu;u++)e+="l='"+n.d[u]+"';if((!(k&&n[l])&&g.call(p,l))",n.e||(e+="||(!n[l]&&p[l]!==q[l])"),e+="){"+n.c+"}"; +e+="}"}return t("e,f,g,i,j,q,o,u,v,w",r+(e+"return r;")+"}")(et,Or,Lr,At,or,Er,ie,lt,Sr,Nr)}function Ot(){var n=(n=u.indexOf)===Nt?t:n;return n}function Et(n){return typeof n=="function"&&Rr.test(Fr.call(n))}function St(n){var t,r;return!n||Nr.call(n)!=at||!Lr.call(n,"constructor")&&(t=n.constructor,ur(t)&&!(t instanceof t))||!le.argsClass&&At(n)||!le.nodeClass&&p(n)?false:le.ownLast?(pe(n,function(n,t,e){return r=Lr.call(e,t),false}),false!==r):(pe(n,function(n,t){r=t}),typeof r=="undefined"||Lr.call(n,r)) +}function At(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Nr.call(n)==Z||false}function It(n,t,r){var e=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=-1;for(t=u.createCallback(t,r,3);++ae?Yr(0,u+e):e||0;else if(e)return e=Pt(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function Rt(n,t,r){if(typeof t!="number"&&null!=t){var e=0,o=-1,a=n?n.length:0; +for(t=u.createCallback(t,r,3);++ot?t=Yr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Yr(u+r,0):r>u&&(r=u),u=r-t||0,r=vr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!me(n)&&ir(n))return Vr?Vr.call(n,t,r):-1r?Yr(0,e+r):r)||0,-1a&&(a=l)}else t=null==t&&ir(n)?e:u.createCallback(t,r,3),ht(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,a=n)});return a}function Xt(n,t,r,e){var o=3>arguments.length; +if(t=u.createCallback(t,e,4),me(n)){var a=-1,i=n.length;for(o&&i&&(r=n[++a]);++aarguments.length;return t=u.createCallback(t,e,4),Mt(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u)}),r}function Ht(n){var t=-1,r=n?n.length:0,e=vr(typeof r=="number"?r:0);return ht(n,function(n){var r=wt(0,++t);e[t]=e[r],e[r]=n}),e}function Jt(n,t,r){var e;if(t=u.createCallback(t,r,3),me(n)){r=-1;for(var o=n.length;++rarguments.length)return Ct(n,j,null,t);var r=n&&(n[N]?n[N][2]:n.length),e=Tt(arguments,2),r=r-e.length;return Ct(n,j|O,r,t,e)}function Yt(n,t,r){function e(){c&&Pr(c),a=c=p=w,(h||g!==t)&&(s=xe(),i=n.apply(f,o),c||a||(o=f=null))}function u(){var r=t-(xe()-l);0=y;m?(a&&(a=Pr(a)),s=l,i=n.apply(f,o)):a||(a=zr(e,y))}return m&&c?c=Pr(c):c||t===g||(c=zr(u,t)),r&&(m=true,i=n.apply(f,o)),!m||c||a||(o=f=null),i}}function Zt(n,t,r){var e=arguments,u=0,o=e.length,a=typeof r;if("number"!=a&&"string"!=a||!e[3]||e[3][r]!==t||(o=2),3--n?t.apply(this,arguments):void 0}},u.assign=Zt,u.at=function(n,t){var r=arguments,e=-1,u=vt(r,true,false,1),o=u.length,a=typeof t;for("number"!=a&&"string"!=a||!r[2]||r[2][t]!==n||(o=1),le.unindexedChars&&ir(n)&&(n=n.split("")),r=vr(o);++earguments.length?Ct(t,j|x,null,n):Ct(t,j|x|O,null,n,Tt(arguments,2))},u.chain=function(n){return n=new o(n),n.__chain__=true,n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t=S&&fe(e?n[e]:l)))}var i=n[0],p=-1,g=i?i.length:0,h=[];n:for(;++p(v?r(v,f):a(l,f))){for(e=u,(v||l).push(f);--e;)if(v=o[e],0>(v?r(v,f):a(n[e],f)))continue n;h.push(f) +}}return s(o),s(l),h},u.invert=function(n,t){for(var r=-1,e=be(n),u=e.length,o={};++rr?Yr(0,e+r):Zr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=sr,u.noConflict=function(){return n._=Ir,this},u.noop=gr,u.now=xe,u.parseInt=Ce,u.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=re(),Zr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):wt(n,t) +},u.reduce=Xt,u.reduceRight=Gt,u.result=function(n,t,r){return null==n?r:(r="undefined"!=typeof n[t]?n[t]:r,ur(r)?n[t]():r)},u.runInContext=_,u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:be(n).length},u.some=Jt,u.sortedIndex=Pt,u.template=function(n,t,r){var e=u.templateSettings;n=xr(n||""),r=nr({},r,e);var o,a=nr({},r.imports,e.imports),e=be(a),a=lr(a),i=0,l=r.interpolate||U,c="__p+='",l=jr((r.escape||U).source+"|"+l.source+"|"+(l===D?W:U).source+"|"+(r.evaluate||U).source+"|$","g"); +n.replace(l,function(t,r,e,u,a,l){return e||(e=u),c+=n.slice(i,l).replace(X,f),r&&(c+="'+__e("+r+")+'"),a&&(o=true,c+="';"+a+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),i=l+t.length,t}),c+="';",l=r=r.variable,l||(r="obj",c="with("+r+"){"+c+"}"),c=(o?c.replace(T,""):c).replace(P,"$1").replace(q,"$1;"),c="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var p=dr(e,"return "+c).apply(w,a) +}catch(s){throw s.source=c,s}return t?p(t):(p.source=c,p)},u.trim=_e,u.trimLeft=we,u.trimRight=je,u.unescape=function(n){return null==n?"":(n=xr(n),0>n.indexOf(";")?n:n.replace(F,b))},u.uniqueId=function(n){var t=++R;return xr(null==n?"":n)+t},u.all=Dt,u.any=Jt,u.detect=zt,u.findWhere=zt,u.foldl=Xt,u.foldr=Gt,u.include=Bt,u.inject=Xt,sr(function(){var n={};return mt(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),false),u.first=It,u.last=function(n,t,r){var e=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=o; +for(t=u.createCallback(t,r,3);a--&&t(n[a],a,n);)e++}else if(e=t,null==e||r)return n?n[o-1]:w;return e=o-e,Tt(n,0"']/g,L=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,D=/<%=([\s\S]+?)%>/g,W=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,z=/\w*$/,K=/^\s*function[ \n\r\t]+\w/,M=/^0[xX]/,U=/($^)/,V=/\bthis\b/,X=/['\n\r\t\u2028\u2029\\]/g,G=" \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",H=[],J=[],Q="Array Boolean Date Error Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Y="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Z="[object Arguments]",nt="[object Array]",tt="[object Boolean]",rt="[object Date]",et="[object Error]",ut="[object Function]",ot="[object Number]",at="[object Object]",it="[object RegExp]",lt="[object String]",ft={}; ft[ut]=false,ft[Z]=ft[nt]=ft[tt]=ft[rt]=ft[ot]=ft[at]=ft[it]=ft[lt]=true;var ct={leading:false,maxWait:0,trailing:false},pt={configurable:false,enumerable:false,value:null,writable:false},st={"&":"&","<":"<",">":">",'"':""","'":"'"},gt={"&":"&","<":"<",">":">",""":'"',"'":"'"},ht={"function":true,object:true},vt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yt=ht[typeof window]&&window||this,mt=ht[typeof exports]&&exports&&!exports.nodeType&&exports,dt=ht[typeof global]&&global; !dt||dt.global!==dt&&dt.window!==dt||(yt=dt);var dt=(ht=ht[typeof module]&&module&&!module.nodeType&&module)&&ht.exports===mt&&mt,bt=_();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(yt._=bt, define(function(){return bt})):mt&&ht?dt?(ht.exports=bt)._=bt:mt._=bt:yt._=bt}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 6706ea162..1d083a654 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -6562,6 +6562,7 @@ * * @static * @memberOf _ + * @alias callback * @category Utilities * @param {*} [func=identity] The value to convert to a callback. * @param {*} [thisArg] The `this` binding of the created callback. @@ -7083,6 +7084,7 @@ lodash.zipObject = zipObject; // add aliases + lodash.callback = createCallback; lodash.collect = map; lodash.drop = rest; lodash.each = forEach; diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 53ec4bd5e..25403f435 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -10,54 +10,55 @@ (function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202=A&&(o=r,e=ue(e));++uo(e,f)&&a.push(f)}return a}function ht(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(;++r=A,l=[];if(f)var s=ue(),i=r;else s=u?c():l;for(;++oi(s,h))&&((u||f)&&s.push(h),l.push(g))}return!f&&u&&p(s),l}function jt(n){return function(t,r,e){var u={};r=y.createCallback(r,e,3),e=-1;var o=t?t.length:0;if(typeof o=="number")for(;++er&&(r=0),e=[n,t,r,e,u,o],t==w||t==(w|C)?S(e):pt(e))}function xt(){var n=(n=y.indexOf)===Et?t:n; -return n}function Ct(n){return typeof n=="function"&&Sr.test(Ir.call(n))}function Ot(n){var t,r;return n&&Ar.call(n)==et&&(Fr.call(n,"constructor")||(t=n.constructor,!rr(t)||t instanceof t))?(o(n,function(n,t){r=t}),typeof r=="undefined"||Fr.call(n,r)):false}function At(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ar.call(n)==Q||false}function St(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=y.createCallback(t,r,3);++oe?Xr(0,u+e):e||0;else if(e)return e=It(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function Nt(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=y.createCallback(t,r,3);++ut?t=Xr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Xr(u+r,0):r>u&&(r=u),u=r-t||0,r=sr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!ce(n)&&or(n))return Lr?Lr.call(n,t,r):-1r?Xr(0,e+r):r)||0,-1=A&&(o=r,e=oe(e));++uo(e,f)&&a.push(f)}return a}function ht(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(;++r=A,l=[];if(f)var s=oe(),i=r;else s=u?c():l;for(;++oi(s,h))&&((u||f)&&s.push(h),l.push(g))}return!f&&u&&p(s),l}function kt(n){return function(t,r,e){var u={};r=y.createCallback(r,e,3),e=-1;var o=t?t.length:0;if(typeof o=="number")for(;++er&&(r=0),e=[n,t,r,e,u,o],t==w||t==(w|C)?S(e):pt(e))}function xt(){var n=(n=y.indexOf)===Et?t:n; +return n}function Ct(n){return typeof n=="function"&&Er.test(Tr.call(n))}function Ot(n){var t,r;return n&&Sr.call(n)==et&&($r.call(n,"constructor")||(t=n.constructor,!rr(t)||t instanceof t))?(o(n,function(n,t){r=t}),typeof r=="undefined"||$r.call(n,r)):false}function At(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Sr.call(n)==Q||false}function St(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=y.createCallback(t,r,3);++oe?Gr(0,u+e):e||0;else if(e)return e=It(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function Nt(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=y.createCallback(t,r,3);++ut?t=Gr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Gr(u+r,0):r>u&&(r=u),u=r-t||0,r=gr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!pe(n)&&or(n))return Pr?Pr.call(n,t,r):-1r?Gr(0,e+r):r)||0,-1o&&(o=a)}else t=null==t&&or(n)?e:y.createCallback(t,r,3),ht(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function Ut(n,t,r,e){var u=3>arguments.length;t=y.createCallback(t,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number")for(u&&i&&(r=n[++o]);++oarguments.length;return t=y.createCallback(t,e,4),Pt(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function Xt(n){var t=-1,r=n?n.length:0,e=sr(typeof r=="number"?r:0); -return ht(n,function(n){var r=_t(0,++t);e[t]=e[r],e[r]=n}),e}function Gt(n,t,r){var e;t=y.createCallback(t,r,3),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++rarguments.length)return kt(n,w,null,t);var r=n&&(n[N]?n[N][2]:n.length),e=Rt(arguments,2),r=r-e.length;return kt(n,w|C,r,t,e)}function Jt(n,t,r){function e(){c&&Nr(c),i=c=p=_,(h||g!==t)&&(s=ye(),a=n.apply(l,o),c||i||(o=l=null))}function u(){var r=t-(ye()-f); -0=y;m?(i&&(i=Nr(i)),s=f,a=n.apply(l,o)):i||(i=Dr(e,y))}return m&&c?c=Nr(c):c||t===g||(c=Dr(u,t)),r&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a -}}function Qt(n,t,r){var e=arguments,u=0,o=e.length,i=typeof r;if("number"!=i&&"string"!=i||!e[3]||e[3][r]!==t||(o=2),3--n?t.apply(this,arguments):void 0}},y.assign=Qt,y.at=function(n,t){var r=arguments,e=-1,u=vt(r,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!r[2]||r[2][t]!==n||(o=1),r=sr(o);++earguments.length?kt(t,w|j,null,n):kt(t,w|j|C,null,n,Rt(arguments,2))},y.chain=function(n){return n=new m(n),n.__chain__=true,n},y.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t=A&&ue(e?n[e]:f)))}var a=n[0],s=-1,g=a?a.length:0,h=[];n:for(;++s(v?r(v,l):i(f,l))){for(e=u,(v||f).push(l);--e;)if(v=o[e],0>(v?r(v,l):i(n[e],l)))continue n;h.push(l)}}return p(o),p(f),h},y.invert=function(n,t){for(var r=-1,e=se(n),u=e.length,o={};++rr?Xr(0,e+r):Gr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},y.mixin=lr,y.noConflict=function(){return n._=Or,this},y.noop=cr,y.now=ye,y.parseInt=me,y.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=Qr(),Gr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):_t(n,t)},y.reduce=Ut,y.reduceRight=Vt,y.result=function(n,t,r){return null==n?r:(r="undefined"!=typeof n[t]?n[t]:r,rr(r)?n[t]():r)},y.runInContext=b,y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:se(n).length},y.some=Gt,y.sortedIndex=It,y.template=function(n,t,r){var e=y.templateSettings; -n=_r(n||""),r=Yt({},r,e);var u,o=Yt({},r.imports,e.imports),e=se(o),o=ir(o),i=0,a=r.interpolate||M,f="__p+='",a=br((r.escape||M).source+"|"+a.source+"|"+(a===W?z:M).source+"|"+(r.evaluate||M).source+"|$","g");n.replace(a,function(t,r,e,o,a,c){return e||(e=o),f+=n.slice(i,c).replace(V,l),r&&(f+="'+__e("+r+")+'"),a&&(u=true,f+="';"+a+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),i=c+t.length,t}),f+="';",a=r=r.variable,a||(r="obj",f="with("+r+"){"+f+"}"),f=(u?f.replace(I,""):f).replace(T,"$1").replace(F,"$1;"),f="function("+r+"){"+(a?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}"; -try{var c=vr(e,"return "+f).apply(_,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},y.trim=ge,y.trimLeft=he,y.trimRight=ve,y.unescape=function(n){return null==n?"":(n=_r(n),0>n.indexOf(";")?n:n.replace($,d))},y.uniqueId=function(n){var t=++R;return _r(null==n?"":n)+t},y.all=qt,y.any=Gt,y.detect=zt,y.findWhere=zt,y.foldl=Ut,y.foldr=Vt,y.include=Dt,y.inject=Ut,lr(function(){var n={};return mt(y,function(t,r){y.prototype[r]||(n[r]=t)}),n}(),false),y.first=St,y.last=function(n,t,r){var e=0,u=n?n.length:0; -if(typeof t!="number"&&null!=t){var o=u;for(t=y.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n?n[u-1]:_;return e=u-e,Rt(n,0"']/g,D=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,L=/\w*$/,P=/^\s*function[ \n\r\t]+\w/,K=/^0[xX]/,M=/($^)/,U=/\bthis\b/,V=/['\n\r\t\u2028\u2029\\]/g,X=" \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",G=[],H=[],J="Array Boolean Date Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Q="[object Arguments]",Y="[object Array]",Z="[object Boolean]",nt="[object Date]",tt="[object Function]",rt="[object Number]",et="[object Object]",ut="[object RegExp]",ot="[object String]",it={}; +return n}function Pt(n,t,r){var e=n?n.length:0;if(t=t&&typeof r=="undefined"?t:ct(t,r,3),typeof e=="number")for(;e--&&false!==t(n[e],e,n););else{var u=ge(n),e=u.length;ht(n,function(n,r,o){return r=u?u[--e]:--e,t(o[r],r,o)})}return n}function Kt(n,t,r){var e=-1,u=n?n.length:0;if(t=y.createCallback(t,r,3),typeof u=="number")for(var o=gr(u);++eo&&(o=a)}else t=null==t&&or(n)?e:y.createCallback(t,r,3),ht(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function Ut(n,t,r,e){var u=3>arguments.length;t=y.createCallback(t,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number")for(u&&i&&(r=n[++o]);++oarguments.length;return t=y.createCallback(t,e,4),Pt(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function Xt(n){var t=-1,r=n?n.length:0,e=gr(typeof r=="number"?r:0); +return ht(n,function(n){var r=_t(0,++t);e[t]=e[r],e[r]=n}),e}function Gt(n,t,r){var e;t=y.createCallback(t,r,3),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++rarguments.length)return jt(n,w,null,t);var r=n&&(n[N]?n[N][2]:n.length),e=Rt(arguments,2),r=r-e.length;return jt(n,w|C,r,t,e)}function Jt(n,t,r){function e(){c&&Rr(c),i=c=p=_,(h||g!==t)&&(s=me(),a=n.apply(l,o),c||i||(o=l=null))}function u(){var r=t-(me()-f); +0=y;m?(i&&(i=Rr(i)),s=f,a=n.apply(l,o)):i||(i=qr(e,y))}return m&&c?c=Rr(c):c||t===g||(c=qr(u,t)),r&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a +}}function Qt(n,t,r){var e=arguments,u=0,o=e.length,i=typeof r;if("number"!=i&&"string"!=i||!e[3]||e[3][r]!==t||(o=2),3--n?t.apply(this,arguments):void 0}},y.assign=Qt,y.at=function(n,t){var r=arguments,e=-1,u=vt(r,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!r[2]||r[2][t]!==n||(o=1),r=gr(o);++earguments.length?jt(t,w|k,null,n):jt(t,w|k|C,null,n,Rt(arguments,2))},y.chain=function(n){return n=new m(n),n.__chain__=true,n},y.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t=A&&oe(e?n[e]:f)))}var a=n[0],s=-1,g=a?a.length:0,h=[];n:for(;++s(v?r(v,l):i(f,l))){for(e=u,(v||f).push(l);--e;)if(v=o[e],0>(v?r(v,l):i(n[e],l)))continue n;h.push(l) +}}return p(o),p(f),h},y.invert=function(n,t){for(var r=-1,e=ge(n),u=e.length,o={};++rr?Gr(0,e+r):Hr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},y.mixin=cr,y.noConflict=function(){return n._=Ar,this},y.noop=pr,y.now=me,y.parseInt=de,y.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=Yr(),Hr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):_t(n,t) +},y.reduce=Ut,y.reduceRight=Vt,y.result=function(n,t,r){return null==n?r:(r="undefined"!=typeof n[t]?n[t]:r,rr(r)?n[t]():r)},y.runInContext=b,y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ge(n).length},y.some=Gt,y.sortedIndex=It,y.template=function(n,t,r){var e=y.templateSettings;n=wr(n||""),r=Yt({},r,e);var u,o=Yt({},r.imports,e.imports),e=ge(o),o=ir(o),i=0,a=r.interpolate||M,f="__p+='",a=_r((r.escape||M).source+"|"+a.source+"|"+(a===W?z:M).source+"|"+(r.evaluate||M).source+"|$","g"); +n.replace(a,function(t,r,e,o,a,c){return e||(e=o),f+=n.slice(i,c).replace(V,l),r&&(f+="'+__e("+r+")+'"),a&&(u=true,f+="';"+a+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),i=c+t.length,t}),f+="';",a=r=r.variable,a||(r="obj",f="with("+r+"){"+f+"}"),f=(u?f.replace(I,""):f).replace(T,"$1").replace(F,"$1;"),f="function("+r+"){"+(a?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=yr(e,"return "+f).apply(_,o) +}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},y.trim=he,y.trimLeft=ve,y.trimRight=ye,y.unescape=function(n){return null==n?"":(n=wr(n),0>n.indexOf(";")?n:n.replace($,d))},y.uniqueId=function(n){var t=++R;return wr(null==n?"":n)+t},y.all=qt,y.any=Gt,y.detect=zt,y.findWhere=zt,y.foldl=Ut,y.foldr=Vt,y.include=Dt,y.inject=Ut,cr(function(){var n={};return mt(y,function(t,r){y.prototype[r]||(n[r]=t)}),n}(),false),y.first=St,y.last=function(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u; +for(t=y.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n?n[u-1]:_;return e=u-e,Rt(n,0"']/g,D=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,L=/\w*$/,P=/^\s*function[ \n\r\t]+\w/,K=/^0[xX]/,M=/($^)/,U=/\bthis\b/,V=/['\n\r\t\u2028\u2029\\]/g,X=" \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",G=[],H=[],J="Array Boolean Date Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Q="[object Arguments]",Y="[object Array]",Z="[object Boolean]",nt="[object Date]",tt="[object Function]",rt="[object Number]",et="[object Object]",ut="[object RegExp]",ot="[object String]",it={}; it[tt]=false,it[Q]=it[Y]=it[Z]=it[nt]=it[rt]=it[et]=it[ut]=it[ot]=true;var at={leading:false,maxWait:0,trailing:false},ft={configurable:false,enumerable:false,value:null,writable:false},lt={"&":"&","<":"<",">":">",'"':""","'":"'"},ct={"&":"&","<":"<",">":">",""":'"',"'":"'"},pt={"function":true,object:true},st={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},gt=pt[typeof window]&&window||this,ht=pt[typeof exports]&&exports&&!exports.nodeType&&exports,vt=pt[typeof global]&&global; !vt||vt.global!==vt&&vt.window!==vt||(gt=vt);var vt=(pt=pt[typeof module]&&module&&!module.nodeType&&module)&&pt.exports===ht&&ht,yt=b();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(gt._=yt, define(function(){return yt})):ht&&pt?vt?(pt.exports=yt)._=yt:ht._=yt:gt._=yt}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 5372b5780..e65715ebd 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -4597,6 +4597,7 @@ * * @static * @memberOf _ + * @alias callback * @category Utilities * @param {*} [func=identity] The value to convert to a callback. * @param {*} [thisArg] The `this` binding of the created callback. @@ -5011,7 +5012,6 @@ lodash.wrap = wrap; lodash.zip = zip; - // add aliases lodash.collect = map; lodash.drop = rest; lodash.each = forEach; diff --git a/doc/README.md b/doc/README.md index 9867c174d..a0d955940 100644 --- a/doc/README.md +++ b/doc/README.md @@ -187,6 +187,7 @@ ## `Utilities` * `_.now` +* `_.callback` -> `createCallback` * `_.constant` * `_.createCallback` * `_.identity` @@ -4322,7 +4323,7 @@ _.unescape('fred, barney & pebbles'); ### `_.now` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7093 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7094 "View in source") [Ⓣ][1] *(unknown)*: Gets the number of milliseconds that have elapsed since the Unix epoch *(1 January `1970 00`:00:00 UTC)*. @@ -4367,10 +4368,13 @@ getter() === object; ### `_.createCallback([func=identity], [thisArg], [argCount])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6889 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6890 "View in source") [Ⓣ][1] Produces a callback bound to an optional `thisArg`. If `func` is a property name the created callback will return the property value for a given element. If `func` is an object the created callback will return `true` for elements that contain the equivalent object properties, otherwise it will return `false`. +#### Aliases +*_.callback* + #### Arguments 1. `[func=identity]` *(*)*: The value to convert to a callback. 2. `[thisArg]` *(*)*: The `this` binding of the created callback. @@ -4406,7 +4410,7 @@ _.filter(characters, 'age__gt38'); ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6912 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6913 "View in source") [Ⓣ][1] This method returns the first argument provided to it. @@ -4431,7 +4435,7 @@ _.identity(object) === object; ### `_.match(props)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6941 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6942 "View in source") [Ⓣ][1] Creates a "_.where" style function, which performs a deep comparison between a given object and the `props` object, returning `true` if the given object has equivalent property values, else `false`. @@ -4465,7 +4469,7 @@ _.find(characters, matchAge); ### `_.mixin([object=lodash], source, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6999 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7000 "View in source") [Ⓣ][1] Adds function properties of a source object to the destination object. If `object` is a function methods will be added to its prototype as well. @@ -4503,7 +4507,7 @@ _('fred').vowels(); ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7059 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7060 "View in source") [Ⓣ][1] Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. @@ -4523,7 +4527,7 @@ var lodash = _.noConflict(); ### `_.noop()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7076 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7077 "View in source") [Ⓣ][1] A no-operation function. @@ -4542,7 +4546,7 @@ _.noop(object) === undefined; ### `_.parseInt(value, [radix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7117 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7118 "View in source") [Ⓣ][1] Converts `value` to an integer of the specified radix. If `radix` is `undefined` or `0` a `radix` of `10` is used unless the `value` is a hexadecimal, in which case a `radix` of `16` is used. @@ -4569,7 +4573,7 @@ _.parseInt('08'); ### `_.property(key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7148 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7149 "View in source") [Ⓣ][1] Creates a "_.pluck" style function, which returns the `key` value of a given object. @@ -4603,7 +4607,7 @@ _.sortBy(characters, getName); ### `_.random([min=0], [max=1], [floating=false])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7181 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7182 "View in source") [Ⓣ][1] Produces a random number between `min` and `max` *(inclusive)*. If only one argument is provided a number between `0` and the given number will be returned. If `floating` is truey or either `min` or `max` are floats a floating-point number will be returned instead of an integer. @@ -4638,7 +4642,7 @@ _.random(1.2, 5.2); ### `_.result(object, key, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7246 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7247 "View in source") [Ⓣ][1] Resolves the value of property `key` on `object`. If `key` is a function it will be invoked with the `this` binding of `object` and its result returned, else the property value is returned. If `object` is `null` or `undefined` then `undefined` is returned. If a default value is provided it will be returned if the property value resolves to `undefined`. @@ -4695,7 +4699,7 @@ Create a new `lodash` function using the given context object. ### `_.times(n, callback, [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7277 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7278 "View in source") [Ⓣ][1] Executes the callback `n` times, returning an array of the results of each callback execution. The callback is bound to `thisArg` and invoked with one argument; *(index)*. @@ -4727,7 +4731,7 @@ _.times(3, function(n) { this.cast(n); }, mage); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7305 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7306 "View in source") [Ⓣ][1] Generates a unique ID. If `prefix` is provided the ID will be appended to it. @@ -4780,7 +4784,7 @@ A reference to the `lodash` function. ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7512 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7514 "View in source") [Ⓣ][1] *(string)*: The semantic version number. diff --git a/lodash.js b/lodash.js index 83c532c0a..c996cefb5 100644 --- a/lodash.js +++ b/lodash.js @@ -6863,6 +6863,7 @@ * * @static * @memberOf _ + * @alias callback * @category Utilities * @param {*} [func=identity] The value to convert to a callback. * @param {*} [thisArg] The `this` binding of the created callback. @@ -7384,6 +7385,7 @@ lodash.zipObject = zipObject; // add aliases + lodash.callback = createCallback; lodash.collect = map; lodash.drop = rest; lodash.each = forEach; diff --git a/test/test.js b/test/test.js index e8022ede0..5bfeed404 100644 --- a/test/test.js +++ b/test/test.js @@ -8990,7 +8990,7 @@ var acceptFalsey = _.difference(allMethods, rejectFalsey); - test('should accept falsey arguments', 163, function() { + test('should accept falsey arguments', 164, function() { var emptyArrays = _.map(falsey, function() { return []; }), isExposed = '_' in root, oldDash = root._;