Add _.chain alias of _. [closes #267]

Former-commit-id: 580e4346444096c7fa77cfc5cf2c68b6cf891fcf
This commit is contained in:
John-David Dalton
2013-05-11 00:59:48 -07:00
parent 9bd0c01702
commit 5841e62c66
9 changed files with 56 additions and 28 deletions

View File

@@ -180,7 +180,6 @@
'zipObject': [],
// method used by the `backbone` and `underscore` builds
'chain': ['value'],
'findWhere': ['find']
};
@@ -202,7 +201,7 @@
var allMethods = _.without(_.keys(dependencyMap));
/** List of Lo-Dash methods */
var lodashMethods = _.without(allMethods, 'chain', 'findWhere');
var lodashMethods = _.without(allMethods, 'findWhere');
/** List of Backbone's Lo-Dash dependencies */
var backboneDependencies = [
@@ -280,7 +279,9 @@
];
/** List of Underscore methods */
var underscoreMethods = _.without.apply(_, [allMethods].concat(lodashOnlyMethods));
var underscoreMethods = _.without
.apply(_, [allMethods].concat(lodashOnlyMethods))
.concat('chain');
/** List of ways to export the `lodash` function */
var exportsAll = [
@@ -366,9 +367,9 @@
].join('\n' + indent));
});
// add `lodash.chain` assignment
// replace `lodash.chain` assignment
source = source.replace(getMethodAssignments(source), function(match) {
return match.replace(/^(?: *\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\n)?( *)lodash\.VERSION *=/m, '$1lodash.chain = chain;\n\n$&');
return match.replace(/^( *lodash\.chain *= *).+/m, '$1chain;');
});
// add `lodash.prototype.chain` assignment
@@ -1803,6 +1804,7 @@
}
});
dependencyMap.chain = ['value'];
dependencyMap.findWhere = ['where'];
dependencyMap.reduceRight = _.without(dependencyMap.reduceRight, 'isString');
dependencyMap.value = _.without(dependencyMap.value, 'isArray');
@@ -2357,6 +2359,20 @@
'}'
].join('\n'));
}
// replace `_.memoize`
if (!useLodashMethod('memoize')) {
source = replaceFunction(source, 'memoize', [
'function memoize(func, resolver) {',
' var cache = {};',
' return function() {',
' var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);',
' return hasOwnProperty.call(cache, key)',
' ? cache[key]',
' : (cache[key] = func.apply(this, arguments));',
' };',
'}'
].join('\n'));
}
// replace `_.omit`
if (!useLodashMethod('omit')) {
source = replaceFunction(source, 'omit', [

13
dist/lodash.compat.js vendored
View File

@@ -281,6 +281,7 @@
*
* @name _
* @constructor
* @alias chain
* @category Chaining
* @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance.
@@ -4598,13 +4599,16 @@
* });
*/
function memoize(func, resolver) {
var cache = {};
return function() {
var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
function memoized() {
var cache = memoized.cache,
key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
return hasOwnProperty.call(cache, key)
? cache[key]
: (cache[key] = func.apply(this, arguments));
};
}
memoized.cache = {};
return memoized;
}
/**
@@ -5355,6 +5359,7 @@
lodash.zipObject = zipObject;
// add aliases
lodash.chain = lodash;
lodash.collect = map;
lodash.drop = rest;
lodash.each = forEach;

View File

@@ -31,12 +31,12 @@ n[u]=St(n[u],n)}return n},a.bindKey=function(n,t){return L(n,t,yr.call(arguments
var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Er(n);return function(t){for(var r=u.length,e=!1;r--&&(e=rt(t[u[r]],n[u[r]],i)););return e}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,a){return n.call(t,r,e,u,a)}:function(r,e,u){return n.call(t,r,e,u)}:n},a.debounce=function(n,t,r){function e(){var t=c&&(!l||1<f);f=i=0,t&&(a=n.apply(o,u))}var u,a,o,i,f=0,c=!0;if(!0===r)var l=!0,c=!1;
else r&&q[typeof r]&&(l=r.leading,c="trailing"in r?r.trailing:c);return function(){return u=arguments,o=this,Xt(i),l&&2>++f&&(a=n.apply(o,u)),i=ur(e,t),a}},a.defaults=Pr,a.defer=At,a.delay=function(n,t){var e=yr.call(arguments,2);return ur(function(){n.apply(r,e)},t)},a.difference=bt,a.filter=pt,a.flatten=wt,a.forEach=vt,a.forIn=Br,a.forOwn=Nr,a.functions=nt,a.groupBy=function(n,t,r){var e={};return t=a.createCallback(t,r),vt(n,function(n,r,u){r=Lt(t(n,r,u)),(tr.call(e,r)?e[r]:e[r]=[]).push(n)}),e
},a.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,r);o--&&t(n[o],o,n);)e++}else e=null==t||r?1:t||e;return W(n,0,sr(pr(0,u-e),u))},a.intersection=function(n){var t=arguments,r=t.length,e={0:{}},u=-1,a=n?n.length:0,o=a>=c,i=[],l=i;n:for(;++u<a;){var p=n[u];if(o)var s=f+p,s=e[0][s]?!(l=e[0][s]):l=e[0][s]=[];if(s||0>Ct(l,p)){o&&l.push(p);for(var v=r;--v;)if(!(e[v]||(e[v]=R(t[v])))(p))continue n;i.push(p)}}return i},a.invert=tt,a.invoke=function(n,t){var r=yr.call(arguments,2),e=-1,u=typeof t=="function",a=n?n.length:0,o=Nt(typeof a=="number"?a:0);
return vt(n,function(n){o[++e]=(u?t:n[t]).apply(n,r)}),o},a.keys=Er,a.map=gt,a.max=yt,a.memoize=function(n,t){var r={};return function(){var e=f+(t?t.apply(this,arguments):arguments[0]);return tr.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},a.merge=it,a.min=function(n,t,r){var e=1/0,u=e;if(!t&&kr(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];i<u&&(u=i)}}else t=!t&&ot(n)?T:a.createCallback(t,r),Or(n,function(n,r,a){r=t(n,r,a),r<e&&(e=r,u=n)});return u},a.omit=function(n,t,r){var e=typeof t=="function",u={};
return vt(n,function(n){o[++e]=(u?t:n[t]).apply(n,r)}),o},a.keys=Er,a.map=gt,a.max=yt,a.memoize=function(n,t){function r(){var e=r.cache,u=f+(t?t.apply(this,arguments):arguments[0]);return tr.call(e,u)?e[u]:e[u]=n.apply(this,arguments)}return r.cache={},r},a.merge=it,a.min=function(n,t,r){var e=1/0,u=e;if(!t&&kr(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];i<u&&(u=i)}}else t=!t&&ot(n)?T:a.createCallback(t,r),Or(n,function(n,r,a){r=t(n,r,a),r<e&&(e=r,u=n)});return u},a.omit=function(n,t,r){var e=typeof t=="function",u={};
if(e)t=a.createCallback(t,r);else var o=Yt.apply(Ht,yr.call(arguments,1));return Br(n,function(n,r,a){(e?!t(n,r,a):0>Ct(o,r))&&(u[r]=n)}),u},a.once=function(n){var t,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},a.pairs=function(n){for(var t=-1,r=Er(n),e=r.length,u=Nt(e);++t<e;){var a=r[t];u[t]=[a,n[a]]}return u},a.partial=function(n){return L(n,yr.call(arguments,1))},a.partialRight=function(n){return L(n,yr.call(arguments,1),null,i)},a.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=-1,o=Yt.apply(Ht,yr.call(arguments,1)),i=ut(n)?o.length:0;++u<i;){var f=o[u];
f in n&&(e[f]=n[f])}else t=a.createCallback(t,r),Br(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},a.pluck=$r,a.range=function(n,t,r){n=+n||0,r=+r||1,null==t&&(t=n,n=0);var e=-1;t=pr(0,Wt((t-n)/r));for(var u=Nt(t);++e<t;)u[e]=n,n+=r;return u},a.reject=function(n,t,r){return t=a.createCallback(t,r),pt(n,function(n,r,e){return!t(n,r,e)})},a.rest=jt,a.shuffle=function(n){var t=-1,r=n?n.length:0,e=Nt(typeof r=="number"?r:0);return vt(n,function(n){var r=Zt(gr()*(++t+1));e[t]=e[r],e[r]=n}),e},a.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Nt(typeof u=="number"?u:0);
for(t=a.createCallback(t,r),vt(n,function(n,r,u){o[++e]={a:t(n,r,u),b:e,c:n}}),u=o.length,o.sort(K);u--;)o[u]=o[u].c;return o},a.tap=function(n,t){return t(n),n},a.throttle=function(n,t,r){function e(){i=null,l&&(f=new $t,a=n.apply(o,u))}var u,a,o,i,f=0,c=!0,l=!0;return!1===r?c=!1:r&&q[typeof r]&&(c="leading"in r?r.leading:c,l="trailing"in r?r.trailing:l),function(){var r=new $t;!i&&!c&&(f=r);var l=t-(r-f);return u=arguments,o=this,0<l?i||(i=ur(e,l)):(Xt(i),i=null,f=r,a=n.apply(o,u)),a}},a.times=function(n,t,r){n=-1<(n=+n)?n:0;
var e=-1,u=Nt(n);for(t=a.createCallback(t,r,1);++e<n;)u[e]=t(e);return u},a.toArray=function(n){return n&&typeof n.length=="number"?_r.unindexedChars&&ot(n)?n.split(""):W(n):ft(n)},a.union=function(n){return kr(n)||(arguments[0]=n?yr.call(n):Ht),xt(Yt.apply(Ht,arguments))},a.uniq=xt,a.unzip=Et,a.values=ft,a.where=pt,a.without=function(n){return bt(n,yr.call(arguments,1))},a.wrap=function(n,t){return function(){var r=[n];return rr.apply(r,arguments),t.apply(this,r)}},a.zip=function(n){return n?Et(arguments):[]
},a.zipObject=Ot,a.collect=gt,a.drop=jt,a.each=vt,a.extend=Ir,a.methods=nt,a.object=Ot,a.select=pt,a.tail=jt,a.unique=xt,Pt(a),a.clone=Z,a.cloneDeep=function(n,t,r){return Z(n,!0,t,r)},a.contains=ct,a.escape=function(n){return null==n?"":Lt(n).replace(_,M)},a.every=lt,a.find=st,a.findIndex=function(n,t,r){var e=-1,u=n?n.length:0;for(t=a.createCallback(t,r);++e<u;)if(t(n[e],e,n))return e;return-1},a.findKey=function(n,t,r){var e;return t=a.createCallback(t,r),Nr(n,function(n,r,u){return t(n,r,u)?(e=r,!1):void 0
},a.zipObject=Ot,a.chain=a,a.collect=gt,a.drop=jt,a.each=vt,a.extend=Ir,a.methods=nt,a.object=Ot,a.select=pt,a.tail=jt,a.unique=xt,Pt(a),a.clone=Z,a.cloneDeep=function(n,t,r){return Z(n,!0,t,r)},a.contains=ct,a.escape=function(n){return null==n?"":Lt(n).replace(_,M)},a.every=lt,a.find=st,a.findIndex=function(n,t,r){var e=-1,u=n?n.length:0;for(t=a.createCallback(t,r);++e<u;)if(t(n[e],e,n))return e;return-1},a.findKey=function(n,t,r){var e;return t=a.createCallback(t,r),Nr(n,function(n,r,u){return t(n,r,u)?(e=r,!1):void 0
}),e},a.has=function(n,t){return n?tr.call(n,t):!1},a.identity=It,a.indexOf=Ct,a.isArguments=Y,a.isArray=kr,a.isBoolean=function(n){return!0===n||!1===n||ar.call(n)==O},a.isDate=function(n){return n?typeof n=="object"&&ar.call(n)==S:!1},a.isElement=function(n){return n?1===n.nodeType:!1},a.isEmpty=function(n){var t=!0;if(!n)return t;var r=ar.call(n),e=n.length;return r==E||r==F||(_r.argsClass?r==x:Y(n))||r==B&&typeof e=="number"&&et(n.splice)?!e:(Nr(n,function(){return t=!1}),t)},a.isEqual=rt,a.isFinite=function(n){return fr(n)&&!cr(parseFloat(n))
},a.isFunction=et,a.isNaN=function(n){return at(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=at,a.isObject=ut,a.isPlainObject=Fr,a.isRegExp=function(n){return!(!n||!q[typeof n])&&ar.call(n)==N},a.isString=ot,a.isUndefined=function(n){return typeof n=="undefined"},a.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?pr(0,e+r):sr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},a.mixin=Pt,a.noConflict=function(){return e._=Vt,this},a.parseInt=qr,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Zt(gr()*((+t||0)-n+1))
},a.reduce=ht,a.reduceRight=mt,a.result=function(n,t){var e=n?n[t]:r;return et(e)?n[t]():e},a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Er(n).length},a.some=dt,a.sortedIndex=kt,a.template=function(n,t,e){var u=a.templateSettings;n||(n=""),e=Pr({},e,u);var o,i=Pr({},e.imports,u.imports),u=Er(i),i=ft(i),f=0,c=e.interpolate||b,v="__p+='",c=Kt((e.escape||b).source+"|"+c.source+"|"+(c===h?g:b).source+"|"+(e.evaluate||b).source+"|$","g");n.replace(c,function(t,r,e,u,a,i){return e||(e=u),v+=n.slice(f,i).replace(w,H),r&&(v+="'+__e("+r+")+'"),a&&(o=!0,v+="';"+a+";__p+='"),e&&(v+="'+((__t=("+e+"))==null?'':__t)+'"),f=i+t.length,t

13
dist/lodash.js vendored
View File

@@ -256,6 +256,7 @@
*
* @name _
* @constructor
* @alias chain
* @category Chaining
* @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance.
@@ -4299,13 +4300,16 @@
* });
*/
function memoize(func, resolver) {
var cache = {};
return function() {
var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
function memoized() {
var cache = memoized.cache,
key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
return hasOwnProperty.call(cache, key)
? cache[key]
: (cache[key] = func.apply(this, arguments));
};
}
memoized.cache = {};
return memoized;
}
/**
@@ -5056,6 +5060,7 @@
lodash.zipObject = zipObject;
// add aliases
lodash.chain = lodash;
lodash.collect = map;
lodash.drop = rest;
lodash.each = forEach;

12
dist/lodash.min.js vendored
View File

@@ -27,12 +27,12 @@ de[E]=Dt,de[I]=zt,de[N]=Pt,de[S]=Kt,de[A]=Mt,de[B]=Gt,de[$]=Vt,de[F]=Ht,de[R]=Jt
u&&r.push(u)}return r},G.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},G.countBy=function(n,t,e){var r={};return t=G.createCallback(t,e),bt(n,function(n,e,u){e=Jt(t(n,e,u)),ue.call(r,e)?r[e]++:r[e]=1}),r},G.createCallback=function(n,t,e){if(n==u)return Rt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var o=we(n);return function(t){for(var e=o.length,r=a;e--&&(r=ot(t[o[e]],n[o[e]],l)););return r
}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)}:function(e,r,u){return n.call(t,e,r,u)}:n},G.debounce=function(n,t,e){function u(){var t=p&&(!s||1<l);l=c=0,t&&(i=n.apply(f,o))}var o,i,f,c,l=0,p=r;if(e===r)var s=r,p=a;else e&&q[typeof e]&&(s=e.leading,p="trailing"in e?e.trailing:p);return function(){return o=arguments,f=this,ne(c),s&&2>++l&&(i=n.apply(f,o)),c=ie(u,t),i}},G.defaults=M,G.defer=Ft,G.delay=function(n,t){var r=me.call(arguments,2);
return ie(function(){n.apply(e,r)},t)},G.difference=Ct,G.filter=yt,G.flatten=Ot,G.forEach=bt,G.forIn=K,G.forOwn=P,G.functions=ut,G.groupBy=function(n,t,e){var r={};return t=G.createCallback(t,e),bt(n,function(n,e,u){e=Jt(t(n,e,u)),(ue.call(r,e)?r[e]:r[e]=[]).push(n)}),r},G.initial=function(n,t,e){if(!n)return[];var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=G.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=t==u||e?1:t||r;return tt(n,0,ye(ge(0,a-r),a))},G.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=s,i=[],f=i;
n:for(;++u<a;){var c=n[u];if(o)var l=p+c,l=r[0][l]?!(f=r[0][l]):f=r[0][l]=[];if(l||0>Et(f,c)){o&&f.push(c);for(var v=e;--v;)if(!(r[v]||(r[v]=H(t[v])))(c))continue n;i.push(c)}}return i},G.invert=at,G.invoke=function(n,t){var e=me.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Dt(typeof a=="number"?a:0);return bt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},G.keys=we,G.map=mt,G.max=dt,G.memoize=function(n,t){var e={};return function(){var r=p+(t?t.apply(this,arguments):arguments[0]);
return ue.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},G.merge=pt,G.min=function(n,t,e){var r=1/0,u=r;if(!t&&ke(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o<u&&(u=o)}}else t=!t&&lt(n)?J:G.createCallback(t,e),bt(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},G.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=G.createCallback(t,e);else var a=te.apply(Qt,me.call(arguments,1));return K(n,function(n,e,o){(r?!t(n,e,o):0>Et(a,e))&&(u[e]=n)}),u},G.once=function(n){var t,e;return function(){return t?e:(t=r,e=n.apply(this,arguments),n=u,e)
}},G.pairs=function(n){for(var t=-1,e=we(n),r=e.length,u=Dt(r);++t<r;){var a=e[t];u[t]=[a,n[a]]}return u},G.partial=function(n){return Q(n,me.call(arguments,1))},G.partialRight=function(n){return Q(n,me.call(arguments,1),u,l)},G.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=te.apply(Qt,me.call(arguments,1)),o=ft(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=G.createCallback(t,e),K(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},G.pluck=_t,G.range=function(n,t,e){n=+n||0,e=+e||1,t==u&&(t=n,n=0);
var r=-1;t=ge(0,Zt((t-n)/e));for(var a=Dt(t);++r<t;)a[r]=n,n+=e;return a},G.reject=function(n,t,e){return t=G.createCallback(t,e),yt(n,function(n,e,r){return!t(n,e,r)})},G.rest=It,G.shuffle=function(n){var t=-1,e=n?n.length:0,r=Dt(typeof e=="number"?e:0);return bt(n,function(n){var e=ee(be()*(++t+1));r[t]=r[e],r[e]=n}),r},G.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,a=Dt(typeof u=="number"?u:0);for(t=G.createCallback(t,e),bt(n,function(n,e,u){a[++r]={a:t(n,e,u),b:r,c:n}}),u=a.length,a.sort(L);u--;)a[u]=a[u].c;
return a},G.tap=function(n,t){return t(n),n},G.throttle=function(n,t,e){function o(){l=u,v&&(p=new Pt,f=n.apply(c,i))}var i,f,c,l,p=0,s=r,v=r;return e===a?s=a:e&&q[typeof e]&&(s="leading"in e?e.leading:s,v="trailing"in e?e.trailing:v),function(){var e=new Pt;!l&&!s&&(p=e);var r=t-(e-p);return i=arguments,c=this,0<r?l||(l=ie(o,r)):(ne(l),l=u,p=e,f=n.apply(c,i)),f}},G.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Dt(n);for(t=G.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},G.toArray=function(n){return n&&typeof n.length=="number"?tt(n):st(n)
},G.union=function(n){return ke(n)||(arguments[0]=n?me.call(n):Qt),St(te.apply(Qt,arguments))},G.uniq=St,G.unzip=At,G.values=st,G.where=yt,G.without=function(n){return Ct(n,me.call(arguments,1))},G.wrap=function(n,t){return function(){var e=[n];return ae.apply(e,arguments),t.apply(this,e)}},G.zip=function(n){return n?At(arguments):[]},G.zipObject=$t,G.collect=mt,G.drop=It,G.each=bt,G.extend=U,G.methods=ut,G.object=$t,G.select=yt,G.tail=It,G.unique=St,Tt(G),G.clone=rt,G.cloneDeep=function(n,t,e){return rt(n,r,t,e)
n:for(;++u<a;){var c=n[u];if(o)var l=p+c,l=r[0][l]?!(f=r[0][l]):f=r[0][l]=[];if(l||0>Et(f,c)){o&&f.push(c);for(var v=e;--v;)if(!(r[v]||(r[v]=H(t[v])))(c))continue n;i.push(c)}}return i},G.invert=at,G.invoke=function(n,t){var e=me.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Dt(typeof a=="number"?a:0);return bt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},G.keys=we,G.map=mt,G.max=dt,G.memoize=function(n,t){function e(){var r=e.cache,u=p+(t?t.apply(this,arguments):arguments[0]);
return ue.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},G.merge=pt,G.min=function(n,t,e){var r=1/0,u=r;if(!t&&ke(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o<u&&(u=o)}}else t=!t&&lt(n)?J:G.createCallback(t,e),bt(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},G.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=G.createCallback(t,e);else var a=te.apply(Qt,me.call(arguments,1));return K(n,function(n,e,o){(r?!t(n,e,o):0>Et(a,e))&&(u[e]=n)}),u},G.once=function(n){var t,e;
return function(){return t?e:(t=r,e=n.apply(this,arguments),n=u,e)}},G.pairs=function(n){for(var t=-1,e=we(n),r=e.length,u=Dt(r);++t<r;){var a=e[t];u[t]=[a,n[a]]}return u},G.partial=function(n){return Q(n,me.call(arguments,1))},G.partialRight=function(n){return Q(n,me.call(arguments,1),u,l)},G.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=te.apply(Qt,me.call(arguments,1)),o=ft(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=G.createCallback(t,e),K(n,function(n,e,u){t(n,e,u)&&(r[e]=n)
});return r},G.pluck=_t,G.range=function(n,t,e){n=+n||0,e=+e||1,t==u&&(t=n,n=0);var r=-1;t=ge(0,Zt((t-n)/e));for(var a=Dt(t);++r<t;)a[r]=n,n+=e;return a},G.reject=function(n,t,e){return t=G.createCallback(t,e),yt(n,function(n,e,r){return!t(n,e,r)})},G.rest=It,G.shuffle=function(n){var t=-1,e=n?n.length:0,r=Dt(typeof e=="number"?e:0);return bt(n,function(n){var e=ee(be()*(++t+1));r[t]=r[e],r[e]=n}),r},G.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,a=Dt(typeof u=="number"?u:0);for(t=G.createCallback(t,e),bt(n,function(n,e,u){a[++r]={a:t(n,e,u),b:r,c:n}
}),u=a.length,a.sort(L);u--;)a[u]=a[u].c;return a},G.tap=function(n,t){return t(n),n},G.throttle=function(n,t,e){function o(){l=u,v&&(p=new Pt,f=n.apply(c,i))}var i,f,c,l,p=0,s=r,v=r;return e===a?s=a:e&&q[typeof e]&&(s="leading"in e?e.leading:s,v="trailing"in e?e.trailing:v),function(){var e=new Pt;!l&&!s&&(p=e);var r=t-(e-p);return i=arguments,c=this,0<r?l||(l=ie(o,r)):(ne(l),l=u,p=e,f=n.apply(c,i)),f}},G.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Dt(n);for(t=G.createCallback(t,e,1);++r<n;)u[r]=t(r);
return u},G.toArray=function(n){return n&&typeof n.length=="number"?tt(n):st(n)},G.union=function(n){return ke(n)||(arguments[0]=n?me.call(n):Qt),St(te.apply(Qt,arguments))},G.uniq=St,G.unzip=At,G.values=st,G.where=yt,G.without=function(n){return Ct(n,me.call(arguments,1))},G.wrap=function(n,t){return function(){var e=[n];return ae.apply(e,arguments),t.apply(this,e)}},G.zip=function(n){return n?At(arguments):[]},G.zipObject=$t,G.chain=G,G.collect=mt,G.drop=It,G.each=bt,G.extend=U,G.methods=ut,G.object=$t,G.select=yt,G.tail=It,G.unique=St,Tt(G),G.clone=rt,G.cloneDeep=function(n,t,e){return rt(n,r,t,e)
},G.contains=vt,G.escape=function(n){return n==u?"":Jt(n).replace(j,X)},G.every=gt,G.find=ht,G.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=G.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},G.findKey=function(n,t,e){var r;return t=G.createCallback(t,e),P(n,function(n,e,u){return t(n,e,u)?(r=e,a):void 0}),r},G.has=function(n,t){return n?ue.call(n,t):a},G.identity=Rt,G.indexOf=Et,G.isArguments=function(n){return fe.call(n)==O},G.isArray=ke,G.isBoolean=function(n){return n===r||n===a||fe.call(n)==I
},G.isDate=function(n){return n?typeof n=="object"&&fe.call(n)==N:a},G.isElement=function(n){return n?1===n.nodeType:a},G.isEmpty=function(n){var t=r;if(!n)return t;var e=fe.call(n),u=n.length;return e==E||e==R||e==O||e==B&&typeof u=="number"&&it(n.splice)?!u:(P(n,function(){return t=a}),t)},G.isEqual=ot,G.isFinite=function(n){return pe(n)&&!se(parseFloat(n))},G.isFunction=it,G.isNaN=function(n){return ct(n)&&n!=+n},G.isNull=function(n){return n===u},G.isNumber=ct,G.isObject=ft,G.isPlainObject=f,G.isRegExp=function(n){return n?typeof n=="object"&&fe.call(n)==F:a
},G.isString=lt,G.isUndefined=function(n){return typeof n=="undefined"},G.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?ge(0,r+e):ye(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},G.mixin=Tt,G.noConflict=function(){return o._=Xt,this},G.parseInt=zt,G.random=function(n,t){return n==u&&t==u&&(t=1),n=+n||0,t==u&&(t=n,n=0),n+ee(be()*((+t||0)-n+1))},G.reduce=kt,G.reduceRight=wt,G.result=function(n,t){var r=n?n[t]:e;return it(r)?n[t]():r},G.runInContext=t,G.size=function(n){var t=n?n.length:0;

View File

@@ -182,6 +182,7 @@
*
* @name _
* @constructor
* @alias chain
* @category Chaining
* @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance.
@@ -4275,6 +4276,7 @@
lodash.zip = zip;
// add aliases
lodash.chain = chain;
lodash.collect = map;
lodash.drop = rest;
lodash.each = forEach;
@@ -4348,8 +4350,6 @@
/*--------------------------------------------------------------------------*/
lodash.chain = chain;
/**
* The semantic version number.
*

View File

@@ -26,10 +26,10 @@ return mt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},t.min=function(n,t,r){va
u[t]=[o,n[o]]}return u},t.partial=function(n){return e(n,Bt.call(arguments,1))},t.pick=function(n){for(var t=-1,r=ht.apply(ct,Bt.call(arguments,1)),e=r.length,u={};++t<e;){var o=r[t];o in n&&(u[o]=n[o])}return u},t.pluck=N,t.range=function(n,t,r){n=+n||0,r=+r||1,null==t&&(t=n,n=0);var e=-1;t=Et(0,vt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},t.reject=function(n,t,r){return t=P(t,r),A(n,function(n,r,e){return!t(n,r,e)})},t.rest=$,t.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);
return O(n,function(n){var r=yt(Nt()*(++t+1));e[t]=e[r],e[r]=n}),e},t.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);for(t=P(t,e),O(n,function(n,r,e){i[++u]={a:t(n,r,e),b:u,c:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].c;return i},t.tap=function(n,t){return t(n),n},t.throttle=function(n,t){function r(){a=new Date,i=null,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,l=t-(f-a);return e=arguments,o=this,0<l?i||(i=bt(r,l)):(gt(i),i=null,a=f,u=n.apply(o,e)),u
}},t.times=function(n,t,r){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=t.call(r,e);return u},t.toArray=function(n){return Ft(n)?Bt.call(n):n&&typeof n.length=="number"?E(n):d(n)},t.union=function(n){return Ft(n)||(arguments[0]=n?Bt.call(n):ct),z(ht.apply(ct,arguments))},t.uniq=z,t.values=d,t.where=F,t.without=function(n){return R(n,Bt.call(arguments,1))},t.wrap=function(n,t){return function(){var r=[n];return _t.apply(r,arguments),t.apply(this,r)}},t.zip=function(n){for(var t=-1,r=n?S(N(arguments,"length")):0,e=Array(0>r?0:r);++t<r;)e[t]=N(arguments,t);
return e},t.collect=E,t.drop=$,t.each=O,t.extend=c,t.methods=s,t.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},t.select=A,t.tail=$,t.unique=z,t.clone=function(n){return m(n)?Ft(n)?Bt.call(n):c({},n):n},t.contains=j,t.escape=function(n){return null==n?"":(n+"").replace(Y,o)},t.every=w,t.find=x,t.findWhere=function(n,t){return F(n,t,!0)},t.has=function(n,t){return n?mt.call(n,t):!1},t.identity=U,t.indexOf=T,t.isArguments=l,t.isArray=Ft,t.isBoolean=function(n){return!0===n||!1===n||dt.call(n)==rt
return e},t.chain=function(n){return n=new i(n),n.__chain__=!0,n},t.collect=E,t.drop=$,t.each=O,t.extend=c,t.methods=s,t.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},t.select=A,t.tail=$,t.unique=z,t.clone=function(n){return m(n)?Ft(n)?Bt.call(n):c({},n):n},t.contains=j,t.escape=function(n){return null==n?"":(n+"").replace(Y,o)},t.every=w,t.find=x,t.findWhere=function(n,t){return F(n,t,!0)},t.has=function(n,t){return n?mt.call(n,t):!1},t.identity=U,t.indexOf=T,t.isArguments=l,t.isArray=Ft,t.isBoolean=function(n){return!0===n||!1===n||dt.call(n)==rt
},t.isDate=function(n){return n?typeof n=="object"&&dt.call(n)==et:!1},t.isElement=function(n){return n?1===n.nodeType:!1},t.isEmpty=g,t.isEqual=h,t.isFinite=function(n){return At(n)&&!xt(parseFloat(n))},t.isFunction=y,t.isNaN=function(n){return _(n)&&n!=+n},t.isNull=function(n){return null===n},t.isNumber=_,t.isObject=m,t.isRegExp=function(n){return!(!n||!ft[typeof n])&&dt.call(n)==it},t.isString=b,t.isUndefined=function(n){return typeof n=="undefined"},t.lastIndexOf=function(n,t,r){var e=n?n.length:0;
for(typeof r=="number"&&(e=(0>r?Et(0,e+r):St(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},t.mixin=V,t.noConflict=function(){return n._=pt,this},t.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+yt(Nt()*((+t||0)-n+1))},t.reduce=B,t.reduceRight=k,t.result=function(n,t){var r=n?n[t]:null;return y(r)?n[t]():r},t.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Rt(n).length},t.some=q,t.sortedIndex=I,t.template=function(n,r,e){n||(n=""),e=p({},e,t.templateSettings);
var o=0,i="__p+='",a=e.variable;n.replace(RegExp((e.escape||X).source+"|"+(e.interpolate||X).source+"|"+(e.evaluate||X).source+"|$","g"),function(t,r,e,a,f){return i+=n.slice(o,f).replace(Z,u),r&&(i+="'+_['escape']("+r+")+'"),a&&(i+="';"+a+";__p+='"),e&&(i+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+t.length,t}),i+="';\n",a||(a="obj",i="with("+a+"||{}){"+i+"}"),i="function("+a+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+i+"return __p}";try{var f=Function("_","return "+i)(t)
}catch(l){throw l.source=i,l}return r?f(r):(f.source=i,f)},t.unescape=function(n){return null==n?"":(n+"").replace(Q,f)},t.uniqueId=function(n){var t=++J+"";return n?n+t:t},t.all=w,t.any=q,t.detect=x,t.foldl=B,t.foldr=k,t.include=j,t.inject=B,t.first=D,t.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=P(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return Bt.call(n,Et(0,u-e))}},t.take=D,t.head=D,t.chain=function(n){return n=new i(n),n.__chain__=!0,n
},t.VERSION="1.2.1",V(t),t.prototype.chain=function(){return this.__chain__=!0,this},t.prototype.value=function(){return this.__wrapped__},O("pop push reverse shift sort splice unshift".split(" "),function(n){var r=ct[n];t.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),!qt.spliceObjects&&0===n.length&&delete n[0],this}}),O(["concat","join","slice"],function(n){var r=ct[n];t.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new i(n),n.__chain__=!0),n
}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=t, define(function(){return t})):W&&!W.nodeType?G?(G.exports=t)._=t:W._=t:n._=t})(this);
}catch(l){throw l.source=i,l}return r?f(r):(f.source=i,f)},t.unescape=function(n){return null==n?"":(n+"").replace(Q,f)},t.uniqueId=function(n){var t=++J+"";return n?n+t:t},t.all=w,t.any=q,t.detect=x,t.foldl=B,t.foldr=k,t.include=j,t.inject=B,t.first=D,t.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=P(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return Bt.call(n,Et(0,u-e))}},t.take=D,t.head=D,t.VERSION="1.2.1",V(t),t.prototype.chain=function(){return this.__chain__=!0,this
},t.prototype.value=function(){return this.__wrapped__},O("pop push reverse shift sort splice unshift".split(" "),function(n){var r=ct[n];t.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),!qt.spliceObjects&&0===n.length&&delete n[0],this}}),O(["concat","join","slice"],function(n){var r=ct[n];t.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new i(n),n.__chain__=!0),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=t, define(function(){return t
})):W&&!W.nodeType?G?(G.exports=t)._=t:W._=t:n._=t})(this);

View File

@@ -280,6 +280,7 @@
*
* @name _
* @constructor
* @alias chain
* @category Chaining
* @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance.
@@ -5375,6 +5376,7 @@
lodash.zipObject = zipObject;
// add aliases
lodash.chain = lodash;
lodash.collect = map;
lodash.drop = rest;
lodash.each = forEach;

View File

@@ -95,7 +95,7 @@
});
/** List of all methods */
var allMethods = lodashMethods.concat('chain', 'findWhere');
var allMethods = lodashMethods.concat('findWhere');
/** List of "Arrays" category methods */
var arraysMethods = [