X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=public%2Fbower_components%2Flodash%2Fvendor%2Funderscore%2Funderscore.js;h=78c709bd39124c823e2a1b0b49448afe1bb1fafa;hb=6fdab3092eb5921e04b504e7c4b8d9a83a249fb1;hp=bddfdc9f12acce66093efe25033ff48048e08cd4;hpb=92637af87fcc7d9b13774acc187fd2e85d866a5e;p=motion.git diff --git a/public/bower_components/lodash/vendor/underscore/underscore.js b/public/bower_components/lodash/vendor/underscore/underscore.js index bddfdc9..78c709b 100644 --- a/public/bower_components/lodash/vendor/underscore/underscore.js +++ b/public/bower_components/lodash/vendor/underscore/underscore.js @@ -20,7 +20,6 @@ // Save bytes in the minified (but not gzipped) version: var ArrayProto = Array.prototype, ObjProto = Object.prototype; - var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; // Create quick reference variables for speed access to core prototypes. var push = ArrayProto.push, @@ -219,8 +218,12 @@ // Return the first value which passes a truth test. Aliased as `detect`. _.find = _.detect = function(obj, predicate, context) { - var keyFinder = isArrayLike(obj) ? _.findIndex : _.findKey; - var key = keyFinder(obj, predicate, context); + var key; + if (isArrayLike(obj)) { + key = _.findIndex(obj, predicate, context); + } else { + key = _.findKey(obj, predicate, context); + } if (key !== void 0 && key !== -1) return obj[key]; }; @@ -439,7 +442,7 @@ // Keep surrogate pair characters together return obj.match(reStrSymbol); } - if (isArrayLike(obj)) return _.map(obj); + if (isArrayLike(obj)) return _.map(obj, _.identity); return _.values(obj); }; @@ -491,7 +494,7 @@ // Trim out all falsy values from an array. _.compact = function(array) { - return _.filter(array); + return _.filter(array, _.identity); }; // Internal implementation of a recursive `flatten` function. @@ -856,12 +859,12 @@ }; var debounced = restArgs(function(args) { + var callNow = immediate && !timeout; if (timeout) clearTimeout(timeout); - if (immediate) { - var callNow = !timeout; + if (callNow) { timeout = setTimeout(later, wait); - if (callNow) result = func.apply(this, args); - } else { + result = func.apply(this, args); + } else if (!immediate) { timeout = _.delay(later, wait, this, args); } @@ -1192,8 +1195,6 @@ // millisecond representations. Note that invalid dates with millisecond representations // of `NaN` are not equivalent. return +a === +b; - case '[object Symbol]': - return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); } var areArrays = className === '[object Array]'; @@ -1284,8 +1285,8 @@ return type === 'function' || type === 'object' && !!obj; }; - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError, isMap, isWeakMap, isSet, isWeakSet. - _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error', 'Symbol', 'Map', 'WeakMap', 'Set', 'WeakSet'], function(name) { + // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. + _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error', 'Symbol'], function(name) { _['is' + name] = function(obj) { return toString.call(obj) === '[object ' + name + ']'; };