mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
Ensure _.merge doesn't iterate over a passed callback arg.
Former-commit-id: 2ed55922c2f5b4e47ac7e9763f3d76b4bec142da
This commit is contained in:
8
dist/lodash.js
vendored
8
dist/lodash.js
vendored
@@ -1751,9 +1751,11 @@
|
||||
// using their `callback` arguments, `index|key` and `collection`
|
||||
if (typeof deepIndicator != 'number') {
|
||||
length = args.length;
|
||||
callback = typeof (callback = args[length - 2]) == 'function'
|
||||
? createCallback(callback, args[--length], 2)
|
||||
: (typeof (callback = args[length - 1]) == 'function' && callback);
|
||||
if (typeof args[length - 2] == 'function') {
|
||||
callback = createCallback(args[--length - 1], args[length--], 2);
|
||||
} else if (typeof args[length - 1] == 'function') {
|
||||
callback = args[--length];
|
||||
}
|
||||
}
|
||||
}
|
||||
while (++index < length) {
|
||||
|
||||
2
dist/lodash.min.js
vendored
2
dist/lodash.min.js
vendored
@@ -11,7 +11,7 @@
|
||||
c||(a=n)}if(u=w(a)){var l=_t.call(a);if(!zt[l])return a;var p=Qt(a)}if(!u||!r)return u&&!c?p?s(a):Zt({},a):a;switch(u=Pt[l],l){case kt:case Nt:return c?a:new u(+a);case Rt:case Dt:return c?a:new u(a);case Ft:return c?a:u(a.source,ot.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=p?u(a.length):{},p&&(yt.call(n,"index")&&(a.index=n.index),yt.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(p?N:Lt)(c?a:n,function(n,u){a[u]=y(n,r,e,t,o,i)}),a}function m(n){var t=[];
|
||||
return Jt(n,function(n,r){b(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=Wt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function d(n,r,e,u,o,i,a){if(e){e=typeof u=="undefined"?e:f(e,u,2);var c=e(n,r);if(typeof c!="undefined")return!!c}if(n===r)return 0!==n||1/n==1/r;u=typeof n;var l=typeof r;if(n===n&&(!n||"function"!=u&&"object"!=u)&&(!r||"function"!=l&&"object"!=l))return!1;if(null==n||null==r)return n===r;if(l=_t.call(n),u=_t.call(r),l==St&&(l=$t),u==St&&(u=$t),l!=u)return!1;
|
||||
switch(l){case kt:case Nt:return+n==+r;case Rt:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case Ft:case Dt:return n==r+""}if(u=l==qt,!u){if(n.__wrapped__||r.__wrapped__)return d(n.__wrapped__||n,r.__wrapped__||r,e,t,o,i,a);if(l!=$t)return!1;var l=n.constructor,p=r.constructor;if(l!=p&&(!b(l)||!(l instanceof l&&b(p)&&p instanceof p)))return!1}for(i||(i=[]),a||(a=[]),l=i.length;l--;)if(i[l]==n)return a[l]==r;var s=0,c=!0;if(i.push(n),a.push(r),u){if(s=r.length,c=o==Y||s==n.length)for(;s--&&(c=d(n[s],r[s],e,t,o,i,a)););return c
|
||||
}return Jt(r,function(r,u,f){return yt.call(f,u)?(s++,c=yt.call(n,u)&&d(n[u],r,e,t,o,i,a)):void 0}),c&&o!=Y&&Jt(n,function(n,t,r){return yt.call(r,t)?c=-1<--s:void 0}),c}function b(n){return typeof n=="function"}function w(n){return n?Ct[typeof n]:!1}function j(n){return typeof n=="number"||_t.call(n)==Rt}function x(n){return typeof n=="string"||_t.call(n)==Dt}function A(n,t,r){var e=arguments,u=0,o=2;if(!w(n))return n;if(r===Y)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length,i=typeof(i=e[o-2])=="function"?f(i,e[--o],2):typeof(i=e[o-1])=="function"&&i);
|
||||
}return Jt(r,function(r,u,f){return yt.call(f,u)?(s++,c=yt.call(n,u)&&d(n[u],r,e,t,o,i,a)):void 0}),c&&o!=Y&&Jt(n,function(n,t,r){return yt.call(r,t)?c=-1<--s:void 0}),c}function b(n){return typeof n=="function"}function w(n){return n?Ct[typeof n]:!1}function j(n){return typeof n=="number"||_t.call(n)==Rt}function x(n){return typeof n=="string"||_t.call(n)==Dt}function A(n,t,r){var e=arguments,u=0,o=2;if(!w(n))return n;if(r===Y)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length,"function"==typeof e[o-2]?i=f(e[--o-1],e[o--],2):"function"==typeof e[o-1]&&(i=e[--o]));
|
||||
for(;++u<o;)(Qt(e[u])?N:Lt)(e[u],function(t,r){var e,u,o=t,f=n[r];if(t&&((u=Qt(t))||tr(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];break}e||(f=u?Qt(f)?f:[]:tr(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=A(f,t,Y,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function O(n){for(var t=-1,r=Wt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function E(n,t,r){var e=-1,u=n?n.length:0,o=!1;return r=(0>r?At(0,u+r):r)||0,typeof u=="number"?o=-1<(x(n)?n.indexOf(t,r):z(n,t,r)):Ht(n,function(n){return++e<r?void 0:!(o=n===t)
|
||||
}),o}function S(n,t,r){var e=!0;if(t=f(t,r),Qt(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Ht(n,function(n,r,u){return e=!!t(n,r,u)});return e}function q(n,t,r){var e=[];if(t=f(t,r),Qt(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else Ht(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function k(n,t,r){var e;return t=f(t,r),N(n,function(n,r,u){return t(n,r,u)?(e=n,!1):void 0}),e}function N(n,t,r){if(t&&typeof r=="undefined"&&Qt(n)){r=-1;for(var e=n.length;++r<e&&!1!==t(n[r],r,n););}else Ht(n,t,r);
|
||||
return n}function R(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),Qt(n))for(;++e<u;)o[e]=t(n[e],e,n);else Ht(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function $(n,t,r){var e=-1/0,o=e;if(!t&&Qt(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&x(n)?u:f(t,r),Ht(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function F(n,t){return R(n,t+"")}function D(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),Qt(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)
|
||||
|
||||
Reference in New Issue
Block a user