From 8179a3a34943fdfec843d2042997ebf2e82b5f0e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 23 Mar 2014 15:00:02 -0700 Subject: [PATCH] Rebuild dist. --- dist/lodash.compat.js | 137 +++++++++++++++++++--------------- dist/lodash.compat.min.js | 4 +- dist/lodash.js | 133 ++++++++++++++++++--------------- dist/lodash.min.js | 6 +- dist/lodash.underscore.js | 4 +- dist/lodash.underscore.min.js | 2 +- 6 files changed, 154 insertions(+), 132 deletions(-) diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 306d7fff8..2b6c51a1a 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -1136,8 +1136,8 @@ stackB.push(result); // recursively populate clone (susceptible to call stack limits) - (isArr ? baseEach : baseForOwn)(value, function(objValue, key) { - result[key] = baseClone(objValue, isDeep, callback, stackA, stackB); + (isArr ? baseEach : baseForOwn)(value, function(valValue, key) { + result[key] = baseClone(valValue, isDeep, callback, stackA, stackB); }); return result; @@ -1558,84 +1558,97 @@ * @param {Array} [stackB=[]] Tracks traversed `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ - function baseIsEqual(a, b, callback, isWhere, stackA, stackB) { + function baseIsEqual(value, other, callback, isWhere, stackA, stackB) { if (callback) { - var result = callback(a, b); + var result = callback(value, other); if (typeof result != 'undefined') { return !!result; } } // exit early for identical values - if (a === b) { + if (value === other) { // treat `+0` vs. `-0` as not equal - return a !== 0 || (1 / a == 1 / b); + return value !== 0 || (1 / value == 1 / other); } - var type = typeof a, - otherType = typeof b; + var valType = typeof value, + othType = typeof other; // exit early for unlike primitive values - if (a === a && (a == null || b == null || - (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) { + if (value === value && (value == null || other == null || + (valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object'))) { return false; } // compare [[Class]] names - var className = toString.call(a), - otherClass = toString.call(b); + var valClass = toString.call(value), + othClass = toString.call(other), + valIsArg = valClass == argsClass, + othIsArg = othClass == argsClass; - if (className == argsClass) { - className = objectClass; + if (valIsArg) { + valClass = objectClass; } - if (otherClass == argsClass) { - otherClass = objectClass; + if (othIsArg) { + othClass = objectClass; } - if (className != otherClass) { + if (valClass != othClass) { return false; } - switch (className) { + switch (valClass) { case boolClass: case dateClass: // coerce dates and booleans to numbers, dates to milliseconds and booleans // to `1` or `0` treating invalid dates coerced to `NaN` as not equal - return +a == +b; + return +value == +other; case numberClass: // treat `NaN` vs. `NaN` as equal - return (a != +a) - ? b != +b + return (value != +value) + ? other != +other // but treat `-0` vs. `+0` as not equal - : (a == 0 ? (1 / a == 1 / b) : a == +b); + : (value == 0 ? (1 / value == 1 / other) : value == +other); case regexpClass: case stringClass: // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // treat string primitives and their corresponding object instances as equal - return a == String(b); + return value == String(other); } - var isArr = className == arrayClass; + var isArr = valClass == arrayClass; if (!isArr) { // unwrap any `lodash` wrapped values - var aWrapped = hasOwnProperty.call(a, '__wrapped__'), - bWrapped = hasOwnProperty.call(b, '__wrapped__'); + var valWrapped = hasOwnProperty.call(value, '__wrapped__'), + othWrapped = hasOwnProperty.call(other, '__wrapped__'); - if (aWrapped || bWrapped) { - return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, callback, isWhere, stackA, stackB); + if (valWrapped || othWrapped) { + return baseIsEqual(valWrapped ? value.__wrapped__ : value, othWrapped ? other.__wrapped__ : other, callback, isWhere, stackA, stackB); } // exit for functions and DOM nodes - if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { + if (valClass != objectClass || (!support.nodeClass && (isNode(value) || isNode(other)))) { return false; } - // in older versions of Opera, `arguments` objects have `Array` constructors - var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, - ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; + if (!support.argsObject) { + valIsArg = isArguments(value); + othIsArg = isArguments(other); + } + var hasValCtor = !valIsArg && hasOwnProperty.call(value, 'constructor'), + hasOthCtor = !othIsArg && hasOwnProperty.call(other, 'constructor'); - // non `Object` object instances with different constructors are not equal - if (ctorA != ctorB && - !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) && - !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && - ('constructor' in a && 'constructor' in b) - ) { + if (hasValCtor != hasOthCtor) { return false; } + if (!hasValCtor) { + // in older versions of Opera, `arguments` objects have `Array` constructors + var valCtor = valIsArg ? Object : value.constructor, + othCtor = othIsArg ? Object : other.constructor; + + // non `Object` object instances with different constructors are not equal + if (valCtor != othCtor && + !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && + ('constructor' in value && 'constructor' in other) + ) { + return false; + } + } } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 @@ -1646,37 +1659,37 @@ var length = stackA.length; while (length--) { - if (stackA[length] == a) { - return stackB[length] == b; + if (stackA[length] == value) { + return stackB[length] == other; } } var size = 0; result = true; - // add `a` and `b` to the stack of traversed objects - stackA.push(a); - stackB.push(b); + // add `value` and `other` to the stack of traversed objects + stackA.push(value); + stackB.push(other); // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { // compare lengths to determine if a deep comparison is necessary - length = a.length; - size = b.length; + length = value.length; + size = other.length; result = size == length; if (result || isWhere) { // deep compare the contents, ignoring non-numeric properties while (size--) { var index = length, - value = b[size]; + othValue = other[size]; if (isWhere) { while (index--) { - if ((result = baseIsEqual(a[index], value, callback, isWhere, stackA, stackB))) { + if ((result = baseIsEqual(value[index], othValue, callback, isWhere, stackA, stackB))) { break; } } - } else if (!(result = baseIsEqual(a[size], value, callback, isWhere, stackA, stackB))) { + } else if (!(result = baseIsEqual(value[size], othValue, callback, isWhere, stackA, stackB))) { break; } } @@ -1685,20 +1698,20 @@ else { // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` // which, in this case, is more costly - baseForIn(b, function(value, key, b) { - if (hasOwnProperty.call(b, key)) { + baseForIn(other, function(othValue, key, other) { + if (hasOwnProperty.call(other, key)) { // count the number of properties. size++; // deep compare each property value. - return (result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, callback, isWhere, stackA, stackB)); + return (result = hasOwnProperty.call(value, key) && baseIsEqual(value[key], othValue, callback, isWhere, stackA, stackB)); } }); if (result && !isWhere) { // ensure both objects have the same number of properties - baseForIn(a, function(value, key, a) { - if (hasOwnProperty.call(a, key)) { - // `size` will be `-1` if `a` has more properties than `b` + baseForIn(value, function(valValue, key, value) { + if (hasOwnProperty.call(value, key)) { + // `size` will be `-1` if `value` has more properties than `other` return (result = --size > -1); } }); @@ -6142,7 +6155,7 @@ * var object = { 'name': 'fred' }; * var other = { 'name': 'fred' }; * - * object == other; + * object == other; * // => false * * _.isEqual(object, other); @@ -6165,12 +6178,12 @@ // treat `-0` vs. `+0` as not equal return value !== 0 || (1 / value == 1 / other); } - var vType = typeof value, - oType = typeof other; + var valType = typeof value, + othType = typeof other; // exit early for unlike primitive values if (value === value && (value == null || other == null || - (vType != 'function' && vType != 'object' && oType != 'function' && oType != 'object'))) { + (valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object'))) { return false; } } @@ -6895,10 +6908,10 @@ * _.camelCase('Hello world'); * // => 'helloWorld' * - * _.camelCase('hello-world'); + * _.camelCase('--hello-world'); * // => 'helloWorld' * - * _.camelCase('hello_world'); + * _.camelCase('__hello_world__'); * // => 'helloWorld' */ var camelCase = createCompounder(function(result, word, index) { @@ -7018,7 +7031,7 @@ * _.kebabCase('helloWorld'); * // => 'hello-world' * - * _.kebabCase('hello_world'); + * _.kebabCase('__hello_world__'); * // => 'hello-world' */ var kebabCase = createCompounder(function(result, word, index) { @@ -7172,7 +7185,7 @@ * _.snakeCase('Hello world'); * // => 'hello_world' * - * _.snakeCase('hello-world'); + * _.snakeCase('--hello-world'); * // => 'hello_world' * * _.snakeCase('helloWorld'); diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 5b978becc..a42fda14b 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -13,8 +13,8 @@ }var r=n[0],e=n[1],u=n[2],o=n[3],a=n[4],i=n[5],l=n[6],f=n[7],c=e&x,s=e&C,p=e&j,h=e&k,g=r;return Ee(t,n),t}function st(n,t){var u=n?n.length:0;if(!u)return[];var o=-1,a=Nt(),i=a===r,l=i&&Oe&&t&&200<=t.length,i=i&&!l,f=[],c=t?t.length:0;l&&(a=e,t=Oe(t));n:for(;++oa(t,l)&&f.push(l);return f}function pt(n,t){var r=-1,e=n,u=n?n.length:0;if(typeof u=="number"&&-1i(s,h)&&((u||f)&&s.push(h),c.push(p))}return c}function Et(n,t){for(var r=-1,e=t(n),u=e.length,o=Ir(u);++rr&&(r=0),s&&(a=[]),p&&(i=[]),h=[n,t,r,e,u,o,a,i],t==x||t==(x|O)?c(h):X(h)) diff --git a/dist/lodash.js b/dist/lodash.js index a08835981..0575ba87b 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -979,8 +979,8 @@ stackB.push(result); // recursively populate clone (susceptible to call stack limits) - (isArr ? baseEach : baseForOwn)(value, function(objValue, key) { - result[key] = baseClone(objValue, isDeep, callback, stackA, stackB); + (isArr ? baseEach : baseForOwn)(value, function(valValue, key) { + result[key] = baseClone(valValue, isDeep, callback, stackA, stackB); }); return result; @@ -1395,84 +1395,93 @@ * @param {Array} [stackB=[]] Tracks traversed `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ - function baseIsEqual(a, b, callback, isWhere, stackA, stackB) { + function baseIsEqual(value, other, callback, isWhere, stackA, stackB) { if (callback) { - var result = callback(a, b); + var result = callback(value, other); if (typeof result != 'undefined') { return !!result; } } // exit early for identical values - if (a === b) { + if (value === other) { // treat `+0` vs. `-0` as not equal - return a !== 0 || (1 / a == 1 / b); + return value !== 0 || (1 / value == 1 / other); } - var type = typeof a, - otherType = typeof b; + var valType = typeof value, + othType = typeof other; // exit early for unlike primitive values - if (a === a && (a == null || b == null || - (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) { + if (value === value && (value == null || other == null || + (valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object'))) { return false; } // compare [[Class]] names - var className = toString.call(a), - otherClass = toString.call(b); + var valClass = toString.call(value), + othClass = toString.call(other), + valIsArg = valClass == argsClass, + othIsArg = othClass == argsClass; - if (className == argsClass) { - className = objectClass; + if (valIsArg) { + valClass = objectClass; } - if (otherClass == argsClass) { - otherClass = objectClass; + if (othIsArg) { + othClass = objectClass; } - if (className != otherClass) { + if (valClass != othClass) { return false; } - switch (className) { + switch (valClass) { case boolClass: case dateClass: // coerce dates and booleans to numbers, dates to milliseconds and booleans // to `1` or `0` treating invalid dates coerced to `NaN` as not equal - return +a == +b; + return +value == +other; case numberClass: // treat `NaN` vs. `NaN` as equal - return (a != +a) - ? b != +b + return (value != +value) + ? other != +other // but treat `-0` vs. `+0` as not equal - : (a == 0 ? (1 / a == 1 / b) : a == +b); + : (value == 0 ? (1 / value == 1 / other) : value == +other); case regexpClass: case stringClass: // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) // treat string primitives and their corresponding object instances as equal - return a == String(b); + return value == String(other); } - var isArr = className == arrayClass; + var isArr = valClass == arrayClass; if (!isArr) { // unwrap any `lodash` wrapped values - var aWrapped = hasOwnProperty.call(a, '__wrapped__'), - bWrapped = hasOwnProperty.call(b, '__wrapped__'); + var valWrapped = hasOwnProperty.call(value, '__wrapped__'), + othWrapped = hasOwnProperty.call(other, '__wrapped__'); - if (aWrapped || bWrapped) { - return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, callback, isWhere, stackA, stackB); + if (valWrapped || othWrapped) { + return baseIsEqual(valWrapped ? value.__wrapped__ : value, othWrapped ? other.__wrapped__ : other, callback, isWhere, stackA, stackB); } // exit for functions and DOM nodes - if (className != objectClass) { + if (valClass != objectClass) { return false; } - // in older versions of Opera, `arguments` objects have `Array` constructors - var ctorA = a.constructor, - ctorB = b.constructor; + var hasValCtor = !valIsArg && hasOwnProperty.call(value, 'constructor'), + hasOthCtor = !othIsArg && hasOwnProperty.call(other, 'constructor'); - // non `Object` object instances with different constructors are not equal - if (ctorA != ctorB && - !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) && - !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && - ('constructor' in a && 'constructor' in b) - ) { + if (hasValCtor != hasOthCtor) { return false; } + if (!hasValCtor) { + // in older versions of Opera, `arguments` objects have `Array` constructors + var valCtor = valIsArg ? Object : value.constructor, + othCtor = othIsArg ? Object : other.constructor; + + // non `Object` object instances with different constructors are not equal + if (valCtor != othCtor && + !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && + ('constructor' in value && 'constructor' in other) + ) { + return false; + } + } } // assume cyclic structures are equal // the algorithm for detecting cyclic structures is adapted from ES 5.1 @@ -1483,37 +1492,37 @@ var length = stackA.length; while (length--) { - if (stackA[length] == a) { - return stackB[length] == b; + if (stackA[length] == value) { + return stackB[length] == other; } } var size = 0; result = true; - // add `a` and `b` to the stack of traversed objects - stackA.push(a); - stackB.push(b); + // add `value` and `other` to the stack of traversed objects + stackA.push(value); + stackB.push(other); // recursively compare objects and arrays (susceptible to call stack limits) if (isArr) { // compare lengths to determine if a deep comparison is necessary - length = a.length; - size = b.length; + length = value.length; + size = other.length; result = size == length; if (result || isWhere) { // deep compare the contents, ignoring non-numeric properties while (size--) { var index = length, - value = b[size]; + othValue = other[size]; if (isWhere) { while (index--) { - if ((result = baseIsEqual(a[index], value, callback, isWhere, stackA, stackB))) { + if ((result = baseIsEqual(value[index], othValue, callback, isWhere, stackA, stackB))) { break; } } - } else if (!(result = baseIsEqual(a[size], value, callback, isWhere, stackA, stackB))) { + } else if (!(result = baseIsEqual(value[size], othValue, callback, isWhere, stackA, stackB))) { break; } } @@ -1522,20 +1531,20 @@ else { // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` // which, in this case, is more costly - baseForIn(b, function(value, key, b) { - if (hasOwnProperty.call(b, key)) { + baseForIn(other, function(othValue, key, other) { + if (hasOwnProperty.call(other, key)) { // count the number of properties. size++; // deep compare each property value. - return (result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, callback, isWhere, stackA, stackB)); + return (result = hasOwnProperty.call(value, key) && baseIsEqual(value[key], othValue, callback, isWhere, stackA, stackB)); } }); if (result && !isWhere) { // ensure both objects have the same number of properties - baseForIn(a, function(value, key, a) { - if (hasOwnProperty.call(a, key)) { - // `size` will be `-1` if `a` has more properties than `b` + baseForIn(value, function(valValue, key, value) { + if (hasOwnProperty.call(value, key)) { + // `size` will be `-1` if `value` has more properties than `other` return (result = --size > -1); } }); @@ -5958,7 +5967,7 @@ * var object = { 'name': 'fred' }; * var other = { 'name': 'fred' }; * - * object == other; + * object == other; * // => false * * _.isEqual(object, other); @@ -5981,12 +5990,12 @@ // treat `-0` vs. `+0` as not equal return value !== 0 || (1 / value == 1 / other); } - var vType = typeof value, - oType = typeof other; + var valType = typeof value, + othType = typeof other; // exit early for unlike primitive values if (value === value && (value == null || other == null || - (vType != 'function' && vType != 'object' && oType != 'function' && oType != 'object'))) { + (valType != 'function' && valType != 'object' && othType != 'function' && othType != 'object'))) { return false; } } @@ -6670,10 +6679,10 @@ * _.camelCase('Hello world'); * // => 'helloWorld' * - * _.camelCase('hello-world'); + * _.camelCase('--hello-world'); * // => 'helloWorld' * - * _.camelCase('hello_world'); + * _.camelCase('__hello_world__'); * // => 'helloWorld' */ var camelCase = createCompounder(function(result, word, index) { @@ -6793,7 +6802,7 @@ * _.kebabCase('helloWorld'); * // => 'hello-world' * - * _.kebabCase('hello_world'); + * _.kebabCase('__hello_world__'); * // => 'hello-world' */ var kebabCase = createCompounder(function(result, word, index) { @@ -6947,7 +6956,7 @@ * _.snakeCase('Hello world'); * // => 'hello_world' * - * _.snakeCase('hello-world'); + * _.snakeCase('--hello-world'); * // => 'hello_world' * * _.snakeCase('helloWorld'); diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 4197f5c6c..07bd3ca47 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -12,9 +12,9 @@ }}return rr(n,t)}function Z(n){function t(){for(var n=-1,v=arguments.length,y=Or(v);++ni(t,l)&&f.push(l);return f}function ft(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number"&&-1a(p,h)&&((u||f)&&p.push(h),c.push(s))}return c}function kt(n,t){for(var r=-1,e=t(n),u=e.length,o=Or(u);++rr&&(r=0),p&&(i=[]),s&&(a=[]),h=[n,t,r,e,u,o,i,a],t==w||t==(w|C)?c(h):Z(h))}function It(){var n=(n=o.indexOf)===Wt?r:n;return n}function Et(n){return typeof n=="function"&&Pr.test(Zr.call(n))}function Rt(n){var t,r;return n&&Ur.call(n)==rt&&(Yr.call(n,"constructor")||(t=n.constructor,!cr(t)||t instanceof t))?(gt(n,function(n,t){r=t diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 7e1a01b8b..f16b2f735 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -822,7 +822,7 @@ var hasValCtor = hasOwnProperty.call(value, 'constructor'), hasOthCtor = hasOwnProperty.call(other, 'constructor'); - if (hasValCtor !== hasOthCtor) { + if (hasValCtor != hasOthCtor) { return false; } if (!hasValCtor) { @@ -4005,7 +4005,7 @@ * var object = { 'name': 'fred' }; * var other = { 'name': 'fred' }; * - * object == other; + * object == other; * // => false * * _.isEqual(object, other); diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 74f9a4259..8fb71b493 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -7,7 +7,7 @@ if(typeof r=="undefined"||!("prototype"in n))return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return z(n,r)}function c(n){function r(){for(var n=-1,a=arguments.length,c=Array(a);++nu(r,i)&&o.push(i)}return o}function p(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number"&&-1o(f,c)&&(t&&f.push(c),i.push(a)) }return i}function _(n,r){return function(t,e,u){var o=r?[[],[]]:{};e=nr(e,u,3),u=-1;var i=t?t.length:0;if(typeof i=="number"&&-1r?0:r)}function A(r,t,e){var u=r?r.length:0;if(typeof e=="number")e=0>e?Qr(0,u+e):e||0;else if(e)return e=O(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function T(n,r,t){return E(n,null==r||t?1:0>r?0:r)}function E(n,r,t){var e=-1,u=n?n.length:0;for(r=+r||0,0>r?r=Qr(u+r,0):r>u&&(r=u),t=typeof t=="undefined"?u:+t||0,0>t?t=Qr(u+t,0):t>u&&(t=u),u=r>t?0:t-r,t=Array(u);++e