mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Clarify a bit more the order is not guaranteed notes on object iteration.
Former-commit-id: bfe3033325bc941a03948fe41056634663a10989
This commit is contained in:
20
dist/lodash.compat.js
vendored
20
dist/lodash.compat.js
vendored
@@ -1706,7 +1706,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
* // => ['one', 'two', 'three'] (order is not guaranteed)
|
||||
* // => ['one', 'two', 'three'] (property order is not guaranteed across environments)
|
||||
*/
|
||||
var keys = !nativeKeys ? shimKeys : function(object) {
|
||||
if (!isObject(object)) {
|
||||
@@ -1969,7 +1969,7 @@
|
||||
* _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
|
||||
* return num % 2 == 0;
|
||||
* });
|
||||
* // => 'b' (order is not guaranteed)
|
||||
* // => 'b' (property order is not guaranteed across environments)
|
||||
*/
|
||||
function findKey(object, callback, thisArg) {
|
||||
var result;
|
||||
@@ -2042,7 +2042,7 @@
|
||||
* _.forIn(new Dog('Dagny'), function(value, key) {
|
||||
* console.log(key);
|
||||
* });
|
||||
* // => logs 'bark' and 'name' (order is not guaranteed)
|
||||
* // => logs 'bark' and 'name' (property order is not guaranteed across environments)
|
||||
*/
|
||||
var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, {
|
||||
'useHas': false
|
||||
@@ -2110,7 +2110,7 @@
|
||||
* _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
|
||||
* console.log(key);
|
||||
* });
|
||||
* // => logs '0', '1', and 'length' (order is not guaranteed)
|
||||
* // => logs '0', '1', and 'length' (property order is not guaranteed across environments)
|
||||
*/
|
||||
var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions);
|
||||
|
||||
@@ -2729,7 +2729,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.pairs({ 'moe': 30, 'larry': 40 });
|
||||
* // => [['moe', 30], ['larry', 40]] (order is not guaranteed)
|
||||
* // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments)
|
||||
*/
|
||||
function pairs(object) {
|
||||
var index = -1,
|
||||
@@ -2857,7 +2857,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.values({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
* // => [1, 2, 3] (order is not guaranteed)
|
||||
* // => [1, 2, 3] (property order is not guaranteed across environments)
|
||||
*/
|
||||
function values(object) {
|
||||
var index = -1,
|
||||
@@ -3242,7 +3242,7 @@
|
||||
* // => logs each number and returns '1,2,3'
|
||||
*
|
||||
* _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
* // => logs each number value and returns the object (order is not guaranteed)
|
||||
* // => logs each number and returns the object (property order is not guaranteed across environments)
|
||||
*/
|
||||
function forEach(collection, callback, thisArg) {
|
||||
if (callback && typeof thisArg == 'undefined' && isArray(collection)) {
|
||||
@@ -3440,7 +3440,7 @@
|
||||
* // => [3, 6, 9]
|
||||
*
|
||||
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
|
||||
* // => [3, 6, 9] (order is not guaranteed)
|
||||
* // => [3, 6, 9] (property order is not guaranteed across environments)
|
||||
*
|
||||
* var stooges = [
|
||||
* { 'name': 'moe', 'age': 40 },
|
||||
@@ -5320,9 +5320,7 @@
|
||||
var isCalled = trailing && (!leading || callCount > 1);
|
||||
clear();
|
||||
if (isCalled) {
|
||||
if (maxWait !== false) {
|
||||
lastCalled = +new Date;
|
||||
}
|
||||
lastCalled = +new Date;
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
};
|
||||
|
||||
2
dist/lodash.compat.min.js
vendored
2
dist/lodash.compat.min.js
vendored
@@ -22,7 +22,7 @@ r+="}"}return(n.b||$e.nonEnumArgs)&&(r+="}"),r+=n.c+";return E",t=t("d,j,k,m,o,p
|
||||
}}else t=!t&&_t(n)?u:_.createCallback(t,e,3),Ue(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,o=n)});return o}function It(n,t,e,r){var u=3>arguments.length;if(t=Y(t,r,4),ze(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Ue(n,function(n,r,o){e=u?(u=b,n):t(e,n,r,o)});return e}function Bt(n,t,e,r){var u=3>arguments.length;return t=Y(t,r,4),Ot(n,function(n,r,o){e=u?(u=b,n):t(e,n,r,o)}),e}function Pt(n,t,e){var r;if(t=_.createCallback(t,e,3),ze(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Ue(n,function(n,e,u){return!(r=t(n,e,u))
|
||||
});return!!r}function Nt(n){var r=-1,u=lt(),o=n?n.length:0,i=Z(arguments,m,m,1),f=[],c=o>=E&&u===t;if(c){var l=a(i);l?(u=e,i=l):c=b}for(;++r<o;)l=n[r],0>u(i,l)&&f.push(l);return c&&g(i),f}function Rt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=d){var o=-1;for(t=_.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,r==d||e)return n[0];return h(n,0,Ae(Se(0,r),u))}}function Ft(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?Se(0,u+r):r||0}else if(r)return r=$t(n,e),n[r]===e?r:-1;
|
||||
return n?t(n,e,r):-1}function Dt(n,t,e){if(typeof t!="number"&&t!=d){var r=0,u=-1,o=n?n.length:0;for(t=_.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=t==d||e?1:Se(0,t);return h(n,r)}function $t(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?_.createCallback(e,r,1):Gt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function zt(n,t,e,r){return typeof t!="boolean"&&t!=d&&(r=e,e=r&&r[t]===n?y:t,t=b),e!=d&&(e=_.createCallback(e,r,3)),ut(n,t,e)}function Lt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?At(rr(n,"length")):0,r=Ht(0>e?0:e);++t<e;)r[t]=rr(n,t);
|
||||
return r}function Tt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function qt(n,t){return at(n,17,Pe.call(arguments,2),d,t)}function Kt(n,t,e){function r(){o(),(h||p!==t)&&(l=+new Vt,i=n.apply(f,a))}function u(){var t=h&&(!v||1<c);o(),t&&(p!==false&&(l=+new Vt),i=n.apply(f,a))}function o(){le(s),le(g),c=0,s=g=d}var a,i,f,c=0,l=0,p=b,s=d,g=d,h=m;if(!mt(n))throw new ee;if(t=Se(0,t||0),e===m)var v=m,h=b;else dt(e)&&(v=e.leading,p="maxWait"in e&&Se(t,e.maxWait||0),h="trailing"in e?e.trailing:h);
|
||||
return r}function Tt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function qt(n,t){return at(n,17,Pe.call(arguments,2),d,t)}function Kt(n,t,e){function r(){o(),(h||p!==t)&&(l=+new Vt,i=n.apply(f,a))}function u(){var t=h&&(!v||1<c);o(),t&&(l=+new Vt,i=n.apply(f,a))}function o(){le(s),le(g),c=0,s=g=d}var a,i,f,c=0,l=0,p=b,s=d,g=d,h=m;if(!mt(n))throw new ee;if(t=Se(0,t||0),e===m)var v=m,h=b;else dt(e)&&(v=e.leading,p="maxWait"in e&&Se(t,e.maxWait||0),h="trailing"in e?e.trailing:h);
|
||||
return function(){if(a=arguments,f=this,c++,le(g),p===false)v&&2>c&&(i=n.apply(f,a));else{var e=+new Vt;!s&&!v&&(l=e);var o=p-(e-l);0<o?s||(s=de(r,o)):(le(s),s=d,l=e,i=n.apply(f,a))}return t!==p&&(g=de(u,t)),i}}function Wt(n){if(!mt(n))throw new ee;var t=Pe.call(arguments,1);return de(function(){n.apply(y,t)},1)}function Gt(n){return n}function Jt(n,t){var e=n,r=!t||mt(e);t||(e=w,t=n,n=_),Et(vt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return ve.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:new e(r)
|
||||
})})}function Mt(){return this.__wrapped__}r=r?et.defaults(n.Object(),r,et.pick(n,z)):n;var Ht=r.Array,Ut=r.Boolean,Vt=r.Date,Qt=r.Function,Xt=r.Math,Yt=r.Number,Zt=r.Object,ne=r.RegExp,te=r.String,ee=r.TypeError,re=[],ue=r.Error.prototype,oe=Zt.prototype,ae=te.prototype,ie=r._,fe=ne("^"+te(oe.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ce=Xt.ceil,le=r.clearTimeout,pe=fe.test(pe=Zt.defineProperty)&&pe,se=Xt.floor,ge=fe.test(ge=Zt.getPrototypeOf)&&ge,he=oe.hasOwnProperty,ve=re.push,ye=oe.propertyIsEnumerable,me=r.setImmediate,de=r.setTimeout,be=re.splice,_e=oe.toString,we=re.unshift,je=fe.test(je=_e.bind)&&je,ke=fe.test(ke=Zt.create)&&ke,xe=fe.test(xe=Ht.isArray)&&xe,Ce=r.isFinite,Ee=r.isNaN,Oe=fe.test(Oe=Zt.keys)&&Oe,Se=Xt.max,Ae=Xt.min,Ie=r.parseInt,Be=Xt.random,Pe=re.slice,Ne=fe.test(r.attachEvent),Re=je&&!/\n|true/.test(je+Ne),Fe={};
|
||||
Fe[q]=Ht,Fe[K]=Ut,Fe[W]=Vt,Fe[J]=Qt,Fe[H]=Zt,Fe[M]=Yt,Fe[U]=ne,Fe[V]=te;var De={};De[q]=De[W]=De[M]={constructor:m,toLocaleString:m,toString:m,valueOf:m},De[K]=De[V]={constructor:m,toString:m,valueOf:m},De[G]=De[J]=De[U]={constructor:m,toString:m},De[H]={constructor:m},function(){for(var n=L.length;n--;){var t,e=L[n];for(t in De)he.call(De,t)&&!he.call(De[t],e)&&(De[t][e]=b)}}(),w.prototype=_.prototype;var $e=_.support={};!function(){function n(){this.x=1}var t={0:1,length:1},e=[];n.prototype={valueOf:1};
|
||||
|
||||
20
dist/lodash.js
vendored
20
dist/lodash.js
vendored
@@ -1398,7 +1398,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
* // => ['one', 'two', 'three'] (order is not guaranteed)
|
||||
* // => ['one', 'two', 'three'] (property order is not guaranteed across environments)
|
||||
*/
|
||||
var keys = !nativeKeys ? shimKeys : function(object) {
|
||||
if (!isObject(object)) {
|
||||
@@ -1645,7 +1645,7 @@
|
||||
* _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
|
||||
* return num % 2 == 0;
|
||||
* });
|
||||
* // => 'b' (order is not guaranteed)
|
||||
* // => 'b' (property order is not guaranteed across environments)
|
||||
*/
|
||||
function findKey(object, callback, thisArg) {
|
||||
var result;
|
||||
@@ -1718,7 +1718,7 @@
|
||||
* _.forIn(new Dog('Dagny'), function(value, key) {
|
||||
* console.log(key);
|
||||
* });
|
||||
* // => logs 'bark' and 'name' (order is not guaranteed)
|
||||
* // => logs 'bark' and 'name' (property order is not guaranteed across environments)
|
||||
*/
|
||||
var forIn = function(collection, callback, thisArg) {
|
||||
var index, iterable = collection, result = iterable;
|
||||
@@ -1793,7 +1793,7 @@
|
||||
* _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
|
||||
* console.log(key);
|
||||
* });
|
||||
* // => logs '0', '1', and 'length' (order is not guaranteed)
|
||||
* // => logs '0', '1', and 'length' (property order is not guaranteed across environments)
|
||||
*/
|
||||
var forOwn = function(collection, callback, thisArg) {
|
||||
var index, iterable = collection, result = iterable;
|
||||
@@ -2419,7 +2419,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.pairs({ 'moe': 30, 'larry': 40 });
|
||||
* // => [['moe', 30], ['larry', 40]] (order is not guaranteed)
|
||||
* // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments)
|
||||
*/
|
||||
function pairs(object) {
|
||||
var index = -1,
|
||||
@@ -2547,7 +2547,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.values({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
* // => [1, 2, 3] (order is not guaranteed)
|
||||
* // => [1, 2, 3] (property order is not guaranteed across environments)
|
||||
*/
|
||||
function values(object) {
|
||||
var index = -1,
|
||||
@@ -2929,7 +2929,7 @@
|
||||
* // => logs each number and returns '1,2,3'
|
||||
*
|
||||
* _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
* // => logs each number value and returns the object (order is not guaranteed)
|
||||
* // => logs each number and returns the object (property order is not guaranteed across environments)
|
||||
*/
|
||||
function forEach(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
@@ -3126,7 +3126,7 @@
|
||||
* // => [3, 6, 9]
|
||||
*
|
||||
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
|
||||
* // => [3, 6, 9] (order is not guaranteed)
|
||||
* // => [3, 6, 9] (property order is not guaranteed across environments)
|
||||
*
|
||||
* var stooges = [
|
||||
* { 'name': 'moe', 'age': 40 },
|
||||
@@ -5017,9 +5017,7 @@
|
||||
var isCalled = trailing && (!leading || callCount > 1);
|
||||
clear();
|
||||
if (isCalled) {
|
||||
if (maxWait !== false) {
|
||||
lastCalled = now();
|
||||
}
|
||||
lastCalled = now();
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
};
|
||||
|
||||
2
dist/lodash.min.js
vendored
2
dist/lodash.min.js
vendored
@@ -22,7 +22,7 @@ return n}function Et(n,t,r){var e=n?n.length:0;if(typeof e!="number")var u=qr(n)
|
||||
});return o}function At(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Ht(e);++r<e;)u[r]=n[r][t];return u||It(n,t)}function Nt(n,t,r,e){if(!n)return r;var u=3>arguments.length;t=rt(t,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n);else d(n,function(n,e,o){r=u?(u=_,n):t(r,n,e,o)});return r}function Rt(n,t,r,e){var u=3>arguments.length;return t=rt(t,e,4),Et(n,function(n,e,o){r=u?(u=_,n):t(r,n,e,o)}),r}function Bt(n,t,r){var e;t=Z.createCallback(t,r,3),r=-1;
|
||||
var u=n?n.length:0;if(typeof u=="number")for(;++r<u&&!(e=t(n[r],r,n)););else d(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function $t(n){var e=-1,u=lt(),o=n?n.length:0,a=et(arguments,y,y,1),f=[],c=o>=k&&u===t;if(c){var l=i(a);l?(u=r,a=l):c=_}for(;++e<o;)l=n[e],0>u(a,l)&&f.push(l);return c&&s(a),f}function Dt(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=m){var o=-1;for(t=Z.createCallback(t,r,3);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==m||r)return n[0];return v(n,0,Sr(Ir(0,e),u))}}function Ft(n,r,e){if(typeof e=="number"){var u=n?n.length:0;
|
||||
e=0>e?Ir(0,u+e):e||0}else if(e)return e=zt(n,r),n[e]===r?e:-1;return n?t(n,r,e):-1}function Tt(n,t,r){if(typeof t!="number"&&t!=m){var e=0,u=-1,o=n?n.length:0;for(t=Z.createCallback(t,r,3);++u<o&&t(n[u],u,n);)e++}else e=t==m||r?1:Ir(0,t);return v(n,e)}function zt(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?Z.createCallback(r,e,1):Ut,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function qt(n,t,r,e){return typeof t!="boolean"&&t!=m&&(e=r,r=e&&e[t]===n?g:t,t=_),r!=m&&(r=Z.createCallback(r,e,3)),it(n,t,r)
|
||||
}function Wt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,r=n?St(At(n,"length")):0,e=Ht(0>r?0:r);++t<r;)e[t]=At(n,t);return e}function Pt(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:o&&(u[o[0]]=o[1])}return u}function Kt(n,t){return ft(n,17,Rr.call(arguments,2),m,t)}function Lt(n,t,r){function e(){o(),(h||p!==t)&&(l=gr(),a=n.apply(f,i))}function u(){var t=h&&(!g||1<c);o(),t&&(p!==false&&(l=gr()),a=n.apply(f,i))}function o(){cr(s),cr(v),c=0,s=v=m}var i,a,f,c=0,l=0,p=_,s=m,v=m,h=y;
|
||||
}function Wt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,r=n?St(At(n,"length")):0,e=Ht(0>r?0:r);++t<r;)e[t]=At(n,t);return e}function Pt(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:o&&(u[o[0]]=o[1])}return u}function Kt(n,t){return ft(n,17,Rr.call(arguments,2),m,t)}function Lt(n,t,r){function e(){o(),(h||p!==t)&&(l=gr(),a=n.apply(f,i))}function u(){var t=h&&(!g||1<c);o(),t&&(l=gr(),a=n.apply(f,i))}function o(){cr(s),cr(v),c=0,s=v=m}var i,a,f,c=0,l=0,p=_,s=m,v=m,h=y;
|
||||
if(!mt(n))throw new er;if(t=Ir(0,t||0),r===y)var g=y,h=_;else _t(r)&&(g=r.leading,p="maxWait"in r&&Ir(t,r.maxWait||0),h="trailing"in r?r.trailing:h);return function(){if(i=arguments,f=this,c++,cr(v),p===false)g&&2>c&&(a=n.apply(f,i));else{var r=gr();!s&&!g&&(l=r);var o=p-(r-l);0<o?s||(s=_r(e,o)):(cr(s),s=m,l=r,a=n.apply(f,i))}return t!==p&&(v=_r(u,t)),a}}function Mt(n){if(!mt(n))throw new er;var t=Rr.call(arguments,1);return _r(function(){n.apply(g,t)},1)}function Ut(n){return n}function Vt(n,t){var r=n,e=!t||mt(r);
|
||||
t||(r=nt,t=n,n=Z),Ot(gt(t),function(u){var o=n[u]=t[u];e&&(r.prototype[u]=function(){var t=this.__wrapped__,e=[t];return yr.apply(e,arguments),e=o.apply(n,e),t&&typeof t=="object"&&t===e?this:new r(e)})})}function Gt(){return this.__wrapped__}e=e?Y.defaults(n.Object(),e,Y.pick(n,F)):n;var Ht=e.Array,Jt=e.Boolean,Qt=e.Date,Xt=e.Function,Yt=e.Math,Zt=e.Number,nr=e.Object,tr=e.RegExp,rr=e.String,er=e.TypeError,ur=[],or=nr.prototype,ir=e._,ar=tr("^"+rr(or.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),fr=Yt.ceil,cr=e.clearTimeout,lr=ar.test(lr=nr.defineProperty)&&lr,pr=Yt.floor,sr=Xt.prototype.toString,vr=ar.test(vr=nr.getPrototypeOf)&&vr,hr=or.hasOwnProperty,gr=ar.test(gr=Qt.now)&&gr||function(){return+new Qt
|
||||
},yr=ur.push,mr=e.setImmediate,_r=e.setTimeout,br=ur.splice,dr=or.toString,wr=ur.unshift,jr=ar.test(jr=dr.bind)&&jr,kr=ar.test(kr=nr.create)&&kr,xr=ar.test(xr=Ht.isArray)&&xr,Cr=e.isFinite,Or=e.isNaN,Er=ar.test(Er=nr.keys)&&Er,Ir=Yt.max,Sr=Yt.min,Ar=e.parseInt,Nr=Yt.random,Rr=ur.slice,Br=ar.test(e.attachEvent),$r=jr&&!/\n|true/.test(jr+Br),Dr={};Dr[z]=Ht,Dr[q]=Jt,Dr[W]=Qt,Dr[P]=Xt,Dr[L]=nr,Dr[K]=Zt,Dr[M]=tr,Dr[U]=rr,nt.prototype=Z.prototype;var Fr=Z.support={};Fr.fastBind=jr&&!$r,Z.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Z}};
|
||||
|
||||
18
dist/lodash.underscore.js
vendored
18
dist/lodash.underscore.js
vendored
@@ -810,7 +810,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.keys({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
* // => ['one', 'two', 'three'] (order is not guaranteed)
|
||||
* // => ['one', 'two', 'three'] (property order is not guaranteed across environments)
|
||||
*/
|
||||
var keys = !nativeKeys ? shimKeys : function(object) {
|
||||
if (!isObject(object)) {
|
||||
@@ -1000,7 +1000,7 @@
|
||||
* _.forIn(new Dog('Dagny'), function(value, key) {
|
||||
* console.log(key);
|
||||
* });
|
||||
* // => logs 'bark' and 'name' (order is not guaranteed)
|
||||
* // => logs 'bark' and 'name' (property order is not guaranteed across environments)
|
||||
*/
|
||||
var forIn = function(collection, callback) {
|
||||
var index, iterable = collection, result = iterable;
|
||||
@@ -1031,7 +1031,7 @@
|
||||
* _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
|
||||
* console.log(key);
|
||||
* });
|
||||
* // => logs '0', '1', and 'length' (order is not guaranteed)
|
||||
* // => logs '0', '1', and 'length' (property order is not guaranteed across environments)
|
||||
*/
|
||||
var forOwn = function(collection, callback) {
|
||||
var index, iterable = collection, result = iterable;
|
||||
@@ -1499,7 +1499,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.pairs({ 'moe': 30, 'larry': 40 });
|
||||
* // => [['moe', 30], ['larry', 40]] (order is not guaranteed)
|
||||
* // => [['moe', 30], ['larry', 40]] (property order is not guaranteed across environments)
|
||||
*/
|
||||
function pairs(object) {
|
||||
var index = -1,
|
||||
@@ -1567,7 +1567,7 @@
|
||||
* @example
|
||||
*
|
||||
* _.values({ 'one': 1, 'two': 2, 'three': 3 });
|
||||
* // => [1, 2, 3] (order is not guaranteed)
|
||||
* // => [1, 2, 3] (property order is not guaranteed across environments)
|
||||
*/
|
||||
function values(object) {
|
||||
var index = -1,
|
||||
@@ -1903,7 +1903,7 @@
|
||||
* // => logs each number and returns '1,2,3'
|
||||
*
|
||||
* _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); });
|
||||
* // => logs each number value and returns the object (order is not guaranteed)
|
||||
* // => logs each number and returns the object (property order is not guaranteed across environments)
|
||||
*/
|
||||
function forEach(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
@@ -2054,7 +2054,7 @@
|
||||
* // => [3, 6, 9]
|
||||
*
|
||||
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
|
||||
* // => [3, 6, 9] (order is not guaranteed)
|
||||
* // => [3, 6, 9] (property order is not guaranteed across environments)
|
||||
*
|
||||
* var stooges = [
|
||||
* { 'name': 'moe', 'age': 40 },
|
||||
@@ -3670,9 +3670,7 @@
|
||||
var isCalled = trailing && (!leading || callCount > 1);
|
||||
clear();
|
||||
if (isCalled) {
|
||||
if (maxWait !== false) {
|
||||
lastCalled = +new Date;
|
||||
}
|
||||
lastCalled = +new Date;
|
||||
result = func.apply(thisArg, args);
|
||||
}
|
||||
};
|
||||
|
||||
4
dist/lodash.underscore.min.js
vendored
4
dist/lodash.underscore.min.js
vendored
@@ -16,8 +16,8 @@ if(!a&&!x(n))throw new TypeError;if(!o||a||f||c||!(Wr.fastBind||Or&&t.length))p=
|
||||
});return t}function I(n,r,t,e){var u=3>arguments.length;return r=a(r,e,4),k(n,function(n,e,i){t=u?(u=!1,n):r(t,n,e,i)}),t}function W(n,r,t){var e;r=K(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Kr(n,function(n,t,u){return(e=r(n,t,u))&&nr});return!!e}function z(n,r,t){return t&&j(r)?Y:(t?R:N)(n,r)}function C(n){for(var r=-1,t=g(),e=n.length,u=f(arguments,!0,!0,1),i=[];++r<e;){var o=n[r];0>t(u,o)&&i.push(o)}return i}function P(n,r,t){if(n){var e=0,u=n.length;
|
||||
if(typeof r!="number"&&null!=r){var i=-1;for(r=K(r,t,3);++i<u&&r(n[i],i,n);)e++}else if(e=r,null==e||t)return n[0];return Mr.call(n,0,Dr(kr(0,e),u))}}function U(n,t,e){if(typeof e=="number"){var u=n?n.length:0;e=0>e?kr(0,u+e):e||0}else if(e)return e=G(n,t),n[e]===t?e:-1;return n?r(n,t,e):-1}function V(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,i=n?n.length:0;for(r=K(r,t,3);++u<i&&r(n[u],u,n);)e++}else e=null==r||t?1:kr(0,r);return Mr.call(n,e)}function G(n,r,t,e){var u=0,i=n?n.length:u;for(t=t?K(t,e,1):Q,r=t(r);u<i;)e=u+i>>>1,t(n[e])<r?u=e+1:i=e;
|
||||
return u}function H(n,r,t,e){return typeof r!="boolean"&&null!=r&&(e=t,t=e&&e[r]===n?Y:r,r=!1),null!=t&&(t=K(t,e,3)),c(n,r,t)}function J(n,r){return s(n,17,Mr.call(arguments,2),null,r)}function K(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return function(r){return r[n]};var u=Pr(n);return function(r){for(var t=u.length,e=!1;t--&&(e=r[u[t]]===n[u[t]]););return e}}function L(n,r,t){var e,u,i,o=0,a=0,f=!1,l=null,c=null,p=!0;if(!x(n))throw new TypeError;if(r=kr(0,r||0),true===t)var s=!0,p=!1;
|
||||
else E(t)&&(s=t.leading,f="maxWait"in t&&kr(r,t.maxWait||0),p="trailing"in t?t.trailing:p);var v=function(){clearTimeout(l),clearTimeout(c),o=0,l=c=null},h=function(){var r=p&&(!s||1<o);v(),r&&(false!==f&&(a=+new Date),u=n.apply(i,e))},g=function(){v(),(p||f!==r)&&(a=+new Date,u=n.apply(i,e))};return function(){if(e=arguments,i=this,o++,clearTimeout(c),false===f)s&&2>o&&(u=n.apply(i,e));else{var t=+new Date;!l&&!s&&(a=t);var p=f-(t-a);0<p?l||(l=setTimeout(g,p)):(clearTimeout(l),l=null,a=t,u=n.apply(i,e))
|
||||
}return r!==f&&(c=setTimeout(h,r)),u}}function Q(n){return n}function X(n){B(b(n),function(r){var t=i[r]=n[r];i.prototype[r]=function(){var n=[this.__wrapped__];return Er.apply(n,arguments),n=t.apply(i,n),this.__chain__&&(n=new o(n),n.__chain__=!0),n}})}var Y,Z=0,nr={},rr=+new Date+"",tr=/($^)/,er=/['\n\r\t\u2028\u2029\\]/g,ur="[object Arguments]",ir="[object Array]",or="[object Boolean]",ar="[object Date]",fr="[object Number]",lr="[object Object]",cr="[object RegExp]",pr="[object String]",sr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},vr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},hr=sr[typeof exports]&&exports,gr=sr[typeof module]&&module&&module.exports==hr&&module,yr=sr[typeof global]&&global;
|
||||
else E(t)&&(s=t.leading,f="maxWait"in t&&kr(r,t.maxWait||0),p="trailing"in t?t.trailing:p);var v=function(){clearTimeout(l),clearTimeout(c),o=0,l=c=null},h=function(){var r=p&&(!s||1<o);v(),r&&(a=+new Date,u=n.apply(i,e))},g=function(){v(),(p||f!==r)&&(a=+new Date,u=n.apply(i,e))};return function(){if(e=arguments,i=this,o++,clearTimeout(c),false===f)s&&2>o&&(u=n.apply(i,e));else{var t=+new Date;!l&&!s&&(a=t);var p=f-(t-a);0<p?l||(l=setTimeout(g,p)):(clearTimeout(l),l=null,a=t,u=n.apply(i,e))}return r!==f&&(c=setTimeout(h,r)),u
|
||||
}}function Q(n){return n}function X(n){B(b(n),function(r){var t=i[r]=n[r];i.prototype[r]=function(){var n=[this.__wrapped__];return Er.apply(n,arguments),n=t.apply(i,n),this.__chain__&&(n=new o(n),n.__chain__=!0),n}})}var Y,Z=0,nr={},rr=+new Date+"",tr=/($^)/,er=/['\n\r\t\u2028\u2029\\]/g,ur="[object Arguments]",ir="[object Array]",or="[object Boolean]",ar="[object Date]",fr="[object Number]",lr="[object Object]",cr="[object RegExp]",pr="[object String]",sr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},vr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},hr=sr[typeof exports]&&exports,gr=sr[typeof module]&&module&&module.exports==hr&&module,yr=sr[typeof global]&&global;
|
||||
!yr||yr.global!==yr&&yr.window!==yr||(n=yr);var mr=[],_r=Object.prototype,dr=n._,br=RegExp("^"+(_r.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),wr=Math.ceil,jr=Math.floor,xr=_r.hasOwnProperty,Er=mr.push,Ar=_r.toString,Tr=mr.unshift,Or=br.test(Or=Ar.bind)&&Or,Sr=br.test(Sr=Object.create)&&Sr,Fr=br.test(Fr=Array.isArray)&&Fr,Nr=n.isFinite,Rr=n.isNaN,Br=br.test(Br=Object.keys)&&Br,kr=Math.max,Dr=Math.min,qr=Math.random,Mr=mr.slice,$r=br.test(n.attachEvent),Ir=Or&&!/\n|true/.test(Or+$r);
|
||||
o.prototype=i.prototype;var Wr={};!function(){var n={0:1,length:1};Wr.fastBind=Or&&!Ir,Wr.spliceObjects=(mr.splice.call(n,0,1),!n[0])}(1),i.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Sr||(v=function(n){if(E(n)){u.prototype=n;var r=new u;u.prototype=null}return r||{}}),m(arguments)||(m=function(n){return n&&typeof n=="object"?xr.call(n,"callee"):!1});var zr=Fr||function(n){return n&&typeof n=="object"?Ar.call(n)==ir:!1},Cr=function(n){var r,t=[];
|
||||
if(!n||!sr[typeof n])return t;for(r in n)xr.call(n,r)&&t.push(r);return t},Pr=Br?function(n){return E(n)?Br(n):[]}:Cr,Ur={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Vr=w(Ur),Gr=RegExp("("+Pr(Vr).join("|")+")","g"),Hr=RegExp("["+Pr(Ur).join("")+"]","g"),Jr=function(n,r){var t;if(!n||!sr[typeof n])return n;for(t in n)if(r(n[t],t,n)===nr)break;return n},Kr=function(n,r){var t;if(!n||!sr[typeof n])return n;for(t in n)if(xr.call(n,t)&&r(n[t],t,n)===nr)break;return n};x(/x/)&&(x=function(n){return typeof n=="function"&&"[object Function]"==Ar.call(n)
|
||||
|
||||
Reference in New Issue
Block a user