diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index dcc866ee4..6794893c6 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -104,10 +104,11 @@ /** Used to assign default `context` object properties */ var contextProps = [ - 'Array', 'ArrayBuffer', 'Boolean', 'Date', 'Error', 'Float64Array', 'Function', - 'Math', 'Number', 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', - 'document', 'isFinite', 'isNaN','parseInt', 'setTimeout', 'TypeError', - 'Uint8Array', 'window', 'WinRTError' + 'Array', 'ArrayBuffer', 'Boolean', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number', 'Object', + 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'document', 'isFinite', 'isNaN', + 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', + 'Uint16Array', 'Uint32Array', 'window', 'WinRTError' ]; /** Used to fix the JScript `[[DontEnum]]` bug */ @@ -654,7 +655,7 @@ /** Native method shortcuts */ var ArrayBuffer = isNative(ArrayBuffer = context.ArrayBuffer) && ArrayBuffer, - bufferSlice = isNative(bufferSlice = ArrayBuffer && (new ArrayBuffer).slice) && bufferSlice, + bufferSlice = isNative(bufferSlice = ArrayBuffer && new ArrayBuffer(0).slice) && bufferSlice, ceil = Math.ceil, clearTimeout = context.clearTimeout, Float64Array = isNative(Float64Array = context.Float64Array) && Float64Array, @@ -693,6 +694,18 @@ nativeParseInt = context.parseInt, nativeRandom = Math.random; + /** Used to lookup a built-in constructor by [[Class]] */ + var ctorByClass = {}; + ctorByClass[float32Class] = context.Float32Array; + ctorByClass[float64Class] = context.Float64Array; + ctorByClass[int8Class] = context.Int8Array; + ctorByClass[int16Class] = context.Int16Array; + ctorByClass[int32Class] = context.Int32Array; + ctorByClass[uint8Class] = context.Uint8Array; + ctorByClass[uint8ClampedClass] = context.Uint8ClampedArray; + ctorByClass[uint16Class] = context.Uint16Array; + ctorByClass[uint32Class] = context.Uint32Array; + /** Used to avoid iterating over non-enumerable properties in IE < 9 */ var nonEnumProps = {}; nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true }; @@ -827,15 +840,6 @@ */ support.argsClass = toString.call(arguments) == argsClass; - /** - * Detect if `arguments` objects are `Object` objects - * (all but Narwhal and Opera < 10.5). - * - * @memberOf _.support - * @type boolean - */ - support.argsObject = arguments.constructor == Object && !(arguments instanceof Array); - /** * Detect if `name` or `message` properties of `Error.prototype` are * enumerable by default (IE < 9, Safari < 5.1). @@ -1240,7 +1244,11 @@ case float32Class: case float64Class: case int8Class: case int16Class: case int32Class: case uint8Class: case uint8ClampedClass: case uint16Class: case uint32Class: - return value.subarray(0); + // Safari 5 mobile incorrectly has `Object` as the constructor + if (Ctor instanceof Ctor) { + Ctor = ctorByClass[className]; + } + return new Ctor(cloneBuffer(value.buffer)); case numberClass: case stringClass: @@ -1266,13 +1274,16 @@ return stackB[length]; } } - result = isArr ? Ctor(value.length) : Ctor(); + result = isArr ? Ctor(value.length) : new Ctor; } else { result = isArr ? slice(value) : baseAssign({}, value); } + if (className == argsClass || (!support.argsClass && isArguments(value))) { + result.length = value.length; + } // add array properties assigned by `RegExp#exec` - if (isArr) { + else if (isArr) { if (hasOwnProperty.call(value, 'index')) { result.index = value.index; } @@ -1340,8 +1351,7 @@ if (typeof func != 'function') { return identity; } - // exit early for no `thisArg` or already bound by `Function#bind` - if (typeof thisArg == 'undefined' || !('prototype' in func)) { + if (typeof thisArg == 'undefined') { return func; } var data = func[expando]; @@ -1357,7 +1367,7 @@ } if (!data) { // checks if `func` references the `this` keyword and stores the result - data = reThis.test(source); + data = reThis.test(source) || isNative(func); setData(func, data); } } @@ -1762,8 +1772,8 @@ return false; } var valClass = toString.call(value), - othClass = toString.call(other), valIsArg = valClass == argsClass, + othClass = toString.call(other), othIsArg = othClass == argsClass; if (valIsArg) { @@ -1782,6 +1792,10 @@ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal return +value == +other; + case errorClass: + // check properties instead of coercing to strings to support IE < 8 + return value.name === other.name && value.message === other.message; + case numberClass: // treat `NaN` vs. `NaN` as equal return (value != +value) @@ -1789,14 +1803,16 @@ // but treat `-0` vs. `+0` as not equal : (value == 0 ? (1 / value == 1 / other) : value == +other); - case errorClass: case regexpClass: case stringClass: - // coerce errors (http://es5.github.io/#x15.11.4.4) - // and regexes (http://es5.github.io/#x15.10.6.4) to strings - // treat string primitives and their corresponding object instances as equal + // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) + // treat string primitives and object instances as equal return value == String(other); } + if (!support.argsClass) { + valIsArg = isArguments(value); + othIsArg = isArguments(other); + } var isArr = arrayLikeClasses[valClass]; if (!isArr) { // exit for functions and DOM nodes @@ -1810,10 +1826,6 @@ if (valWrapped || othWrapped) { return baseIsEqual(valWrapped ? value.__wrapped__ : value, othWrapped ? other.__wrapped__ : other, callback, isWhere, stackA, stackB); } - if (!support.argsObject) { - valIsArg = isArguments(value); - othIsArg = isArguments(other); - } var hasValCtor = !valIsArg && hasOwnProperty.call(value, 'constructor'), hasOthCtor = !othIsArg && hasOwnProperty.call(other, 'constructor'); @@ -1846,7 +1858,7 @@ return stackB[length] == other; } } - result = true; + var index = -1; // add `value` and `other` to the stack of traversed objects stackA.push(value); @@ -1854,32 +1866,28 @@ // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { - // compare lengths to determine if a deep comparison is necessary var othLength = other.length; length = value.length; - result = othLength == length; - - if (result || isWhere) { - var othIndex = -1; + result = length == othLength; + if (result || (isWhere && othLength > length)) { // deep compare the contents, ignoring non-numeric properties - while (++othIndex < othLength) { - var othValue = other[othIndex]; - + while (++index < length) { + var valValue = value[index]; if (isWhere) { - var index = -1; - while (++index < length) { - result = baseIsEqual(value[index], othValue, callback, isWhere, stackA, stackB); + var othIndex = othLength; + while (othIndex--) { + result = baseIsEqual(valValue, other[othIndex], callback, isWhere, stackA, stackB); if (result) { break; } } } else { - var valValue = value[othIndex]; - result = callback ? callback(valValue, othValue, othIndex) : undefined; - result = typeof result == 'undefined' - ? baseIsEqual(valValue, othValue, callback, isWhere, stackA, stackB) - : !!result; + var othValue = other[index]; + result = callback ? callback(valValue, othValue, index) : undefined; + if (typeof result == 'undefined') { + result = baseIsEqual(valValue, othValue, callback, isWhere, stackA, stackB); + } } if (!result) { break; @@ -1888,42 +1896,40 @@ } } else { - var size = 0; + var valProps = keys(value), + othProps = keys(other); - // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` - // which, in this case, is more costly - baseForIn(other, function(othValue, key, other) { - if (hasOwnProperty.call(other, key)) { - result = false; - // count the number of properties - size++; - // deep compare each property value - if (hasOwnProperty.call(value, key)) { - var valValue = value[key]; + if (valIsArg) { + valProps.push('length'); + } + if (othIsArg) { + othProps.push('length'); + } + length = valProps.length; + result = length == othProps.length; + + if (result || isWhere) { + while (++index < length) { + var key = valProps[index]; + result = hasOwnProperty.call(other, key); + if (result) { + valValue = value[key]; + othValue = other[key]; result = callback ? callback(valValue, othValue, key) : undefined; - result = typeof result == 'undefined' - ? baseIsEqual(valValue, othValue, callback, isWhere, stackA, stackB) - : !!result; + if (typeof result == 'undefined') { + result = baseIsEqual(valValue, othValue, callback, isWhere, stackA, stackB); + } + } + if (!result) { + break; } - return result; } - }); - - if (result && !isWhere) { - // ensure both objects have the same number of properties - baseForIn(value, function(valValue, key, value) { - if (hasOwnProperty.call(value, key)) { - // `size` will be `-1` if `value` has more properties than `other` - result = --size > -1; - return result; - } - }); } } stackA.pop(); stackB.pop(); - return result; + return !!result; } /** @@ -5063,8 +5069,8 @@ * @category Collections * @param {Array|Object|string} collection The collection to iterate over. * @param {Array|Function|Object|string} [callback=identity] The function - * called per iteration. If a property name or object is provided it is - * used to create a "_.pluck" or "_.where" style callback respectively. + * called per iteration. If property name(s) or an object is provided it + * is used to create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `callback`. * @returns {Array} Returns the new sorted array. * @example @@ -8107,7 +8113,7 @@ var type = typeof func, isFunc = type == 'function'; - if (isFunc && (typeof thisArg == 'undefined' || !('prototype' in func))) { + if (isFunc && typeof thisArg == 'undefined') { return func; } if (isFunc || func == null) { @@ -8186,7 +8192,7 @@ while (length--) { var key = props[length]; if (!(hasOwnProperty.call(object, key) && - baseIsEqual(object[key], source[key], null, true))) { + baseIsEqual(source[key], object[key], null, true))) { return false; } } @@ -8892,9 +8898,9 @@ // some AMD build optimizers like r.js check for condition patterns like the following: if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - // Expose Lo-Dash to the global object even when an AMD loader is present in - // case Lo-Dash is loaded with a RequireJS shim config. - // See http://requirejs.org/docs/api.html#config-shim + // Expose Lo-Dash to the global object when an AMD loader is present to avoid + // errors in cases where Lo-Dash is loaded by a script tag and not intended + // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch root._ = _; // define as an anonymous module so, through path mapping, it can be diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index b743d3c0c..6a10a4762 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -4,68 +4,68 @@ * Build: `lodash -o ./dist/lodash.compat.js` */ ;(function(){function n(n,t){for(var r=-1,e=t.length,u=Array(e);++rt||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202>>0:0,u=ue(e);++ra(t,l)&&f.push(l);return f}function Tt(n,t){var r=-1,e=n,u=n?n.length:0;if(typeof u=="number"&&-1o?0:o>>>0);return Tt(n,function(n){var o=u?t:null!=n&&n[t];a[++e]=o?o.apply(n,r):m}),a}function Vt(n,t,r,e,u){var o=ar(t);return(o?jt:zt)(t,function(t,a,i){var l=t&&ar(t),f=t&&au(t),c=n[a];if(l||f){for(e||(e=[]),u||(u=[]),f=e.length;f--;)if(e[f]==t)return void(n[a]=u[f]);i=r?r(c,t,a,n,i):m,(f=typeof i!="undefined")||(i=l?ou(c)?c:[]:au(c)?c:{}),e.push(t),u.push(i),f||Vt(i,t,r,e,u),n[a]=i}else i=r?r(c,t,a,n,i):m,typeof i=="undefined"&&(i=t),(o||typeof i!="undefined")&&(n[a]=i) -}),n}function Jt(n,t){var r={};if(typeof t=="function")return Dt(n,function(n,e,u){t(n,e,u)&&(r[e]=n)}),r;for(var e=-1,u=t.length;++ei(s,g)&&((u||f)&&s.push(g),c.push(p)) -}return c}function Gt(n,t){for(var r=-1,e=t(n),u=e.length,o=ue(u);++re)return t;var u=typeof r[2];if("number"!=u&&"string"!=u||!r[3]||r[3][r[2]]!==r[1]||(e=2),3e||13e||8202r||13r||8202>>0:0,u=ue(e);++ra(t,l)&&f.push(l);return f}function Lt(n,t){var r=-1,e=n,u=n?n.length:0;if(typeof u=="number"&&-1l)for(;++fo?0:o>>>0);return Lt(n,function(n){var o=u?t:null!=n&&n[t];a[++e]=o?o.apply(n,r):m}),a}function Vt(n,t,r,e,u){var o=ar(t);return(o?jt:zt)(t,function(t,a,i){var l=t&&ar(t),f=t&&iu(t),c=n[a];if(l||f){for(e||(e=[]),u||(u=[]),f=e.length;f--;)if(e[f]==t)return void(n[a]=u[f]);i=r?r(c,t,a,n,i):m,(f=typeof i!="undefined")||(i=l?au(c)?c:[]:iu(c)?c:{}),e.push(t),u.push(i),f||Vt(i,t,r,e,u),n[a]=i}else i=r?r(c,t,a,n,i):m,typeof i=="undefined"&&(i=t),(o||typeof i!="undefined")&&(n[a]=i) +}),n}function Jt(n,t){var r={};if(typeof t=="function")return Dt(n,function(n,e,u){t(n,e,u)&&(r[e]=n)}),r;for(var e=-1,u=t.length;++ei(s,g)&&((u||f)&&s.push(g),c.push(p)) +}return c}function Gt(n,t){for(var r=-1,e=t(n),u=e.length,o=ue(u);++re)return t;var u=typeof r[2];if("number"!=u&&"string"!=u||!r[3]||r[3][r[2]]!==r[1]||(e=2),3o?0:o)}function gr(n,t,e){var u=n?n.length:0;if(typeof e=="number")e=0>e?Ze(u+e,0):e||0;else if(e)return e=mr(n,t),u&&n[e]===t?e:-1;return r(n,t,e)}function hr(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var u=e,o=0;for(t=q.createCallback(t,r,3);u--&&t(n[u],u,n);)o++}else o=null==t||r?1:t;return o=e-(o||0),dr(n,0,0>o?0:o)}function vr(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var u=e,o=0; for(t=q.createCallback(t,r,3);u--&&t(n[u],u,n);)o++}else if(o=t,null==o||r)return n?n[e-1]:m;return o=e-(o||0),dr(n,0>o?0:o)}function yr(n,t,r){if(typeof t!="number"&&null!=t){var e=-1,u=n?n.length:0,o=0;for(t=q.createCallback(t,r,3);++et?0:t;return dr(n,o)}function dr(n,t,r){var e=-1,u=n?n.length:0;for(t=null==t?0:+t||0,0>t?t=Ze(u+t,0):t>u&&(t=u),r=typeof r=="undefined"?u:+r||0,0>r?r=Ze(u+r,0):r>u&&(r=u),u=t>r?0:r-t,r=ue(u);++e>>1,r(n[e])r?0:r);++tr?Ze(e+r,0):r||0:0,typeof n=="string"||!ou(n)&&Kr(n)?ro&&(o=i)}else t=null==t&&Kr(n)?u:q.createCallback(t,r,3),Tt(n,function(n,r,u){r=t(n,r,u),(r>e||-1/0===r&&r===o)&&(e=r,o=n)});return o}function Rr(n,t){return Sr(n,ee(t))}function Fr(n,t,r,e){var u=3>arguments.length; -if(t=q.createCallback(t,e,4),ou(n)){var o=-1,a=n.length;for(u&&a&&(r=n[++o]);++oarguments.length;return t=q.createCallback(t,e,4),Wt(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function Lr(n){var t=-1,r=n&&n.length,e=ue(0>r?0:r>>>0);return Tt(n,function(n){var r=Xt(0,++t);e[t]=e[r],e[r]=n}),e}function Tr(n,t,r){var e;if((typeof t!="function"||typeof r!="undefined")&&(t=q.createCallback(t,r,3)),ou(n)){r=-1; -for(var u=n.length;++rarguments.length)return er(n,b,null,t);if(n)var r=n[A]?n[A][2]:n.length,e=dr(arguments,2),r=r-e.length;return er(n,b|x,r,t,e)}function Ur(n,t,r){function e(){var r=t-(pu()-f);0>=r||r>t?(i&&Ae(i),r=p,i=s=p=m,r&&(g=pu(),l=n.apply(c,a),s||i||(a=c=null))):s=Le(e,r)}function u(){s&&Ae(s),i=s=p=m,(v||h!==t)&&(g=pu(),l=n.apply(c,a),s||i||(a=c=null))}function o(){if(a=arguments,f=pu(),c=this,p=v&&(s||!y),false===h)var r=y&&!s; -else{i||y||(g=f);var o=h-(f-g),d=0>=o||o>h;d?(i&&(i=Ae(i)),g=f,l=n.apply(c,a)):i||(i=Le(u,o))}return d&&s?s=Ae(s):s||t===h||(s=Le(e,t)),r&&(d=true,l=n.apply(c,a)),!d||s||i||(a=c=null),l}var a,i,l,f,c,s,p,g=0,h=false,v=true;if(!zr(n))throw new pe(O);if(t=0>t?0:t,true===r)var y=true,v=false;else qr(r)&&(y=r.leading,h="maxWait"in r&&Ze(t,+r.maxWait||0),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&Ae(s),i&&Ae(i),i=s=p=m},o}function $r(n){if(!zr(n))throw new pe(O);return function(){return!n.apply(this,arguments) -}}function Pr(n){return Mt(n,Vr)}function Br(n){return n&&typeof n=="object"&&typeof n.length=="number"&&we.call(n)==H||false}function Dr(n){return n&&typeof n=="object"&&1===n.nodeType&&(Ge.nodeClass?-1>>0,e=n.constructor,u=-1,o=e&&n===e.prototype,a=r-1,e=ue(r),i=0t||null==n||!ze(t))return r;n=se(n);do t%2&&(r+=n),t=Ee(t/2),n+=n;while(t);return r}function Gr(n,t){return(n=null==n?"":se(n))?null==t?n.slice(h(n),v(n)+1):(t=se(t),n.slice(o(n,t),a(n,t)+1)):n}function Hr(n,t,r){var e=typeof n,u="function"==e;return!u||typeof t!="undefined"&&"prototype"in n?u||null==n?Ft(n,t,r):"object"==e?ne(n):ee(n):n -}function Qr(n){return n}function ne(n){var t=iu(n),r=t.length,e=t[0],u=r&&n[e];return 1!=r||u!==u||qr(u)?function(e){var u=r;if(u&&!e)return false;for(;u--;){var o=t[u];if(!Ie.call(e,o)||!Zt(e[o],n[o],null,true))return false}return true}:function(n){return n&&Ie.call(n,e)?(n=n[e],u===n&&(0!==u||1/u==1/n)):false}}function te(n,t,r){var e=true,u=t&&Mt(t,iu);t&&(r||u.length)||(null==r&&(r=t),t=n,n=this,u=Mt(t,iu)),false===r?e=false:qr(r)&&"chain"in r&&(e=r.chain),r=-1;for(var o=zr(n),a=u?u.length:0;++r--n?t.apply(this,arguments):void 0}},q.assign=uu,q.at=function(t){return Ge.unindexedChars&&Kr(t)&&(t=t.split("")),n(t,$t(arguments,true,false,1))},q.bind=Wr,q.bindAll=function(n){for(var t=n,r=1arguments.length?er(t,b|_,null,n):er(t,b|_|x,null,n,dr(arguments,2)) -},q.chain=function(n){return new J(n,true)},q.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t(p?e(p,l):a(s,l))){for(t=u;--t;){var g=o[t];if(0>(g?e(g,l):a(n[t],l)))continue n}p&&p.push(l),s.push(l)}return s},q.invert=function(n,t){for(var r=-1,e=iu(n),u=e.length,o={};++ru?0:u>>>0);for(o||(t=q.createCallback(t,r,3)),Tt(n,function(n,r,u){if(o)for(r=t.length,u=ue(r);r--;)u[r]=n[t[r]];else u=t(n,r,u);a[++e]={a:u,b:e,c:n}}),u=a.length,a.sort(o?l:i);u--;)a[u]=a[u].c;return a},q.tap=function(n,t,r){return t.call(r,n),n},q.throttle=function(n,t,r){var e=true,u=true;if(!zr(n))throw new pe(O);return false===r?e=false:qr(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),_t.leading=e,_t.maxWait=+t,_t.trailing=u,Ur(n,t,_t) -},q.times=function(n,t,r){n=0>n?0:n>>>0,t=Ft(t,r,1),r=-1;for(var e=ue(n);++rr?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},q.escape=function(n){return null==n?"":se(n).replace(L,s)},q.escapeRegExp=Xr,q.every=Cr,q.find=Ar,q.findIndex=sr,q.findKey=function(n,t,r){return t=q.createCallback(t,r,3),Ut(n,t,zt,true) -},q.findLast=function(n,t,r){return t=q.createCallback(t,r,3),Ut(n,t,Wt)},q.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=q.createCallback(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},q.findLastKey=function(n,t,r){return t=q.createCallback(t,r,3),Ut(n,t,qt,true)},q.findWhere=function(n,t){return Ar(n,ne(t))},q.has=function(n,t){return n?Ie.call(n,t):false},q.identity=Qr,q.indexOf=gr,q.isArguments=Br,q.isArray=ou,q.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&we.call(n)==nt||false -},q.isDate=function(n){return n&&typeof n=="object"&&we.call(n)==tt||false},q.isElement=Dr,q.isEmpty=function(n){var t=true;if(!n)return t;var r=n.length;return-1r?Ze(e+r,0):Ke(r||0,e-1))+1);e--;)if(n[e]===t)return e;return-1},q.noConflict=function(){return c._=_e,this},q.noop=re,q.now=pu,q.pad=function(n,t,r){n=null==n?"":se(n),t=+t; -var e=n.length;return er?0:+r||0,n.length),n.lastIndexOf(t,r)==r},q.template=function(n,t,r){var e=q.templateSettings;r=uu({},r,e,kt),n=se(null==n?"":n);var u,o,a=uu({},r.imports,e.imports,kt),e=iu(a),a=Jr(a),i=0,l=r.interpolate||M,f="__p+='",l=ce((r.escape||M).source+"|"+l.source+"|"+(l===U?$:M).source+"|"+(r.evaluate||M).source+"|$","g"); -return n.replace(l,function(t,r,e,a,l,c){return e||(e=a),f+=n.slice(i,c).replace(V,p),r&&(u=true,f+="'+__e("+r+")+'"),l&&(o=true,f+="';"+l+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),i=c+t.length,t}),f+="';",(r=r.variable)||(f="with(obj){"+f+"}"),f=(o?f.replace(I,""):f).replace(R,"$1").replace(F,"$1;"),f="function("+(r||"obj")+"){"+(r?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}",r=Ht(f,e,a),t?r(t):r +for(r=r?q.createCallback(r,e,1):Qr,t=r(t);u>>1,r(n[e])r?0:r);++tr?Ze(e+r,0):r||0:0,typeof n=="string"||!au(n)&&Kr(n)?ro&&(o=i)}else t=null==t&&Kr(n)?u:q.createCallback(t,r,3),Lt(n,function(n,r,u){r=t(n,r,u),(r>e||-1/0===r&&r===o)&&(e=r,o=n)});return o}function Rr(n,t){return Ir(n,ee(t))}function Ur(n,t,r,e){var u=3>arguments.length; +if(t=q.createCallback(t,e,4),au(n)){var o=-1,a=n.length;for(u&&a&&(r=n[++o]);++oarguments.length;return t=q.createCallback(t,e,4),Tt(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function Nr(n){var t=-1,r=n&&n.length,e=ue(0>r?0:r>>>0);return Lt(n,function(n){var r=Xt(0,++t);e[t]=e[r],e[r]=n}),e}function Lr(n,t,r){var e;if((typeof t!="function"||typeof r!="undefined")&&(t=q.createCallback(t,r,3)),au(n)){r=-1; +for(var u=n.length;++rarguments.length)return er(n,b,null,t);if(n)var r=n[k]?n[k][2]:n.length,e=dr(arguments,2),r=r-e.length;return er(n,b|A,r,t,e)}function Wr(n,t,r){function e(){var r=t-(gu()-f);0>=r||r>t?(i&&ke(i),r=p,i=s=p=m,r&&(g=gu(),l=n.apply(c,a),s||i||(a=c=null))):s=Ne(e,r)}function u(){s&&ke(s),i=s=p=m,(v||h!==t)&&(g=gu(),l=n.apply(c,a),s||i||(a=c=null))}function o(){if(a=arguments,f=gu(),c=this,p=v&&(s||!y),false===h)var r=y&&!s; +else{i||y||(g=f);var o=h-(f-g),d=0>=o||o>h;d?(i&&(i=ke(i)),g=f,l=n.apply(c,a)):i||(i=Ne(u,o))}return d&&s?s=ke(s):s||t===h||(s=Ne(e,t)),r&&(d=true,l=n.apply(c,a)),!d||s||i||(a=c=null),l}var a,i,l,f,c,s,p,g=0,h=false,v=true;if(!zr(n))throw new pe(O);if(t=0>t?0:t,true===r)var y=true,v=false;else qr(r)&&(y=r.leading,h="maxWait"in r&&Ze(t,+r.maxWait||0),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&ke(s),i&&ke(i),i=s=p=m},o}function $r(n){if(!zr(n))throw new pe(O);return function(){return!n.apply(this,arguments) +}}function Pr(n){return Mt(n,Vr)}function Br(n){return n&&typeof n=="object"&&typeof n.length=="number"&&we.call(n)==H||false}function Dr(n){return n&&typeof n=="object"&&1===n.nodeType&&(He.nodeClass?-1>>0,e=n.constructor,u=-1,o=e&&n===e.prototype,a=r-1,e=ue(r),i=0t||null==n||!ze(t))return r;n=se(n);do t%2&&(r+=n),t=Ee(t/2),n+=n;while(t);return r}function Gr(n,t){return(n=null==n?"":se(n))?null==t?n.slice(h(n),v(n)+1):(t=se(t),n.slice(o(n,t),a(n,t)+1)):n}function Hr(n,t,r){var e=typeof n,u="function"==e;return u&&typeof t=="undefined"?n:u||null==n?Ut(n,t,r):"object"==e?ne(n):ee(n) +}function Qr(n){return n}function ne(n){var t=lu(n),r=t.length,e=t[0],u=r&&n[e];return 1!=r||u!==u||qr(u)?function(e){var u=r;if(u&&!e)return false;for(;u--;){var o=t[u];if(!Se.call(e,o)||!Zt(n[o],e[o],null,true))return false}return true}:function(n){return n&&Se.call(n,e)?(n=n[e],u===n&&(0!==u||1/u==1/n)):false}}function te(n,t,r){var e=true,u=t&&Mt(t,lu);t&&(r||u.length)||(null==r&&(r=t),t=n,n=this,u=Mt(t,lu)),false===r?e=false:qr(r)&&"chain"in r&&(e=r.chain),r=-1;for(var o=zr(n),a=u?u.length:0;++r--n?t.apply(this,arguments):void 0}},q.assign=ou,q.at=function(t){return He.unindexedChars&&Kr(t)&&(t=t.split("")),n(t,$t(arguments,true,false,1))},q.bind=Tr,q.bindAll=function(n){for(var t=n,r=1arguments.length?er(t,b|_,null,n):er(t,b|_|A,null,n,dr(arguments,2)) +},q.chain=function(n){return new J(n,true)},q.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t(p?e(p,l):a(s,l))){for(t=u;--t;){var g=o[t];if(0>(g?e(g,l):a(n[t],l)))continue n}p&&p.push(l),s.push(l)}return s},q.invert=function(n,t){for(var r=-1,e=lu(n),u=e.length,o={};++ru?0:u>>>0);for(o||(t=q.createCallback(t,r,3)),Lt(n,function(n,r,u){if(o)for(r=t.length,u=ue(r);r--;)u[r]=n[t[r]];else u=t(n,r,u);a[++e]={a:u,b:e,c:n}}),u=a.length,a.sort(o?l:i);u--;)a[u]=a[u].c;return a},q.tap=function(n,t,r){return t.call(r,n),n},q.throttle=function(n,t,r){var e=true,u=true;if(!zr(n))throw new pe(O);return false===r?e=false:qr(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),_t.leading=e,_t.maxWait=+t,_t.trailing=u,Wr(n,t,_t) +},q.times=function(n,t,r){n=0>n?0:n>>>0,t=Ut(t,r,1),r=-1;for(var e=ue(n);++rr?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},q.escape=function(n){return null==n?"":se(n).replace(N,s)},q.escapeRegExp=Xr,q.every=Cr,q.find=kr,q.findIndex=sr,q.findKey=function(n,t,r){return t=q.createCallback(t,r,3),Wt(n,t,zt,true) +},q.findLast=function(n,t,r){return t=q.createCallback(t,r,3),Wt(n,t,Tt)},q.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=q.createCallback(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},q.findLastKey=function(n,t,r){return t=q.createCallback(t,r,3),Wt(n,t,qt,true)},q.findWhere=function(n,t){return kr(n,ne(t))},q.has=function(n,t){return n?Se.call(n,t):false},q.identity=Qr,q.indexOf=gr,q.isArguments=Br,q.isArray=au,q.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&we.call(n)==nt||false +},q.isDate=function(n){return n&&typeof n=="object"&&we.call(n)==tt||false},q.isElement=Dr,q.isEmpty=function(n){var t=true;if(!n)return t;var r=n.length;return-1r?Ze(e+r,0):Ke(r||0,e-1))+1);e--;)if(n[e]===t)return e;return-1},q.noConflict=function(){return c._=_e,this},q.noop=re,q.now=gu,q.pad=function(n,t,r){n=null==n?"":se(n),t=+t; +var e=n.length;return er?0:+r||0,n.length),n.lastIndexOf(t,r)==r},q.template=function(n,t,r){var e=q.templateSettings;r=ou({},r,e,xt),n=se(null==n?"":n);var u,o,a=ou({},r.imports,e.imports,xt),e=lu(a),a=Jr(a),i=0,l=r.interpolate||M,f="__p+='",l=ce((r.escape||M).source+"|"+l.source+"|"+(l===W?$:M).source+"|"+(r.evaluate||M).source+"|$","g"); +return n.replace(l,function(t,r,e,a,l,c){return e||(e=a),f+=n.slice(i,c).replace(V,p),r&&(u=true,f+="'+__e("+r+")+'"),l&&(o=true,f+="';"+l+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),i=c+t.length,t}),f+="';",(r=r.variable)||(f="with(obj){"+f+"}"),f=(o?f.replace(S,""):f).replace(R,"$1").replace(U,"$1;"),f="function("+(r||"obj")+"){"+(r?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}",r=Ht(f,e,a),t?r(t):r },q.trim=Gr,q.trimLeft=function(n,t){return(n=null==n?"":se(n))?null==t?n.slice(h(n)):(t=se(t),n.slice(o(n,t))):n},q.trimRight=function(n,t){return(n=null==n?"":se(n))?null==t?n.slice(0,v(n)+1):(t=se(t),n.slice(0,a(n,t)+1)):n},q.trunc=function(n,t){var r=30,e="...";if(t&&qr(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?se(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":se(n),r>=n.length)return n;var o=r-e.length;if(1>o)return e;if(r=n.slice(0,o),null==u)return r+e; -if(Zr(u)){if(n.slice(o).search(u)){var a,i,l=n.slice(0,o);for(u.global||(u=ce(u.source,(P.exec(u)||"")+"g")),u.lastIndex=0;a=u.exec(l);)i=a.index;r=r.slice(0,null==i?o:i)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(N,y))},q.uniqueId=function(n){var t=++E;return se(null==n?"":n)+t},q.all=Cr,q.any=Tr,q.detect=Ar,q.foldl=Fr,q.foldr=Nr,q.include=xr,q.inject=Fr,te(q,function(){var n={};return zt(q,function(t,r){q.prototype[r]||(n[r]=t) -}),n}(),false),q.first=pr,q.last=vr,q.sample=function(n,t,r){return n&&typeof n.length!="number"?n=Jr(n):Ge.unindexedChars&&Kr(n)&&(n=n.split("")),null==t||r?(t=n?n.length:0,0t?0:+t||0,n.length),n)},q.take=pr,q.takeRight=vr,q.takeRightWhile=vr,q.takeWhile=pr,q.head=pr,zt(q,function(n,t){var r="sample"!=t;q.prototype[t]||(q.prototype[t]=function(t,e){var u=this.__chain__,o=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new J(o,u):o}) -}),q.VERSION=k,q.prototype.chain=function(){return this.__chain__=true,this},q.prototype.toJSON=jr,q.prototype.toString=function(){return se(this.__wrapped__)},q.prototype.value=jr,q.prototype.valueOf=jr,jt(["join","pop","shift"],function(n){var t=ge[n];q.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new J(r,n):r}}),jt(["push","reverse","sort","unshift"],function(n){var t=ge[n];q.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),jt(["concat","splice"],function(n){var t=ge[n]; -q.prototype[n]=function(){return new J(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Ge.spliceObjects||jt(["pop","shift","splice"],function(n){var t=ge[n],r="splice"==n;q.prototype[n]=function(){var n=this.__chain__,e=this.__wrapped__,u=t.apply(e,arguments);return 0===e.length&&delete e[0],n||r?new J(u,n):u}}),q}var m,b=1,_=2,w=4,j=8,x=16,C=32,k="2.5.0-pre",A="__lodash@"+k+"__",O="Expected a function",E=0,S=/^[A-Z]+$/,I=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,F=/(__e\(.*?\)|\b__t\))\+'';/g,N=/&(?:amp|lt|gt|quot|#39|#96);/g,L=/[&<>"'`]/g,T=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,$=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,P=/\w*$/,B=/^\s*function[ \n\r\t]+\w/,D=/^0[xX]/,z=/^\[object .+?Constructor\]$/,q=/[\xC0-\xFF]/g,M=/($^)/,Z=/[.*+?^${}()|[\]\/\\]/g,K=/\bthis\b/,V=/['\n\r\u2028\u2029\\]/g,J=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/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",Y="Array ArrayBuffer Boolean Date Error Float64Array Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError Uint8Array window WinRTError".split(" "),G="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),H="[object Arguments]",Q="[object Array]",nt="[object Boolean]",tt="[object Date]",rt="[object Error]",et="[object Function]",ut="[object Number]",ot="[object Object]",at="[object RegExp]",it="[object String]",lt="[object ArrayBuffer]",ft="[object Float32Array]",ct="[object Float64Array]",st="[object Int8Array]",pt="[object Int16Array]",gt="[object Int32Array]",ht="[object Uint8Array]",vt="[object Uint8ClampedArray]",yt="[object Uint16Array]",dt="[object Uint32Array]",mt={}; -mt[H]=mt[Q]=mt[ft]=mt[ct]=mt[st]=mt[pt]=mt[gt]=mt[ht]=mt[vt]=mt[yt]=mt[dt]=true,mt[lt]=mt[nt]=mt[tt]=mt[rt]=mt[et]=mt["[object Map]"]=mt[ut]=mt[ot]=mt[at]=mt["[object Set]"]=mt[it]=mt["[object WeakMap]"]=false;var bt={};bt[H]=bt[Q]=bt[lt]=bt[nt]=bt[tt]=bt[rt]=bt[ft]=bt[ct]=bt[st]=bt[pt]=bt[gt]=bt[ut]=bt[ot]=bt[at]=bt[it]=bt[ht]=bt[vt]=bt[yt]=bt[dt]=true,bt[et]=bt["[object Map]"]=bt["[object Set]"]=bt["[object WeakMap]"]=false;var _t={leading:false,maxWait:0,trailing:false},wt={configurable:false,enumerable:false,value:null,writable:false},jt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},xt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ct={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":" ","\xf7":" "},kt={"function":true,object:true},At={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ot=kt[typeof window]&&window||this,Et=kt[typeof exports]&&exports&&!exports.nodeType&&exports,kt=kt[typeof module]&&module&&!module.nodeType&&module,St=Et&&kt&&typeof global=="object"&&global; -!St||St.global!==St&&St.window!==St&&St.self!==St||(Ot=St);var St=kt&&kt.exports===Et&&Et,It=d();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ot._=It, define(function(){return It})):Et&&kt?St?(kt.exports=It)._=It:Et._=It:Ot._=It}).call(this); \ No newline at end of file +if(Zr(u)){if(n.slice(o).search(u)){var a,i,l=n.slice(0,o);for(u.global||(u=ce(u.source,(P.exec(u)||"")+"g")),u.lastIndex=0;a=u.exec(l);)i=a.index;r=r.slice(0,null==i?o:i)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(F,y))},q.uniqueId=function(n){var t=++E;return se(null==n?"":n)+t},q.all=Cr,q.any=Lr,q.detect=kr,q.foldl=Ur,q.foldr=Fr,q.include=Ar,q.inject=Ur,te(q,function(){var n={};return zt(q,function(t,r){q.prototype[r]||(n[r]=t) +}),n}(),false),q.first=pr,q.last=vr,q.sample=function(n,t,r){return n&&typeof n.length!="number"?n=Jr(n):He.unindexedChars&&Kr(n)&&(n=n.split("")),null==t||r?(t=n?n.length:0,0t?0:+t||0,n.length),n)},q.take=pr,q.takeRight=vr,q.takeRightWhile=vr,q.takeWhile=pr,q.head=pr,zt(q,function(n,t){var r="sample"!=t;q.prototype[t]||(q.prototype[t]=function(t,e){var u=this.__chain__,o=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new J(o,u):o}) +}),q.VERSION=x,q.prototype.chain=function(){return this.__chain__=true,this},q.prototype.toJSON=jr,q.prototype.toString=function(){return se(this.__wrapped__)},q.prototype.value=jr,q.prototype.valueOf=jr,jt(["join","pop","shift"],function(n){var t=ge[n];q.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new J(r,n):r}}),jt(["push","reverse","sort","unshift"],function(n){var t=ge[n];q.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),jt(["concat","splice"],function(n){var t=ge[n]; +q.prototype[n]=function(){return new J(t.apply(this.__wrapped__,arguments),this.__chain__)}}),He.spliceObjects||jt(["pop","shift","splice"],function(n){var t=ge[n],r="splice"==n;q.prototype[n]=function(){var n=this.__chain__,e=this.__wrapped__,u=t.apply(e,arguments);return 0===e.length&&delete e[0],n||r?new J(u,n):u}}),q}var m,b=1,_=2,w=4,j=8,A=16,C=32,x="2.5.0-pre",k="__lodash@"+x+"__",O="Expected a function",E=0,I=/^[A-Z]+$/,S=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,U=/(__e\(.*?\)|\b__t\))\+'';/g,F=/&(?:amp|lt|gt|quot|#39|#96);/g,N=/[&<>"'`]/g,L=/<%-([\s\S]+?)%>/g,T=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,$=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,P=/\w*$/,B=/^\s*function[ \n\r\t]+\w/,D=/^0[xX]/,z=/^\[object .+?Constructor\]$/,q=/[\xC0-\xFF]/g,M=/($^)/,Z=/[.*+?^${}()|[\]\/\\]/g,K=/\bthis\b/,V=/['\n\r\u2028\u2029\\]/g,J=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/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",Y="Array ArrayBuffer Boolean Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array window WinRTError".split(" "),G="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),H="[object Arguments]",Q="[object Array]",nt="[object Boolean]",tt="[object Date]",rt="[object Error]",et="[object Function]",ut="[object Number]",ot="[object Object]",at="[object RegExp]",it="[object String]",lt="[object ArrayBuffer]",ft="[object Float32Array]",ct="[object Float64Array]",st="[object Int8Array]",pt="[object Int16Array]",gt="[object Int32Array]",ht="[object Uint8Array]",vt="[object Uint8ClampedArray]",yt="[object Uint16Array]",dt="[object Uint32Array]",mt={}; +mt[H]=mt[Q]=mt[ft]=mt[ct]=mt[st]=mt[pt]=mt[gt]=mt[ht]=mt[vt]=mt[yt]=mt[dt]=true,mt[lt]=mt[nt]=mt[tt]=mt[rt]=mt[et]=mt["[object Map]"]=mt[ut]=mt[ot]=mt[at]=mt["[object Set]"]=mt[it]=mt["[object WeakMap]"]=false;var bt={};bt[H]=bt[Q]=bt[lt]=bt[nt]=bt[tt]=bt[rt]=bt[ft]=bt[ct]=bt[st]=bt[pt]=bt[gt]=bt[ut]=bt[ot]=bt[at]=bt[it]=bt[ht]=bt[vt]=bt[yt]=bt[dt]=true,bt[et]=bt["[object Map]"]=bt["[object Set]"]=bt["[object WeakMap]"]=false;var _t={leading:false,maxWait:0,trailing:false},wt={configurable:false,enumerable:false,value:null,writable:false},jt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},At={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ct={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":" ","\xf7":" "},xt={"function":true,object:true},kt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ot=xt[typeof window]&&window||this,Et=xt[typeof exports]&&exports&&!exports.nodeType&&exports,xt=xt[typeof module]&&module&&!module.nodeType&&module,It=Et&&xt&&typeof global=="object"&&global; +!It||It.global!==It&&It.window!==It&&It.self!==It||(Ot=It);var It=xt&&xt.exports===Et&&Et,St=d();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ot._=St, define(function(){return St})):Et&&xt?It?(xt.exports=St)._=St:Et._=St:Ot._=St}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 034294890..ab8f859f1 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -104,10 +104,11 @@ /** Used to assign default `context` object properties */ var contextProps = [ - 'Array', 'ArrayBuffer', 'Boolean', 'Date', 'Float64Array', 'Function', - 'Math', 'Number', 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', - 'document', 'isFinite', 'isNaN','parseInt', 'setTimeout', 'TypeError', - 'Uint8Array', 'window', 'WinRTError' + 'Array', 'ArrayBuffer', 'Boolean', 'Date', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number', 'Object', + 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'document', 'isFinite', 'isNaN', + 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', + 'Uint16Array', 'Uint32Array', 'window', 'WinRTError' ]; /** Used to make template sourceURLs easier to identify */ @@ -633,7 +634,7 @@ /** Native method shortcuts */ var ArrayBuffer = isNative(ArrayBuffer = context.ArrayBuffer) && ArrayBuffer, - bufferSlice = isNative(bufferSlice = ArrayBuffer && (new ArrayBuffer).slice) && bufferSlice, + bufferSlice = isNative(bufferSlice = ArrayBuffer && new ArrayBuffer(0).slice) && bufferSlice, ceil = Math.ceil, clearTimeout = context.clearTimeout, Float64Array = isNative(Float64Array = context.Float64Array) && Float64Array, @@ -1082,7 +1083,7 @@ case float32Class: case float64Class: case int8Class: case int16Class: case int32Class: case uint8Class: case uint8ClampedClass: case uint16Class: case uint32Class: - return value.subarray(0); + return new Ctor(cloneBuffer(value.buffer)); case numberClass: case stringClass: @@ -1108,13 +1109,16 @@ return stackB[length]; } } - result = isArr ? Ctor(value.length) : Ctor(); + result = isArr ? Ctor(value.length) : new Ctor; } else { result = isArr ? slice(value) : baseAssign({}, value); } + if (className == argsClass) { + result.length = value.length; + } // add array properties assigned by `RegExp#exec` - if (isArr) { + else if (isArr) { if (hasOwnProperty.call(value, 'index')) { result.index = value.index; } @@ -1182,8 +1186,7 @@ if (typeof func != 'function') { return identity; } - // exit early for no `thisArg` or already bound by `Function#bind` - if (typeof thisArg == 'undefined' || !('prototype' in func)) { + if (typeof thisArg == 'undefined') { return func; } var data = func[expando]; @@ -1199,7 +1202,7 @@ } if (!data) { // checks if `func` references the `this` keyword and stores the result - data = reThis.test(source); + data = reThis.test(source) || isNative(func); setData(func, data); } } @@ -1598,8 +1601,8 @@ return false; } var valClass = toString.call(value), - othClass = toString.call(other), valIsArg = valClass == argsClass, + othClass = toString.call(other), othIsArg = othClass == argsClass; if (valIsArg) { @@ -1618,6 +1621,10 @@ // to `1` or `0` treating invalid dates coerced to `NaN` as not equal return +value == +other; + case errorClass: + // check properties instead of coercing to strings to support IE < 8 + return value.name === other.name && value.message === other.message; + case numberClass: // treat `NaN` vs. `NaN` as equal return (value != +value) @@ -1625,12 +1632,10 @@ // but treat `-0` vs. `+0` as not equal : (value == 0 ? (1 / value == 1 / other) : value == +other); - case errorClass: case regexpClass: case stringClass: - // coerce errors (http://es5.github.io/#x15.11.4.4) - // and regexes (http://es5.github.io/#x15.10.6.4) to strings - // treat string primitives and their corresponding object instances as equal + // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) + // treat string primitives and object instances as equal return value == String(other); } var isArr = arrayLikeClasses[valClass]; @@ -1678,7 +1683,7 @@ return stackB[length] == other; } } - result = true; + var index = -1; // add `value` and `other` to the stack of traversed objects stackA.push(value); @@ -1686,32 +1691,28 @@ // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { - // compare lengths to determine if a deep comparison is necessary var othLength = other.length; length = value.length; - result = othLength == length; - - if (result || isWhere) { - var othIndex = -1; + result = length == othLength; + if (result || (isWhere && othLength > length)) { // deep compare the contents, ignoring non-numeric properties - while (++othIndex < othLength) { - var othValue = other[othIndex]; - + while (++index < length) { + var valValue = value[index]; if (isWhere) { - var index = -1; - while (++index < length) { - result = baseIsEqual(value[index], othValue, callback, isWhere, stackA, stackB); + var othIndex = othLength; + while (othIndex--) { + result = baseIsEqual(valValue, other[othIndex], callback, isWhere, stackA, stackB); if (result) { break; } } } else { - var valValue = value[othIndex]; - result = callback ? callback(valValue, othValue, othIndex) : undefined; - result = typeof result == 'undefined' - ? baseIsEqual(valValue, othValue, callback, isWhere, stackA, stackB) - : !!result; + var othValue = other[index]; + result = callback ? callback(valValue, othValue, index) : undefined; + if (typeof result == 'undefined') { + result = baseIsEqual(valValue, othValue, callback, isWhere, stackA, stackB); + } } if (!result) { break; @@ -1720,42 +1721,40 @@ } } else { - var size = 0; + var valProps = keys(value), + othProps = keys(other); - // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` - // which, in this case, is more costly - baseForIn(other, function(othValue, key, other) { - if (hasOwnProperty.call(other, key)) { - result = false; - // count the number of properties - size++; - // deep compare each property value - if (hasOwnProperty.call(value, key)) { - var valValue = value[key]; + if (valIsArg) { + valProps.push('length'); + } + if (othIsArg) { + othProps.push('length'); + } + length = valProps.length; + result = length == othProps.length; + + if (result || isWhere) { + while (++index < length) { + var key = valProps[index]; + result = hasOwnProperty.call(other, key); + if (result) { + valValue = value[key]; + othValue = other[key]; result = callback ? callback(valValue, othValue, key) : undefined; - result = typeof result == 'undefined' - ? baseIsEqual(valValue, othValue, callback, isWhere, stackA, stackB) - : !!result; + if (typeof result == 'undefined') { + result = baseIsEqual(valValue, othValue, callback, isWhere, stackA, stackB); + } + } + if (!result) { + break; } - return result; } - }); - - if (result && !isWhere) { - // ensure both objects have the same number of properties - baseForIn(value, function(valValue, key, value) { - if (hasOwnProperty.call(value, key)) { - // `size` will be `-1` if `value` has more properties than `other` - result = --size > -1; - return result; - } - }); } } stackA.pop(); stackB.pop(); - return result; + return !!result; } /** @@ -4890,8 +4889,8 @@ * @category Collections * @param {Array|Object|string} collection The collection to iterate over. * @param {Array|Function|Object|string} [callback=identity] The function - * called per iteration. If a property name or object is provided it is - * used to create a "_.pluck" or "_.where" style callback respectively. + * called per iteration. If property name(s) or an object is provided it + * is used to create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `callback`. * @returns {Array} Returns the new sorted array. * @example @@ -7894,7 +7893,7 @@ var type = typeof func, isFunc = type == 'function'; - if (isFunc && (typeof thisArg == 'undefined' || !('prototype' in func))) { + if (isFunc && typeof thisArg == 'undefined') { return func; } if (isFunc || func == null) { @@ -7973,7 +7972,7 @@ while (length--) { var key = props[length]; if (!(hasOwnProperty.call(object, key) && - baseIsEqual(object[key], source[key], null, true))) { + baseIsEqual(source[key], object[key], null, true))) { return false; } } @@ -8658,9 +8657,9 @@ // some AMD build optimizers like r.js check for condition patterns like the following: if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - // Expose Lo-Dash to the global object even when an AMD loader is present in - // case Lo-Dash is loaded with a RequireJS shim config. - // See http://requirejs.org/docs/api.html#config-shim + // Expose Lo-Dash to the global object when an AMD loader is present to avoid + // errors in cases where Lo-Dash is loaded by a script tag and not intended + // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch root._ = _; // define as an anonymous module so, through path mapping, it can be diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 3b44b85bb..973b119b3 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -4,65 +4,65 @@ * Build: `lodash modern -o ./dist/lodash.js` */ ;(function(){function n(n,t){for(var e=-1,r=t.length,u=Array(r);++et||typeof n=="undefined")return 1;if(nr||13r||8202e||13e||8202>>0:0,u=tr(r);++ea(t,f)&&l.push(f);return l}function Ft(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number"&&-1o?0:o>>>0);return Ft(n,function(n){var o=u?t:null!=n&&n[t];a[++r]=o?o.apply(n,e):m}),a}function Zt(n,t,e,r,u){var o=re(t);return(o?bt:Bt)(t,function(t,a,i){var f=t&&re(t),l=t&&nu(t),c=n[a]; -if(f||l){for(r||(r=[]),u||(u=[]),l=r.length;l--;)if(r[l]==t)return void(n[a]=u[l]);i=e?e(c,t,a,n,i):m,(l=typeof i!="undefined")||(i=f?Qr(c)?c:[]:nu(c)?c:{}),r.push(t),u.push(i),l||Zt(i,t,e,r,u),n[a]=i}else i=e?e(c,t,a,n,i):m,typeof i=="undefined"&&(i=t),(o||typeof i!="undefined")&&(n[a]=i)}),n}function Pt(n,t){var e={};if(typeof t=="function")return Lt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)}),e;for(var r=-1,u=t.length;++rr||13r||8202e||13e||8202>>0:0,u=tr(r);++ea(t,f)&&l.push(f);return l}function St(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number"&&-1f)for(;++lo?0:o>>>0);return St(n,function(n){var o=u?t:null!=n&&n[t];a[++r]=o?o.apply(n,e):m}),a}function Zt(n,t,e,r,u){var o=re(t);return(o?dt:Bt)(t,function(t,a,i){var f=t&&re(t),l=t&&nu(t),c=n[a]; +if(f||l){for(r||(r=[]),u||(u=[]),l=r.length;l--;)if(r[l]==t)return void(n[a]=u[l]);i=e?e(c,t,a,n,i):m,(l=typeof i!="undefined")||(i=f?Qr(c)?c:[]:nu(c)?c:{}),r.push(t),u.push(i),l||Zt(i,t,e,r,u),n[a]=i}else i=e?e(c,t,a,n,i):m,typeof i=="undefined"&&(i=t),(o||typeof i!="undefined")&&(n[a]=i)}),n}function Pt(n,t){var e={};if(typeof t=="function")return Lt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)}),e;for(var r=-1,u=t.length;++ri(p,h)&&((u||l)&&p.push(h),c.push(s))}return c}function Jt(n,t){for(var e=-1,r=t(n),u=r.length,o=tr(u);++er)return t;var u=typeof e[2];if("number"!=u&&"string"!=u||!e[3]||e[3][e[2]]!==e[1]||(r=2),3r)return t;var u=typeof e[2];if("number"!=u&&"string"!=u||!e[3]||e[3][e[2]]!==e[1]||(r=2),3o?0:o)}function ce(n,t,r){var u=n?n.length:0;if(typeof r=="number")r=0>r?Dr(u+r,0):r||0;else if(r)return r=ve(n,t),u&&n[r]===t?r:-1;return e(n,t,r)}function pe(n,t,e){var r=n?n.length:0;if(typeof t!="number"&&null!=t){var u=r,o=0; for(t=q.createCallback(t,e,3);u--&&t(n[u],u,n);)o++}else o=null==t||e?1:t;return o=r-(o||0),ge(n,0,0>o?0:o)}function se(n,t,e){var r=n?n.length:0;if(typeof t!="number"&&null!=t){var u=r,o=0;for(t=q.createCallback(t,e,3);u--&&t(n[u],u,n);)o++}else if(o=t,null==o||e)return n?n[r-1]:m;return o=r-(o||0),ge(n,0>o?0:o)}function he(n,t,e){if(typeof t!="number"&&null!=t){var r=-1,u=n?n.length:0,o=0;for(t=q.createCallback(t,e,3);++rt?0:t;return ge(n,o)}function ge(n,t,e){var r=-1,u=n?n.length:0; -for(t=null==t?0:+t||0,0>t?t=Dr(u+t,0):t>u&&(t=u),e=typeof e=="undefined"?u:+e||0,0>e?e=Dr(u+e,0):e>u&&(e=u),u=t>e?0:e-t,e=tr(u);++r>>1,e(n[r])e?0:e);++te?Dr(r+e,0):e||0:0,typeof n=="string"||!Qr(n)&&Me(n)?eo&&(o=i)}else t=null==t&&Me(n)?u:q.createCallback(t,e,3),Ft(n,function(n,e,u){e=t(n,e,u),(e>r||-1/0===e&&e===o)&&(r=e,o=n)});return o}function Ee(n,t){return Ce(n,nr(t))}function Ie(n,t,e,r){var u=3>arguments.length;t=q.createCallback(t,r,4);var o=-1,a=n?n.length:0;if(typeof a=="number"&&-1arguments.length;return t=q.createCallback(t,r,4),Nt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Se(n){var t=-1,e=n&&n.length,r=tr(0>e?0:e>>>0);return Ft(n,function(n){var e=Kt(0,++t);r[t]=r[e],r[e]=n}),r}function Fe(n,t,e){var r;(typeof t!="function"||typeof e!="undefined")&&(t=q.createCallback(t,e,3)),e=-1;var u=n?n.length:0;if(typeof u=="number"&&-1arguments.length)return ne(n,d,null,t);if(n)var e=n[A]?n[A][2]:n.length,r=ge(arguments,2),e=e-r.length;return ne(n,d|j,e,t,r)}function Te(n,t,e){function r(){var e=t-(au()-l);0>=e||e>t?(i&&wr(i),e=s,i=p=s=m,e&&(h=au(),f=n.apply(c,a),p||i||(a=c=null))):p=Ir(r,e)}function u(){p&&wr(p),i=p=s=m,(v||g!==t)&&(h=au(),f=n.apply(c,a),p||i||(a=c=null))}function o(){if(a=arguments,l=au(),c=this,s=v&&(p||!y),false===g)var e=y&&!p; -else{i||y||(h=l);var o=g-(l-h),m=0>=o||o>g;m?(i&&(i=wr(i)),h=l,f=n.apply(c,a)):i||(i=Ir(u,o))}return m&&p?p=wr(p):p||t===g||(p=Ir(r,t)),e&&(m=true,f=n.apply(c,a)),!m||p||i||(a=c=null),f}var a,i,f,l,c,p,s,h=0,g=false,v=true;if(!Be(n))throw new fr(C);if(t=0>t?0:t,true===e)var y=true,v=false;else De(e)&&(y=e.leading,g="maxWait"in e&&Dr(t,+e.maxWait||0),v="trailing"in e?e.trailing:v);return o.cancel=function(){p&&wr(p),i&&wr(i),i=p=s=m},o}function We(n){if(!Be(n))throw new fr(C);return function(){return!n.apply(this,arguments) -}}function Ue(n){return zt(n,Ze)}function $e(n){return n&&typeof n=="object"&&typeof n.length=="number"&&yr.call(n)==Y||false}function Le(n){return n&&typeof n=="object"&&1===n.nodeType&&-1>>0,r=n.constructor,u=-1,r=r&&n===r.prototype,o=e-1,a=tr(e),i=0t||null==n||!$r(t))return e;n=ir(n);do t%2&&(e+=n),t=kr(t/2),n+=n;while(t);return e}function Je(n,t){return(n=null==n?"":ir(n))?null==t?n.slice(h(n),g(n)+1):(t=ir(t),n.slice(o(n,t),a(n,t)+1)):n -}function Xe(n,t,e){var r=typeof n,u="function"==r;return!u||typeof t!="undefined"&&"prototype"in n?u||null==n?It(n,t,e):"object"==r?Ge(n):nr(n):n}function Ye(n){return n}function Ge(n){var t=tu(n),e=t.length,r=t[0],u=e&&n[r];return 1!=e||u!==u||De(u)?function(r){var u=e;if(u&&!r)return false;for(;u--;){var o=t[u];if(!Ar.call(r,o)||!qt(r[o],n[o],null,true))return false}return true}:function(n){return n&&Ar.call(n,r)?(n=n[r],u===n&&(0!==u||1/u==1/n)):false}}function He(n,t,e){var r=true,u=t&&zt(t,tu);t&&(e||u.length)||(null==e&&(e=t),t=n,n=this,u=zt(t,tu)),false===e?r=false:De(e)&&"chain"in e&&(r=e.chain),e=-1; -for(var o=Be(n),a=u?u.length:0;++e--n?t.apply(this,arguments):void 0}},q.assign=Hr,q.at=function(t){return n(t,Wt(arguments,true,false,1))},q.bind=Ne,q.bindAll=function(n){for(var t=n,e=1arguments.length?ne(t,d|b,null,n):ne(t,d|b|j,null,n,ge(arguments,2))},q.chain=function(n){return new V(n,true) -},q.compact=function(n){for(var t=-1,e=n?n.length:0,r=0,u=[];++t(s?r(s,f):a(p,f))){for(t=u;--t;){var h=o[t];if(0>(h?r(h,f):a(n[t],f)))continue n}s&&s.push(f),p.push(f)}return p},q.invert=function(n,t){for(var e=-1,r=tu(n),u=r.length,o={};++eu?0:u>>>0);for(o||(t=q.createCallback(t,e,3)),Ft(n,function(n,e,u){if(o)for(e=t.length,u=tr(e);e--;)u[e]=n[t[e]];else u=t(n,e,u);a[++r]={a:u,b:r,c:n}}),u=a.length,a.sort(o?f:i);u--;)a[u]=a[u].c;return a},q.tap=function(n,t,e){return t.call(e,n),n},q.throttle=function(n,t,e){var r=true,u=true;if(!Be(n))throw new fr(C);return false===e?r=false:De(e)&&(r="leading"in e?!!e.leading:r,u="trailing"in e?!!e.trailing:u),mt.leading=r,mt.maxWait=+t,mt.trailing=u,Te(n,t,mt) -},q.times=function(n,t,e){n=0>n?0:n>>>0,t=It(t,e,1),e=-1;for(var r=tr(n);++ee?0:+e||0,r))-t.length,0<=e&&n.indexOf(t,e)==e},q.escape=function(n){return null==n?"":ir(n).replace(N,p)},q.escapeRegExp=Ke,q.every=we,q.find=ke,q.findIndex=fe,q.findKey=function(n,t,e){return t=q.createCallback(t,e,3),Tt(n,t,Bt,true) -},q.findLast=function(n,t,e){return t=q.createCallback(t,e,3),Tt(n,t,Nt)},q.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=q.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},q.findLastKey=function(n,t,e){return t=q.createCallback(t,e,3),Tt(n,t,Dt,true)},q.findWhere=function(n,t){return ke(n,Ge(t))},q.has=function(n,t){return n?Ar.call(n,t):false},q.identity=Ye,q.indexOf=ce,q.isArguments=$e,q.isArray=Qr,q.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&yr.call(n)==H||false -},q.isDate=function(n){return n&&typeof n=="object"&&yr.call(n)==Q||false},q.isElement=Le,q.isEmpty=function(n){var t=true;if(!n)return t;var e=n.length;return-1t?t=Dr(u+t,0):t>u&&(t=u),e=typeof e=="undefined"?u:+e||0,0>e?e=Dr(u+e,0):e>u&&(e=u),u=t>e?0:e-t,e=tr(u);++r>>1,e(n[r])e?0:e);++te?Dr(r+e,0):e||0:0,typeof n=="string"||!Qr(n)&&Me(n)?eo&&(o=i)}else t=null==t&&Me(n)?u:q.createCallback(t,e,3),St(n,function(n,e,u){e=t(n,e,u),(e>r||-1/0===e&&e===o)&&(r=e,o=n)});return o}function Ie(n,t){return Ce(n,nr(t))}function Ee(n,t,e,r){var u=3>arguments.length;t=q.createCallback(t,r,4);var o=-1,a=n?n.length:0;if(typeof a=="number"&&-1arguments.length;return t=q.createCallback(t,r,4),Ut(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Fe(n){var t=-1,e=n&&n.length,r=tr(0>e?0:e>>>0);return St(n,function(n){var e=Kt(0,++t);r[t]=r[e],r[e]=n}),r}function Se(n,t,e){var r;(typeof t!="function"||typeof e!="undefined")&&(t=q.createCallback(t,e,3)),e=-1;var u=n?n.length:0;if(typeof u=="number"&&-1arguments.length)return ne(n,b,null,t);if(n)var e=n[x]?n[x][2]:n.length,r=ge(arguments,2),e=e-r.length;return ne(n,b|j,e,t,r)}function Ne(n,t,e){function r(){var e=t-(au()-l);0>=e||e>t?(i&&wr(i),e=s,i=p=s=m,e&&(h=au(),f=n.apply(c,a),p||i||(a=c=null))):p=Er(r,e)}function u(){p&&wr(p),i=p=s=m,(v||g!==t)&&(h=au(),f=n.apply(c,a),p||i||(a=c=null))}function o(){if(a=arguments,l=au(),c=this,s=v&&(p||!y),false===g)var e=y&&!p; +else{i||y||(h=l);var o=g-(l-h),m=0>=o||o>g;m?(i&&(i=wr(i)),h=l,f=n.apply(c,a)):i||(i=Er(u,o))}return m&&p?p=wr(p):p||t===g||(p=Er(r,t)),e&&(m=true,f=n.apply(c,a)),!m||p||i||(a=c=null),f}var a,i,f,l,c,p,s,h=0,g=false,v=true;if(!Be(n))throw new fr(C);if(t=0>t?0:t,true===e)var y=true,v=false;else De(e)&&(y=e.leading,g="maxWait"in e&&Dr(t,+e.maxWait||0),v="trailing"in e?e.trailing:v);return o.cancel=function(){p&&wr(p),i&&wr(i),i=p=s=m},o}function Te(n){if(!Be(n))throw new fr(C);return function(){return!n.apply(this,arguments) +}}function We(n){return zt(n,Ze)}function $e(n){return n&&typeof n=="object"&&typeof n.length=="number"&&yr.call(n)==Y||false}function Le(n){return n&&typeof n=="object"&&1===n.nodeType&&-1>>0,r=n.constructor,u=-1,r=r&&n===r.prototype,o=e-1,a=tr(e),i=0t||null==n||!$r(t))return e;n=ir(n);do t%2&&(e+=n),t=Ar(t/2),n+=n;while(t);return e}function Je(n,t){return(n=null==n?"":ir(n))?null==t?n.slice(h(n),g(n)+1):(t=ir(t),n.slice(o(n,t),a(n,t)+1)):n +}function Xe(n,t,e){var r=typeof n,u="function"==r;return u&&typeof t=="undefined"?n:u||null==n?Et(n,t,e):"object"==r?Ge(n):nr(n)}function Ye(n){return n}function Ge(n){var t=tu(n),e=t.length,r=t[0],u=e&&n[r];return 1!=e||u!==u||De(u)?function(r){var u=e;if(u&&!r)return false;for(;u--;){var o=t[u];if(!xr.call(r,o)||!qt(n[o],r[o],null,true))return false}return true}:function(n){return n&&xr.call(n,r)?(n=n[r],u===n&&(0!==u||1/u==1/n)):false}}function He(n,t,e){var r=true,u=t&&zt(t,tu);t&&(e||u.length)||(null==e&&(e=t),t=n,n=this,u=zt(t,tu)),false===e?r=false:De(e)&&"chain"in e&&(r=e.chain),e=-1; +for(var o=Be(n),a=u?u.length:0;++e--n?t.apply(this,arguments):void 0}},q.assign=Hr,q.at=function(t){return n(t,Tt(arguments,true,false,1))},q.bind=Ue,q.bindAll=function(n){for(var t=n,e=1arguments.length?ne(t,b|d,null,n):ne(t,b|d|j,null,n,ge(arguments,2))},q.chain=function(n){return new V(n,true) +},q.compact=function(n){for(var t=-1,e=n?n.length:0,r=0,u=[];++t(s?r(s,f):a(p,f))){for(t=u;--t;){var h=o[t];if(0>(h?r(h,f):a(n[t],f)))continue n}s&&s.push(f),p.push(f)}return p},q.invert=function(n,t){for(var e=-1,r=tu(n),u=r.length,o={};++eu?0:u>>>0);for(o||(t=q.createCallback(t,e,3)),St(n,function(n,e,u){if(o)for(e=t.length,u=tr(e);e--;)u[e]=n[t[e]];else u=t(n,e,u);a[++r]={a:u,b:r,c:n}}),u=a.length,a.sort(o?f:i);u--;)a[u]=a[u].c;return a},q.tap=function(n,t,e){return t.call(e,n),n},q.throttle=function(n,t,e){var r=true,u=true;if(!Be(n))throw new fr(C);return false===e?r=false:De(e)&&(r="leading"in e?!!e.leading:r,u="trailing"in e?!!e.trailing:u),mt.leading=r,mt.maxWait=+t,mt.trailing=u,Ne(n,t,mt) +},q.times=function(n,t,e){n=0>n?0:n>>>0,t=Et(t,e,1),e=-1;for(var r=tr(n);++ee?0:+e||0,r))-t.length,0<=e&&n.indexOf(t,e)==e},q.escape=function(n){return null==n?"":ir(n).replace(U,p)},q.escapeRegExp=Ke,q.every=we,q.find=Ae,q.findIndex=fe,q.findKey=function(n,t,e){return t=q.createCallback(t,e,3),Nt(n,t,Bt,true) +},q.findLast=function(n,t,e){return t=q.createCallback(t,e,3),Nt(n,t,Ut)},q.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=q.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},q.findLastKey=function(n,t,e){return t=q.createCallback(t,e,3),Nt(n,t,Dt,true)},q.findWhere=function(n,t){return Ae(n,Ge(t))},q.has=function(n,t){return n?xr.call(n,t):false},q.identity=Ye,q.indexOf=ce,q.isArguments=$e,q.isArray=Qr,q.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&yr.call(n)==H||false +},q.isDate=function(n){return n&&typeof n=="object"&&yr.call(n)==Q||false},q.isElement=Le,q.isEmpty=function(n){var t=true;if(!n)return t;var e=n.length;return-1e?Dr(r+e,0):zr(e||0,r-1))+1);r--;)if(n[r]===t)return r;return-1},q.noConflict=function(){return c._=vr,this},q.noop=Qe,q.now=au,q.pad=function(n,t,e){n=null==n?"":ir(n),t=+t; -var r=n.length;return re?0:+e||0,n.length),n.lastIndexOf(t,e)==e},q.template=function(n,t,e){var r=q.templateSettings;e=Hr({},e,r,jt),n=ir(null==n?"":n);var u,o,a=Hr({},e.imports,r.imports,jt),r=tu(a),a=Pe(a),i=0,f=e.interpolate||M,l="__p+='",f=ar((e.escape||M).source+"|"+f.source+"|"+(f===U?$:M).source+"|"+(e.evaluate||M).source+"|$","g"); -return n.replace(f,function(t,e,r,a,f,c){return r||(r=a),l+=n.slice(i,c).replace(K,s),e&&(u=true,l+="'+__e("+e+")+'"),f&&(o=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t}),l+="';",(e=e.variable)||(l="with(obj){"+l+"}"),l=(o?l.replace(I,""):l).replace(R,"$1").replace(S,"$1;"),l="function("+(e||"obj")+"){"+(e?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",e=Xt(l,r,a,void 0),t?e(t):e +var r=n.length;return re?0:+e||0,n.length),n.lastIndexOf(t,e)==e},q.template=function(n,t,e){var r=q.templateSettings;e=Hr({},e,r,jt),n=ir(null==n?"":n);var u,o,a=Hr({},e.imports,r.imports,jt),r=tu(a),a=Pe(a),i=0,f=e.interpolate||M,l="__p+='",f=ar((e.escape||M).source+"|"+f.source+"|"+(f===W?$:M).source+"|"+(e.evaluate||M).source+"|$","g"); +return n.replace(f,function(t,e,r,a,f,c){return r||(r=a),l+=n.slice(i,c).replace(K,s),e&&(u=true,l+="'+__e("+e+")+'"),f&&(o=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t}),l+="';",(e=e.variable)||(l="with(obj){"+l+"}"),l=(o?l.replace(E,""):l).replace(R,"$1").replace(F,"$1;"),l="function("+(e||"obj")+"){"+(e?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",e=Xt(l,r,a,void 0),t?e(t):e },q.trim=Je,q.trimLeft=function(n,t){return(n=null==n?"":ir(n))?null==t?n.slice(h(n)):(t=ir(t),n.slice(o(n,t))):n},q.trimRight=function(n,t){return(n=null==n?"":ir(n))?null==t?n.slice(0,g(n)+1):(t=ir(t),n.slice(0,a(n,t)+1)):n},q.trunc=function(n,t){var e=30,r="...";if(t&&De(t))var u="separator"in t?t.separator:u,e="length"in t?+t.length||0:e,r="omission"in t?ir(t.omission):r;else null!=t&&(e=+t||0);if(n=null==n?"":ir(n),e>=n.length)return n;var o=e-r.length;if(1>o)return r;if(e=n.slice(0,o),null==u)return e+r; -if(qe(u)){if(n.slice(o).search(u)){var a,i,f=n.slice(0,o);for(u.global||(u=ar(u.source,(L.exec(u)||"")+"g")),u.lastIndex=0;a=u.exec(f);)i=a.index;e=e.slice(0,null==i?o:i)}}else n.indexOf(u,o)!=o&&(u=e.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(F,v))},q.uniqueId=function(n){var t=++O;return ir(null==n?"":n)+t},q.all=we,q.any=Fe,q.detect=ke,q.foldl=Ie,q.foldr=Re,q.include=_e,q.inject=Ie,He(q,function(){var n={};return Bt(q,function(t,e){q.prototype[e]||(n[e]=t) -}),n}(),false),q.first=le,q.last=se,q.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=Pe(n)),null==t||e?(t=n?n.length:0,0t?0:+t||0,n.length),n)},q.take=le,q.takeRight=se,q.takeRightWhile=se,q.takeWhile=le,q.head=le,Bt(q,function(n,t){var e="sample"!=t;q.prototype[t]||(q.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new V(o,u):o})}),q.VERSION=x,q.prototype.chain=function(){return this.__chain__=true,this -},q.prototype.toJSON=be,q.prototype.toString=function(){return ir(this.__wrapped__)},q.prototype.value=be,q.prototype.valueOf=be,bt(["join","pop","shift"],function(n){var t=lr[n];q.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new V(e,n):e}}),bt(["push","reverse","sort","unshift"],function(n){var t=lr[n];q.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),bt(["concat","splice"],function(n){var t=lr[n];q.prototype[n]=function(){return new V(t.apply(this.__wrapped__,arguments),this.__chain__) -}}),q}var m,d=1,b=2,_=4,w=8,j=16,k=32,x="2.5.0-pre",A="__lodash@"+x+"__",C="Expected a function",O=0,E=/^[A-Z]+$/,I=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,S=/(__e\(.*?\)|\b__t\))\+'';/g,F=/&(?:amp|lt|gt|quot|#39|#96);/g,N=/[&<>"'`]/g,T=/<%-([\s\S]+?)%>/g,W=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,$=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,L=/\w*$/,B=/^\s*function[ \n\r\t]+\w/,D=/^0[xX]/,z=/^\[object .+?Constructor\]$/,q=/[\xC0-\xFF]/g,M=/($^)/,Z=/[.*+?^${}()|[\]\/\\]/g,P=/\bthis\b/,K=/['\n\r\u2028\u2029\\]/g,V=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g,J=" \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",X="Array ArrayBuffer Boolean Date Float64Array Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError Uint8Array window WinRTError".split(" "),Y="[object Arguments]",G="[object Array]",H="[object Boolean]",Q="[object Date]",nt="[object Error]",tt="[object Number]",et="[object Object]",rt="[object RegExp]",ut="[object String]",ot="[object ArrayBuffer]",at="[object Float32Array]",it="[object Float64Array]",ft="[object Int8Array]",lt="[object Int16Array]",ct="[object Int32Array]",pt="[object Uint8Array]",st="[object Uint8ClampedArray]",ht="[object Uint16Array]",gt="[object Uint32Array]",vt={}; -vt[Y]=vt[G]=vt[at]=vt[it]=vt[ft]=vt[lt]=vt[ct]=vt[pt]=vt[st]=vt[ht]=vt[gt]=true,vt[ot]=vt[H]=vt[Q]=vt[nt]=vt["[object Function]"]=vt["[object Map]"]=vt[tt]=vt[et]=vt[rt]=vt["[object Set]"]=vt[ut]=vt["[object WeakMap]"]=false;var yt={};yt[Y]=yt[G]=yt[ot]=yt[H]=yt[Q]=yt[nt]=yt[at]=yt[it]=yt[ft]=yt[lt]=yt[ct]=yt[tt]=yt[et]=yt[rt]=yt[ut]=yt[pt]=yt[st]=yt[ht]=yt[gt]=true,yt["[object Function]"]=yt["[object Map]"]=yt["[object Set]"]=yt["[object WeakMap]"]=false;var mt={leading:false,maxWait:0,trailing:false},dt={configurable:false,enumerable:false,value:null,writable:false},bt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},_t={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},wt={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":" ","\xf7":" "},jt={"function":true,object:true},kt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xt=jt[typeof window]&&window||this,At=jt[typeof exports]&&exports&&!exports.nodeType&&exports,jt=jt[typeof module]&&module&&!module.nodeType&&module,Ct=At&&jt&&typeof global=="object"&&global; -!Ct||Ct.global!==Ct&&Ct.window!==Ct&&Ct.self!==Ct||(xt=Ct);var Ct=jt&&jt.exports===At&&At,Ot=y();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(xt._=Ot, define(function(){return Ot})):At&&jt?Ct?(jt.exports=Ot)._=Ot:At._=Ot:xt._=Ot}).call(this); \ No newline at end of file +if(qe(u)){if(n.slice(o).search(u)){var a,i,f=n.slice(0,o);for(u.global||(u=ar(u.source,(L.exec(u)||"")+"g")),u.lastIndex=0;a=u.exec(f);)i=a.index;e=e.slice(0,null==i?o:i)}}else n.indexOf(u,o)!=o&&(u=e.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(S,v))},q.uniqueId=function(n){var t=++O;return ir(null==n?"":n)+t},q.all=we,q.any=Se,q.detect=Ae,q.foldl=Ee,q.foldr=Re,q.include=_e,q.inject=Ee,He(q,function(){var n={};return Bt(q,function(t,e){q.prototype[e]||(n[e]=t) +}),n}(),false),q.first=le,q.last=se,q.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=Pe(n)),null==t||e?(t=n?n.length:0,0t?0:+t||0,n.length),n)},q.take=le,q.takeRight=se,q.takeRightWhile=se,q.takeWhile=le,q.head=le,Bt(q,function(n,t){var e="sample"!=t;q.prototype[t]||(q.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new V(o,u):o})}),q.VERSION=k,q.prototype.chain=function(){return this.__chain__=true,this +},q.prototype.toJSON=de,q.prototype.toString=function(){return ir(this.__wrapped__)},q.prototype.value=de,q.prototype.valueOf=de,dt(["join","pop","shift"],function(n){var t=lr[n];q.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new V(e,n):e}}),dt(["push","reverse","sort","unshift"],function(n){var t=lr[n];q.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),dt(["concat","splice"],function(n){var t=lr[n];q.prototype[n]=function(){return new V(t.apply(this.__wrapped__,arguments),this.__chain__) +}}),q}var m,b=1,d=2,_=4,w=8,j=16,A=32,k="2.5.0-pre",x="__lodash@"+k+"__",C="Expected a function",O=0,I=/^[A-Z]+$/,E=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,F=/(__e\(.*?\)|\b__t\))\+'';/g,S=/&(?:amp|lt|gt|quot|#39|#96);/g,U=/[&<>"'`]/g,N=/<%-([\s\S]+?)%>/g,T=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,$=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,L=/\w*$/,B=/^\s*function[ \n\r\t]+\w/,D=/^0[xX]/,z=/^\[object .+?Constructor\]$/,q=/[\xC0-\xFF]/g,M=/($^)/,Z=/[.*+?^${}()|[\]\/\\]/g,P=/\bthis\b/,K=/['\n\r\u2028\u2029\\]/g,V=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g,J=" \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",X="Array ArrayBuffer Boolean Date Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array window WinRTError".split(" "),Y="[object Arguments]",G="[object Array]",H="[object Boolean]",Q="[object Date]",nt="[object Error]",tt="[object Number]",et="[object Object]",rt="[object RegExp]",ut="[object String]",ot="[object ArrayBuffer]",at="[object Float32Array]",it="[object Float64Array]",ft="[object Int8Array]",lt="[object Int16Array]",ct="[object Int32Array]",pt="[object Uint8Array]",st="[object Uint8ClampedArray]",ht="[object Uint16Array]",gt="[object Uint32Array]",vt={}; +vt[Y]=vt[G]=vt[at]=vt[it]=vt[ft]=vt[lt]=vt[ct]=vt[pt]=vt[st]=vt[ht]=vt[gt]=true,vt[ot]=vt[H]=vt[Q]=vt[nt]=vt["[object Function]"]=vt["[object Map]"]=vt[tt]=vt[et]=vt[rt]=vt["[object Set]"]=vt[ut]=vt["[object WeakMap]"]=false;var yt={};yt[Y]=yt[G]=yt[ot]=yt[H]=yt[Q]=yt[nt]=yt[at]=yt[it]=yt[ft]=yt[lt]=yt[ct]=yt[tt]=yt[et]=yt[rt]=yt[ut]=yt[pt]=yt[st]=yt[ht]=yt[gt]=true,yt["[object Function]"]=yt["[object Map]"]=yt["[object Set]"]=yt["[object WeakMap]"]=false;var mt={leading:false,maxWait:0,trailing:false},bt={configurable:false,enumerable:false,value:null,writable:false},dt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},_t={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},wt={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":" ","\xf7":" "},jt={"function":true,object:true},At={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kt=jt[typeof window]&&window||this,xt=jt[typeof exports]&&exports&&!exports.nodeType&&exports,jt=jt[typeof module]&&module&&!module.nodeType&&module,Ct=xt&&jt&&typeof global=="object"&&global; +!Ct||Ct.global!==Ct&&Ct.window!==Ct&&Ct.self!==Ct||(kt=Ct);var Ct=jt&&jt.exports===xt&&xt,Ot=y();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(kt._=Ot, define(function(){return Ot})):xt&&jt?Ct?(jt.exports=Ot)._=Ot:xt._=Ot:kt._=Ot}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index b52fd841e..52f5c980d 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -570,8 +570,7 @@ if (typeof func != 'function') { return identity; } - // exit early for no `thisArg` or already bound by `Function#bind` - if (typeof thisArg == 'undefined' || !('prototype' in func)) { + if (typeof thisArg == 'undefined') { return func; } switch (argCount) { @@ -973,19 +972,16 @@ return stackB[length] == other; } } - var result = true, - size = 0; - stackA.push(value); stackB.push(other); if (isArr) { - size = other.length; - result = size == value.length; + length = value.length; + var result = length == other.length; if (result) { - while (size--) { - result = baseIsEqual(value[size], other[size], stackA, stackB); + while (length--) { + result = baseIsEqual(value[length], other[length], stackA, stackB); if (!result) { break; } @@ -993,25 +989,23 @@ } } else { - baseForIn(other, function(othValue, key, other) { - if (hasOwnProperty.call(other, key)) { - size++; - result = hasOwnProperty.call(value, key) && baseIsEqual(value[key], othValue, stackA, stackB); - return result || breakIndicator; - } - }); + var props = keys(value); + length = props.length; + result = length == keys(other).length; if (result) { - baseForIn(value, function(valValue, key, value) { - if (hasOwnProperty.call(value, key)) { - result = --size > -1; - return result || breakIndicator; + while (length--) { + var key = props[length]; + result = hasOwnProperty.call(other, key) && baseIsEqual(value[key], other[key], stackA, stackB); + if (!result) { + break; } - }); + } } } stackA.pop(); stackB.pop(); + return result; } @@ -3195,8 +3189,8 @@ * @category Collections * @param {Array|Object|string} collection The collection to iterate over. * @param {Array|Function|Object|string} [callback=identity] The function - * called per iteration. If a property name or object is provided it is - * used to create a "_.pluck" or "_.where" style callback respectively. + * called per iteration. If property name(s) or an object is provided it + * is used to create a "_.pluck" or "_.where" style callback respectively. * @param {*} [thisArg] The `this` binding of `callback`. * @returns {Array} Returns the new sorted array. * @example @@ -5000,7 +4994,7 @@ var type = typeof func, isFunc = type == 'function'; - if (isFunc && (typeof thisArg == 'undefined' || !('prototype' in func))) { + if (isFunc && typeof thisArg == 'undefined') { return func; } if (isFunc || func == null) { @@ -5568,9 +5562,9 @@ // some AMD build optimizers like r.js check for condition patterns like the following: if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - // Expose Lo-Dash to the global object even when an AMD loader is present in - // case Lo-Dash is loaded with a RequireJS shim config. - // See http://requirejs.org/docs/api.html#config-shim + // Expose Lo-Dash to the global object when an AMD loader is present to avoid + // errors in cases where Lo-Dash is loaded by a script tag and not intended + // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch root._ = lodash; // define as an anonymous module so, through path mapping, it can be diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index a1d307cae..e6aaa1f88 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -4,27 +4,26 @@ * Build: `lodash underscore -o ./dist/lodash.underscore.js` */ ;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++te||typeof t=="undefined"){t=1;break n}if(t>>0:0,u=Array(e);++t>>0:0,u=Array(e);++tu(r,i)&&o.push(i)}return o}function g(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number"&&-1o?0:o>>>0);return g(n,function(n){var o=u?r:null!=n&&n[r];i[++e]=o?o.apply(n,t):sr}),i}function j(n,r){var t={};if(typeof r=="function")return b(n,function(n,e,u){r(n,e,u)&&(t[e]=n)}),t;for(var e=-1,u=r.length;++eo(f,c)&&(t&&f.push(c),i.push(a))}return i}function x(n,r){var t,e=["_"];try{var u=Function(e,"return "+n+(t?"\n/*\n//# sourceURL="+t+"\n*/":"")).apply(sr,r);u.source=n}catch(o){throw o.source=n,o}return u}function T(n,r){return function(t,e,u){var o=r?r():{};e=fr(e,u,3),u=-1;var i=t?t.length:0;if(typeof i=="number"&&-1r?0:r)}function I(r,t,e){var u=r?r.length:0;if(typeof e=="number")e=0>e?it(u+e,0):e||0;else if(e)return e=q(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function M(n,r,t){return N(n,null==r||t?1:0>r?0:r)}function N(n,r,t){var e=-1,u=n?n.length:0;for(r=null==r?0:+r||0,0>r?r=it(u+r,0):r>u&&(r=u),t=typeof t=="undefined"?u:+t||0,0>t?t=it(u+t,0):t>u&&(t=u),u=r>t?0:t-r,t=Array(u);++e>>1,t(n[e])u&&(u=t);else r=fr(r,t,3),g(n,function(n,t,o){t=r(n,t,o),(t>e||-1/0===t&&t===u)&&(e=t,u=n)});return u}function L(n,r){return z(n,pr(r))}function P(n,r,t,e){var u=3>arguments.length; -r=fr(r,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number"&&-1arguments.length;return r=fr(r,e,4),h(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function G(n){var r=-1,t=n&&n.length,e=Array(0>t?0:t>>>0);return g(n,function(n){var t=w(++r);e[r]=e[t],e[t]=n}),e}function H(n,r,t){var e;(typeof r!="function"||typeof t!="undefined")&&(r=fr(r,t,3)),t=-1;var u=n?n.length:0; -if(typeof u=="number"&&-1arguments.length?E(n,gr,r):E(n,gr|vr,r,N(arguments,2))}function K(n,r,t){function e(){var t=r-(dt()-c);0>=t||t>r?(f&&clearTimeout(f),t=s,f=p=s=sr,t&&(g=dt(),a=n.apply(l,i),p||f||(i=l=null))):p=setTimeout(e,t)}function u(){p&&clearTimeout(p),f=p=s=sr,(v||h!==r)&&(g=dt(),a=n.apply(l,i),p||f||(i=l=null))}function o(){if(i=arguments,c=dt(),l=this,s=v&&(p||!y),false===h)var t=y&&!p; -else{f||y||(g=c);var o=h-(c-g),m=0>=o||o>h;m?(f&&(f=clearTimeout(f)),g=c,a=n.apply(l,i)):f||(f=setTimeout(u,o))}return m&&p?p=clearTimeout(p):p||r===h||(p=setTimeout(e,r)),t&&(m=true,a=n.apply(l,i)),!m||p||f||(i=l=null),a}var i,f,a,c,l,p,s,g=0,h=false,v=true;if(!rr(n))throw new TypeError(mr);if(r=0>r?0:r,true===t)var y=true,v=false;else tr(t)&&(y=t.leading,h="maxWait"in t&&it(r,+t.maxWait||0),v="trailing"in t?t.trailing:v);return o.cancel=function(){p&&clearTimeout(p),f&&clearTimeout(f),f=p=s=sr},o}function Q(n){if(!rr(n))throw new TypeError(mr); -return function(){return!n.apply(this,arguments)}}function X(n){if(!n)return n;var r=arguments,t=0,e=r.length,u=typeof r[2];for("number"!=u&&"string"!=u||!r[3]||r[3][r[2]]!==r[1]||(e=2);++t"'`]/g,jr=/^\[object .+?Constructor\]$/,wr=/($^)/,Ar=/[.*+?^${}()|[\]\/\\]/g,xr=/['\n\r\u2028\u2029\\]/g,Tr="[object Arguments]",Er="[object Boolean]",kr="[object Date]",Or="[object Number]",Sr="[object Object]",Fr="[object RegExp]",Ir="[object String]",Mr={};Mr[Tr]=Mr["[object Array]"]=Mr["[object Float32Array]"]=Mr["[object Float64Array]"]=Mr["[object Int8Array]"]=Mr["[object Int16Array]"]=Mr["[object Int32Array]"]=Mr["[object Uint8Array]"]=Mr["[object Uint8ClampedArray]"]=Mr["[object Uint16Array]"]=Mr["[object Uint32Array]"]=true,Mr["[object ArrayBuffer]"]=Mr[Er]=Mr[kr]=Mr["[object Error]"]=Mr["[object Function]"]=Mr["[object Map]"]=Mr[Or]=Mr[Sr]=Mr[Fr]=Mr["[object Set]"]=Mr[Ir]=Mr["[object WeakMap]"]=false; -var Nr={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},qr={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Br={"function":true,object:true},Rr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$r=Br[typeof window]&&window||this,Ur=Br[typeof exports]&&exports&&!exports.nodeType&&exports,Wr=Br[typeof module]&&module&&!module.nodeType&&module,Dr=Ur&&Wr&&typeof global=="object"&&global;!Dr||Dr.global!==Dr&&Dr.window!==Dr&&Dr.self!==Dr||($r=Dr); -var zr=Wr&&Wr.exports===Ur&&Ur,Cr=Array.prototype,Lr=Object.prototype,Pr=Function.prototype.toString,Vr=Math.pow(2,53)-1,Gr=$r._,Hr=Lr.toString,Jr=RegExp("^"+(null==Hr?"":(Hr+"").replace(Ar,"\\$&")).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kr=Math.ceil,Qr=Math.floor,Xr=Lr.hasOwnProperty,Yr=Cr.push,Zr=Lr.propertyIsEnumerable,nt=Cr.splice,rt=O(rt=Object.create)&&rt,tt=O(tt=Array.isArray)&&tt,et=$r.isFinite,ut=$r.isNaN,ot=O(ot=Object.keys)&&ot,it=Math.max,ft=Math.min,at=O(at=Date.now)&&at,ct=Math.random; +if(i||f)return d(i?n.__wrapped__:n,f?r.__wrapped__:r,t,e);if(i=Xr.call(n,"constructor"),f=Xr.call(r,"constructor"),i!=f||!i&&(i=n.constructor,f=r.constructor,i!=f&&!(rr(i)&&i instanceof i&&rr(f)&&f instanceof f)&&"constructor"in n&&"constructor"in r))return false}for(t||(t=[]),e||(e=[]),i=t.length;i--;)if(t[i]==n)return e[i]==r;if(t.push(n),e.push(r),u){if(i=n.length,f=i==r.length)for(;i--&&(f=d(n[i],r[i],t,e)););}else if(u=bt(n),i=u.length,f=i==bt(r).length)for(;i--&&(f=u[i],f=Xr.call(r,f)&&d(n[f],r[f],t,e)););return t.pop(),e.pop(),f +}function _(n,r,t){var e=-1,u=typeof r=="function",o=n&&n.length,i=Array(0>o?0:o>>>0);return g(n,function(n){var o=u?r:null!=n&&n[r];i[++e]=o?o.apply(n,t):sr}),i}function j(n,r){var t={};if(typeof r=="function")return b(n,function(n,e,u){r(n,e,u)&&(t[e]=n)}),t;for(var e=-1,u=r.length;++eo(f,c)&&(t&&f.push(c),i.push(a)) +}return i}function x(n,r){var t,e=["_"];try{var u=Function(e,"return "+n+(t?"\n/*\n//# sourceURL="+t+"\n*/":"")).apply(sr,r);u.source=n}catch(o){throw o.source=n,o}return u}function T(n,r){return function(t,e,u){var o=r?r():{};e=fr(e,u,3),u=-1;var i=t?t.length:0;if(typeof i=="number"&&-1r?0:r)}function I(r,t,e){var u=r?r.length:0;if(typeof e=="number")e=0>e?it(u+e,0):e||0; +else if(e)return e=q(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function M(n,r,t){return N(n,null==r||t?1:0>r?0:r)}function N(n,r,t){var e=-1,u=n?n.length:0;for(r=null==r?0:+r||0,0>r?r=it(u+r,0):r>u&&(r=u),t=typeof t=="undefined"?u:+t||0,0>t?t=it(u+t,0):t>u&&(t=u),u=r>t?0:t-r,t=Array(u);++e>>1,t(n[e])u&&(u=t);else r=fr(r,t,3),g(n,function(n,t,o){t=r(n,t,o),(t>e||-1/0===t&&t===u)&&(e=t,u=n)});return u}function L(n,r){return z(n,pr(r))}function P(n,r,t,e){var u=3>arguments.length;r=fr(r,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number"&&-1arguments.length;return r=fr(r,e,4),h(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function G(n){var r=-1,t=n&&n.length,e=Array(0>t?0:t>>>0);return g(n,function(n){var t=w(++r);e[r]=e[t],e[t]=n}),e}function H(n,r,t){var e;(typeof r!="function"||typeof t!="undefined")&&(r=fr(r,t,3)),t=-1;var u=n?n.length:0;if(typeof u=="number"&&-1arguments.length?E(n,gr,r):E(n,gr|vr,r,N(arguments,2)) +}function K(n,r,t){function e(){var t=r-(dt()-c);0>=t||t>r?(f&&clearTimeout(f),t=s,f=p=s=sr,t&&(g=dt(),a=n.apply(l,i),p||f||(i=l=null))):p=setTimeout(e,t)}function u(){p&&clearTimeout(p),f=p=s=sr,(v||h!==r)&&(g=dt(),a=n.apply(l,i),p||f||(i=l=null))}function o(){if(i=arguments,c=dt(),l=this,s=v&&(p||!y),false===h)var t=y&&!p;else{f||y||(g=c);var o=h-(c-g),m=0>=o||o>h;m?(f&&(f=clearTimeout(f)),g=c,a=n.apply(l,i)):f||(f=setTimeout(u,o))}return m&&p?p=clearTimeout(p):p||r===h||(p=setTimeout(e,r)),t&&(m=true,a=n.apply(l,i)),!m||p||f||(i=l=null),a +}var i,f,a,c,l,p,s,g=0,h=false,v=true;if(!rr(n))throw new TypeError(mr);if(r=0>r?0:r,true===t)var y=true,v=false;else tr(t)&&(y=t.leading,h="maxWait"in t&&it(r,+t.maxWait||0),v="trailing"in t?t.trailing:v);return o.cancel=function(){p&&clearTimeout(p),f&&clearTimeout(f),f=p=s=sr},o}function Q(n){if(!rr(n))throw new TypeError(mr);return function(){return!n.apply(this,arguments)}}function X(n){if(!n)return n;var r=arguments,t=0,e=r.length,u=typeof r[2];for("number"!=u&&"string"!=u||!r[3]||r[3][r[2]]!==r[1]||(e=2);++t"'`]/g,jr=/^\[object .+?Constructor\]$/,wr=/($^)/,Ar=/[.*+?^${}()|[\]\/\\]/g,xr=/['\n\r\u2028\u2029\\]/g,Tr="[object Arguments]",Er="[object Boolean]",kr="[object Date]",Or="[object Number]",Sr="[object Object]",Fr="[object RegExp]",Ir="[object String]",Mr={}; +Mr[Tr]=Mr["[object Array]"]=Mr["[object Float32Array]"]=Mr["[object Float64Array]"]=Mr["[object Int8Array]"]=Mr["[object Int16Array]"]=Mr["[object Int32Array]"]=Mr["[object Uint8Array]"]=Mr["[object Uint8ClampedArray]"]=Mr["[object Uint16Array]"]=Mr["[object Uint32Array]"]=true,Mr["[object ArrayBuffer]"]=Mr[Er]=Mr[kr]=Mr["[object Error]"]=Mr["[object Function]"]=Mr["[object Map]"]=Mr[Or]=Mr[Sr]=Mr[Fr]=Mr["[object Set]"]=Mr[Ir]=Mr["[object WeakMap]"]=false;var Nr={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},qr={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Br={"function":true,object:true},Rr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$r=Br[typeof window]&&window||this,Ur=Br[typeof exports]&&exports&&!exports.nodeType&&exports,Wr=Br[typeof module]&&module&&!module.nodeType&&module,Dr=Ur&&Wr&&typeof global=="object"&&global; +!Dr||Dr.global!==Dr&&Dr.window!==Dr&&Dr.self!==Dr||($r=Dr);var zr=Wr&&Wr.exports===Ur&&Ur,Cr=Array.prototype,Lr=Object.prototype,Pr=Function.prototype.toString,Vr=Math.pow(2,53)-1,Gr=$r._,Hr=Lr.toString,Jr=RegExp("^"+(null==Hr?"":(Hr+"").replace(Ar,"\\$&")).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kr=Math.ceil,Qr=Math.floor,Xr=Lr.hasOwnProperty,Yr=Cr.push,Zr=Lr.propertyIsEnumerable,nt=Cr.splice,rt=O(rt=Object.create)&&rt,tt=O(tt=Array.isArray)&&tt,et=$r.isFinite,ut=$r.isNaN,ot=O(ot=Object.keys)&&ot,it=Math.max,ft=Math.min,at=O(at=Date.now)&&at,ct=Math.random; i.prototype=o.prototype;var lt={};!function(){var n={0:1,length:1};lt.spliceObjects=(nt.call(n,0,1),!n[0])}(0,0),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},rt||(c=function(){function n(){}return function(r){if(tr(r)){n.prototype=r;var t=new n;n.prototype=null}return t||$r.Object()}}());var pt=M,st=F,gt=T(function(n,r,t){Xr.call(n,t)?n[t]++:n[t]=1}),ht=T(function(n,r,t){Xr.call(n,t)?n[t].push(r):n[t]=[r]}),vt=T(function(n,r,t){n[t]=r }),yt=T(function(n,r,t){n[t?0:1].push(r)},function(){return[[],[]]});nr(arguments)||(nr=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Xr.call(n,"callee")&&!Zr.call(n,"callee")||false});var mt=tt||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&"[object Array]"==Hr.call(n)||false};rr(/x/)&&(rr=function(n){return typeof n=="function"&&"[object Function]"==Hr.call(n)});var bt=ot?function(n){return tr(n)?ot(n):[]}:S,dt=at||function(){return(new Date).getTime()};o.after=function(n,r){if(!rr(r))throw new TypeError(mr); return n=et(n=+n)?n:0,function(){return 1>--n?r.apply(this,arguments):void 0}},o.bind=J,o.bindAll=function(n){for(var r=n,t=1