diff --git a/.gitignore b/.gitignore index 250659f2f..212d21c3a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ node_modules nyc_output coverage test-treeshake/*-umd.js -docs/underscore.js +amd +cjs diff --git a/docs/linked-esm.jst b/docs/linked-esm.jst new file mode 100644 index 000000000..bdeb4cd23 --- /dev/null +++ b/docs/linked-esm.jst @@ -0,0 +1,108 @@ +<% /* + This is an extended version of the resources/parallel/docco.jst that is + bundled with Docco 0.8.0. + The license of the original file is available over here: + https://github.com/jashkenas/docco/blob/master/LICENSE. + The extension adds hyperlinking to javascript import statements. +*/ %> + + + + + <%= title %> + + + + + +
+
+ <% if (sources.length > 1) { %> + + <% } %> + +
+ <% /* Start of hyperlinking extension */ %> + + + <% /* End of hyperlinking extension */ %> + + diff --git a/docs/rollup.config.js b/docs/rollup.config.js deleted file mode 100644 index 06ae2639c..000000000 --- a/docs/rollup.config.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - input: '../modules/index-all.js', - treeshake: false, - output: { - file: 'underscore.js', - exports: 'named', - format: 'esm', - legacy: true, - strict: false, - externalLiveBindings: false, - freeze: false, - }, -}; diff --git a/docs/underscore.html b/docs/underscore-esm.html similarity index 86% rename from docs/underscore.html rename to docs/underscore-esm.html index 3519d2bd2..7c82fa247 100644 --- a/docs/underscore.html +++ b/docs/underscore-esm.html @@ -2,7 +2,7 @@ - underscore.js + underscore-esm.js @@ -15,7 +15,7 @@
  • -

    underscore.js

    +

    underscore-esm.js

  • @@ -28,10 +28,9 @@

    underscore.js

    Underscore.js 1.10.2
    -https://underscorejs.org
    +https://underscorejs.org
     (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
    -Underscore may be freely distributed under the MIT license.
    -
    +Underscore may be freely distributed under the MIT license. @@ -43,10 +42,12 @@

    underscore.js

    -

    Baseline setup

    +

    Current version.

    +
    var VERSION = '1.10.2';
    + @@ -56,18 +57,6 @@

    Baseline setup

    - - - - - - -
  • -
    - -
    - -

    Establish the root object, window (self) in the browser, global on the server, or this in some virtual machines. We use self instead of window for WebWorker support.

    @@ -82,11 +71,11 @@

    Baseline setup

  • -
  • +
  • - +

    Save bytes in the minified (but not gzipped) version:

    @@ -98,11 +87,11 @@

    Baseline setup

  • -
  • +
  • - +

    Create quick reference variables for speed access to core prototypes.

    @@ -116,20 +105,36 @@

    Baseline setup

  • +
  • +
    + +
    + +
    +

    Modern feature detection.

    + +
    + +
    var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined';
    + +
  • + +
  • -

    All ECMAScript 5 native function implementations that we hope to use +

    All ECMAScript 5+ native function implementations that we hope to use are declared here.

    var nativeIsArray = Array.isArray,
         nativeKeys = Object.keys,
    -    nativeCreate = Object.create;
    + nativeCreate = Object.create, + nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
  • @@ -144,8 +149,8 @@

    Baseline setup

    -
    var _isNaN = root.isNaN,
    -    _isFinite = root.isFinite;
    +
    var _isNaN = isNaN,
    +    _isFinite = isFinite;
    @@ -156,11 +161,13 @@

    Baseline setup

    -

    Naked function reference for surrogate-prototype-swapping.

    +

    Keys in IE < 9 that won’t be iterated by for key in ... and thus missed.

    -
    var Ctor = function(){};
    +
    var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
    +var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
    +  'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
    @@ -171,16 +178,11 @@

    Baseline setup

    -

    The Underscore object. All exported functions below are added to it in the -modules/index-all.js using the mixin function.

    +

    The largest integer that can be represented exactly.

    -
    function _(obj) {
    -  if (obj instanceof _) return obj;
    -  if (!(this instanceof _)) return new _(obj);
    -  this._wrapped = obj;
    -}
    +
    var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
    @@ -191,11 +193,22 @@

    Baseline setup

    -

    Current version.

    +

    If Underscore is called as a function, it returns a wrapped object that +can be used OO-style. This wrapper holds altered versions of all the +underscore functions. Wrapped objects may be chained.

    +

    Unwrapping methods and Array.prototype methods are added in the +underscore-oop.js module. All public Underscore functions are added to it +in the index-default.js using the _.mixin function.

    -
    var VERSION = _.VERSION = '1.10.2';
    +
    function _(obj) {
    +  if (obj instanceof _) return obj;
    +  if (!(this instanceof _)) return new _(obj);
    +  this._wrapped = obj;
    +}
    +
    +_.VERSION = VERSION;
    @@ -206,18 +219,13 @@

    Baseline setup

    -

    Internal function that returns an efficient (for current engines) version -of the passed-in callback, to be repeatedly applied in other Underscore -functions.

    +

    Keep the identity function around for default iteratees.

    -
    function optimizeCb(func, context, argCount) {
    -  if (context === void 0) return func;
    -  switch (argCount == null ? 3 : argCount) {
    -    case 1: return function(value) {
    -      return func.call(context, value);
    -    };
    +
    function identity(value) {
    +  return value;
    +}
    @@ -228,21 +236,17 @@

    Baseline setup

    -

    The 2-argument case is omitted because we’re not using it.

    +

    Internal function for creating a toString-based type tester.

    -
        case 3: return function(value, index, collection) {
    -      return func.call(context, value, index, collection);
    -    };
    -    case 4: return function(accumulator, value, index, collection) {
    -      return func.call(context, accumulator, value, index, collection);
    -    };
    -  }
    -  return function() {
    -    return func.apply(context, arguments);
    +            
    function tagTester(name) {
    +  return function(obj) {
    +    return toString.call(obj) === '[object ' + name + ']';
       };
    -}
    +} + +var isFunction = tagTester('Function');
    @@ -253,18 +257,19 @@

    Baseline setup

    -

    An internal function to generate callbacks that can be applied to each -element in a collection, returning the desired result — either identity, -an arbitrary callback, a property matcher, or a property accessor.

    +

    Optimize isFunction if appropriate. Work around some typeof bugs in old v8, +IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).

    -
    function baseIteratee(value, context, argCount) {
    -  if (value == null) return identity;
    -  if (isFunction(value)) return optimizeCb(value, context, argCount);
    -  if (isObject(value) && !isArray(value)) return matcher(value);
    -  return property(value);
    -}
    +
    var nodelist = root.document && root.document.childNodes;
    +if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
    +  isFunction = function(obj) {
    +    return typeof obj == 'function' || false;
    +  };
    +}
    +
    +var isFunction$1 = isFunction;
    @@ -275,15 +280,13 @@

    Baseline setup

    -

    External wrapper for our callback generator. Users may customize -_.iteratee if they want additional predicate/iteratee shorthand styles. -This abstraction hides the internal-only argCount argument.

    +

    Is a given variable an object?

    -
    _.iteratee = iteratee;
    -function iteratee(value, context) {
    -  return baseIteratee(value, context, Infinity);
    +            
    function isObject(obj) {
    +  var type = typeof obj;
    +  return type === 'function' || type === 'object' && !!obj;
     }
    @@ -295,15 +298,18 @@

    Baseline setup

    -

    The function we actually call internally. It invokes _.iteratee if -overridden, otherwise baseIteratee.

    +

    Internal function that returns an efficient (for current engines) version +of the passed-in callback, to be repeatedly applied in other Underscore +functions.

    -
    function cb(value, context, argCount) {
    -  if (_.iteratee !== iteratee) return _.iteratee(value, context);
    -  return baseIteratee(value, context, argCount);
    -}
    +
    function optimizeCb(func, context, argCount) {
    +  if (context === void 0) return func;
    +  switch (argCount == null ? 3 : argCount) {
    +    case 1: return function(value) {
    +      return func.call(context, value);
    +    };
    @@ -314,34 +320,19 @@

    Baseline setup

    -

    Some functions take a variable number of arguments, or a few expected -arguments at the beginning and then a variable number of values to operate -on. This helper accumulates all remaining arguments past the function’s -argument length (or an explicit startIndex), into an array that becomes -the last argument. Similar to ES6’s “rest parameter”.

    +

    The 2-argument case is omitted because we’re not using it.

    -
    function restArguments(func, startIndex) {
    -  startIndex = startIndex == null ? func.length - 1 : +startIndex;
    +            
        case 3: return function(value, index, collection) {
    +      return func.call(context, value, index, collection);
    +    };
    +    case 4: return function(accumulator, value, index, collection) {
    +      return func.call(context, accumulator, value, index, collection);
    +    };
    +  }
       return function() {
    -    var length = Math.max(arguments.length - startIndex, 0),
    -        rest = Array(length),
    -        index = 0;
    -    for (; index < length; index++) {
    -      rest[index] = arguments[index + startIndex];
    -    }
    -    switch (startIndex) {
    -      case 0: return func.call(this, rest);
    -      case 1: return func.call(this, arguments[0], rest);
    -      case 2: return func.call(this, arguments[0], arguments[1], rest);
    -    }
    -    var args = Array(startIndex + 1);
    -    for (index = 0; index < startIndex; index++) {
    -      args[index] = arguments[index];
    -    }
    -    args[startIndex] = rest;
    -    return func.apply(this, args);
    +    return func.apply(context, arguments);
       };
     }
    @@ -354,37 +345,12 @@

    Baseline setup

    -

    An internal function for creating a new object that inherits from another.

    +

    Is a given value an array? +Delegates to ECMA5’s native Array.isArray

    -
    function baseCreate(prototype) {
    -  if (!isObject(prototype)) return {};
    -  if (nativeCreate) return nativeCreate(prototype);
    -  Ctor.prototype = prototype;
    -  var result = new Ctor;
    -  Ctor.prototype = null;
    -  return result;
    -}
    -
    -function shallowProperty(key) {
    -  return function(obj) {
    -    return obj == null ? void 0 : obj[key];
    -  };
    -}
    -
    -function _has(obj, path) {
    -  return obj != null && hasOwnProperty.call(obj, path);
    -}
    -
    -function deepGet(obj, path) {
    -  var length = path.length;
    -  for (var i = 0; i < length; i++) {
    -    if (obj == null) return void 0;
    -    obj = obj[path[i]];
    -  }
    -  return length ? obj : void 0;
    -}
    +
    var isArray = nativeIsArray || tagTester('Array');
    @@ -395,18 +361,30 @@

    Baseline setup

    -

    Helper for collection methods to determine whether a collection -should be iterated as an array or as an object. -Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength -Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094

    +

    An internal function for creating assigner functions.

    -
    var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
    -var getLength = shallowProperty('length');
    -function isArrayLike(collection) {
    -  var length = getLength(collection);
    -  return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
    +            
    function createAssigner(keysFunc, defaults) {
    +  return function(obj) {
    +    var length = arguments.length;
    +    if (defaults) obj = Object(obj);
    +    if (length < 2 || obj == null) return obj;
    +    for (var index = 1; index < length; index++) {
    +      var source = arguments[index],
    +          keys = keysFunc(source),
    +          l = keys.length;
    +      for (var i = 0; i < l; i++) {
    +        var key = keys[i];
    +        if (!defaults || obj[key] === void 0) obj[key] = source[key];
    +      }
    +    }
    +    return obj;
    +  };
    +}
    +
    +function has(obj, path) {
    +  return obj != null && hasOwnProperty.call(obj, path);
     }
    @@ -418,10 +396,24 @@

    Baseline setup

    -

    Collection Functions

    +

    collectNonEnumProps used to depend on _.contains, but this led to +circular imports. emulatedSet is a one-off solution that only works for +arrays of strings.

    +
    function emulatedSet(keys) {
    +  var hash = {};
    +  for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
    +  return {
    +    contains: function(key) { return hash[key]; },
    +    push: function(key) {
    +      hash[key] = true;
    +      return keys.push(key);
    +    }
    +  };
    +}
    + @@ -431,9 +423,16 @@

    Collection Functions

    - +

    Keys in IE < 9 that won’t be iterated by for key in ... and thus missed.

    +
    +
    function collectNonEnumProps(obj, keys) {
    +  keys = emulatedSet(keys);
    +  var nonEnumIdx = nonEnumerableProps.length;
    +  var constructor = obj.constructor;
    +  var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;
    + @@ -443,26 +442,19 @@

    Collection Functions

    -

    The cornerstone, an each implementation, aka forEach. -Handles raw objects in addition to array-likes. Treats all -sparse array-likes as if they were dense.

    +

    Constructor is a special case.

    -
    function each(obj, iteratee, context) {
    -  iteratee = optimizeCb(iteratee, context);
    -  var i, length;
    -  if (isArrayLike(obj)) {
    -    for (i = 0, length = obj.length; i < length; i++) {
    -      iteratee(obj[i], i, obj);
    -    }
    -  } else {
    -    var _keys = keys(obj);
    -    for (i = 0, length = _keys.length; i < length; i++) {
    -      iteratee(obj[_keys[i]], _keys[i], obj);
    +            
      var prop = 'constructor';
    +  if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);
    +
    +  while (nonEnumIdx--) {
    +    prop = nonEnumerableProps[nonEnumIdx];
    +    if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
    +      keys.push(prop);
         }
       }
    -  return obj;
     }
    @@ -474,21 +466,16 @@

    Collection Functions

    -

    Return the results of applying the iteratee to each element.

    +

    Retrieve the names of an object’s own properties. +Delegates to ECMAScript 5‘s native Object.keys.

    -
    function map(obj, iteratee, context) {
    -  iteratee = cb(iteratee, context);
    -  var _keys = !isArrayLike(obj) && keys(obj),
    -      length = (_keys || obj).length,
    -      results = Array(length);
    -  for (var index = 0; index < length; index++) {
    -    var currentKey = _keys ? _keys[index] : index;
    -    results[index] = iteratee(obj[currentKey], currentKey, obj);
    -  }
    -  return results;
    -}
    +
    function keys(obj) {
    +  if (!isObject(obj)) return [];
    +  if (nativeKeys) return nativeKeys(obj);
    +  var keys = [];
    +  for (var key in obj) if (has(obj, key)) keys.push(key);
    @@ -499,11 +486,13 @@

    Collection Functions

    -

    Create a reducing function iterating left or right.

    +

    Ahem, IE < 9.

    -
    function createReduce(dir) {
    +
      if (hasEnumBug) collectNonEnumProps(obj, keys);
    +  return keys;
    +}
    @@ -514,31 +503,12 @@

    Collection Functions

    -

    Wrap code that reassigns argument variables in a separate function than -the one that accesses arguments.length to avoid a perf hit. (#1991)

    - +

    Assigns a given object with all the own properties in the passed-in object(s). +(https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)

    + -
      var reducer = function(obj, iteratee, memo, initial) {
    -    var _keys = !isArrayLike(obj) && keys(obj),
    -        length = (_keys || obj).length,
    -        index = dir > 0 ? 0 : length - 1;
    -    if (!initial) {
    -      memo = obj[_keys ? _keys[index] : index];
    -      index += dir;
    -    }
    -    for (; index >= 0 && index < length; index += dir) {
    -      var currentKey = _keys ? _keys[index] : index;
    -      memo = iteratee(memo, obj[currentKey], currentKey, obj);
    -    }
    -    return memo;
    -  };
    -
    -  return function(obj, iteratee, memo, context) {
    -    var initial = arguments.length >= 3;
    -    return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);
    -  };
    -}
    +
    var extendOwn = createAssigner(keys);
    @@ -549,12 +519,20 @@

    Collection Functions

    -

    Reduce builds up a single result from a list of values, aka inject, -or foldl.

    +

    Returns whether an object has a given set of key:value pairs.

    -
    var reduce = createReduce(1);
    +
    function isMatch(object, attrs) {
    +  var _keys = keys(attrs), length = _keys.length;
    +  if (object == null) return !length;
    +  var obj = Object(object);
    +  for (var i = 0; i < length; i++) {
    +    var key = _keys[i];
    +    if (attrs[key] !== obj[key] || !(key in obj)) return false;
    +  }
    +  return true;
    +}
    @@ -565,11 +543,32 @@

    Collection Functions

    -

    The right-associative version of reduce, also known as foldr.

    +

    Returns a predicate for checking whether an object has a given set of +key:value pairs.

    -
    var reduceRight = createReduce(-1);
    +
    function matcher(attrs) {
    +  attrs = extendOwn({}, attrs);
    +  return function(obj) {
    +    return isMatch(obj, attrs);
    +  };
    +}
    +
    +function shallowProperty(key) {
    +  return function(obj) {
    +    return obj == null ? void 0 : obj[key];
    +  };
    +}
    +
    +function deepGet(obj, path) {
    +  var length = path.length;
    +  for (var i = 0; i < length; i++) {
    +    if (obj == null) return void 0;
    +    obj = obj[path[i]];
    +  }
    +  return length ? obj : void 0;
    +}
    @@ -580,14 +579,18 @@

    Collection Functions

    -

    Return the first value which passes a truth test.

    +

    Creates a function that, when passed an object, will traverse that object’s +properties down the given path, specified as an array of keys or indexes.

    -
    function find(obj, predicate, context) {
    -  var keyFinder = isArrayLike(obj) ? findIndex : findKey;
    -  var key = keyFinder(obj, predicate, context);
    -  if (key !== void 0 && key !== -1) return obj[key];
    +            
    function property(path) {
    +  if (!isArray(path)) {
    +    return shallowProperty(path);
    +  }
    +  return function(obj) {
    +    return deepGet(obj, path);
    +  };
     }
    @@ -599,17 +602,17 @@

    Collection Functions

    -

    Return all the elements that pass a truth test.

    +

    An internal function to generate callbacks that can be applied to each +element in a collection, returning the desired result — either identity, +an arbitrary callback, a property matcher, or a property accessor.

    -
    function filter(obj, predicate, context) {
    -  var results = [];
    -  predicate = cb(predicate, context);
    -  each(obj, function(value, index, list) {
    -    if (predicate(value, index, list)) results.push(value);
    -  });
    -  return results;
    +            
    function baseIteratee(value, context, argCount) {
    +  if (value == null) return identity;
    +  if (isFunction$1(value)) return optimizeCb(value, context, argCount);
    +  if (isObject(value) && !isArray(value)) return matcher(value);
    +  return property(value);
     }
    @@ -621,13 +624,16 @@

    Collection Functions

    -

    Return all the elements for which a truth test fails.

    +

    External wrapper for our callback generator. Users may customize +_.iteratee if they want additional predicate/iteratee shorthand styles. +This abstraction hides the internal-only argCount argument.

    -
    function reject(obj, predicate, context) {
    -  return filter(obj, negate(cb(predicate)), context);
    -}
    +
    function iteratee(value, context) {
    +  return baseIteratee(value, context, Infinity);
    +}
    +_.iteratee = iteratee;
    @@ -638,19 +644,35 @@

    Collection Functions

    -

    Determine whether all of the elements match a truth test.

    +

    Some functions take a variable number of arguments, or a few expected +arguments at the beginning and then a variable number of values to operate +on. This helper accumulates all remaining arguments past the function’s +argument length (or an explicit startIndex), into an array that becomes +the last argument. Similar to ES6’s “rest parameter”.

    -
    function every(obj, predicate, context) {
    -  predicate = cb(predicate, context);
    -  var _keys = !isArrayLike(obj) && keys(obj),
    -      length = (_keys || obj).length;
    -  for (var index = 0; index < length; index++) {
    -    var currentKey = _keys ? _keys[index] : index;
    -    if (!predicate(obj[currentKey], currentKey, obj)) return false;
    -  }
    -  return true;
    +            
    function restArguments(func, startIndex) {
    +  startIndex = startIndex == null ? func.length - 1 : +startIndex;
    +  return function() {
    +    var length = Math.max(arguments.length - startIndex, 0),
    +        rest = Array(length),
    +        index = 0;
    +    for (; index < length; index++) {
    +      rest[index] = arguments[index + startIndex];
    +    }
    +    switch (startIndex) {
    +      case 0: return func.call(this, rest);
    +      case 1: return func.call(this, arguments[0], rest);
    +      case 2: return func.call(this, arguments[0], arguments[1], rest);
    +    }
    +    var args = Array(startIndex + 1);
    +    for (index = 0; index < startIndex; index++) {
    +      args[index] = arguments[index];
    +    }
    +    args[startIndex] = rest;
    +    return func.apply(this, args);
    +  };
     }
    @@ -662,20 +684,18 @@

    Collection Functions

    -

    Determine if at least one element in the object matches a truth test.

    +

    Common logic for isArrayLike and isBufferLike.

    -
    function some(obj, predicate, context) {
    -  predicate = cb(predicate, context);
    -  var _keys = !isArrayLike(obj) && keys(obj),
    -      length = (_keys || obj).length;
    -  for (var index = 0; index < length; index++) {
    -    var currentKey = _keys ? _keys[index] : index;
    -    if (predicate(obj[currentKey], currentKey, obj)) return true;
    +            
    function createSizePropertyCheck(getSizeProperty) {
    +  return function(collection) {
    +    var sizeProperty = getSizeProperty(collection);
    +    return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;
       }
    -  return false;
    -}
    +} + +var getLength = shallowProperty('length');
    @@ -686,15 +706,14 @@

    Collection Functions

    -

    Determine if the array or object contains a given item (using ===).

    +

    Helper for collection methods to determine whether a collection +should be iterated as an array or as an object. +Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength +Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094

    -
    function contains(obj, item, fromIndex, guard) {
    -  if (!isArrayLike(obj)) obj = values(obj);
    -  if (typeof fromIndex != 'number' || guard) fromIndex = 0;
    -  return indexOf(obj, item, fromIndex) >= 0;
    -}
    +
    var isArrayLike = createSizePropertyCheck(getLength);
    @@ -705,30 +724,28 @@

    Collection Functions

    -

    Invoke a method (with arguments) on every item in a collection.

    +

    The cornerstone for collection functions, an each +implementation, aka forEach. +Handles raw objects in addition to array-likes. Treats all +sparse array-likes as if they were dense.

    -
    var invoke = restArguments(function(obj, path, args) {
    -  var contextPath, func;
    -  if (isFunction(path)) {
    -    func = path;
    -  } else if (isArray(path)) {
    -    contextPath = path.slice(0, -1);
    -    path = path[path.length - 1];
    -  }
    -  return map(obj, function(context) {
    -    var method = func;
    -    if (!method) {
    -      if (contextPath && contextPath.length) {
    -        context = deepGet(context, contextPath);
    -      }
    -      if (context == null) return void 0;
    -      method = context[path];
    +            
    function each(obj, iteratee, context) {
    +  iteratee = optimizeCb(iteratee, context);
    +  var i, length;
    +  if (isArrayLike(obj)) {
    +    for (i = 0, length = obj.length; i < length; i++) {
    +      iteratee(obj[i], i, obj);
         }
    -    return method == null ? method : method.apply(context, args);
    -  });
    -});
    + } else { + var _keys = keys(obj); + for (i = 0, length = _keys.length; i < length; i++) { + iteratee(obj[_keys[i]], _keys[i], obj); + } + } + return obj; +}
    @@ -739,12 +756,14 @@

    Collection Functions

    -

    Convenience version of a common use case of map: fetching a property.

    +

    The function we call internally to generate a callback. It invokes +_.iteratee if overridden, otherwise baseIteratee.

    -
    function pluck(obj, key) {
    -  return map(obj, property(key));
    +            
    function cb(value, context, argCount) {
    +  if (_.iteratee !== iteratee) return _.iteratee(value, context);
    +  return baseIteratee(value, context, argCount);
     }
    @@ -756,13 +775,20 @@

    Collection Functions

    -

    Convenience version of a common use case of filter: selecting only objects -containing specific key:value pairs.

    +

    Return the results of applying the iteratee to each element.

    -
    function where(obj, attrs) {
    -  return filter(obj, matcher(attrs));
    +            
    function map(obj, iteratee, context) {
    +  iteratee = cb(iteratee, context);
    +  var _keys = !isArrayLike(obj) && keys(obj),
    +      length = (_keys || obj).length,
    +      results = Array(length);
    +  for (var index = 0; index < length; index++) {
    +    var currentKey = _keys ? _keys[index] : index;
    +    results[index] = iteratee(obj[currentKey], currentKey, obj);
    +  }
    +  return results;
     }
    @@ -774,14 +800,11 @@

    Collection Functions

    -

    Convenience version of a common use case of find: getting the first object -containing specific key:value pairs.

    +

    Create a reducing function iterating left or right.

    -
    function findWhere(obj, attrs) {
    -  return find(obj, matcher(attrs));
    -}
    +
    function createReduce(dir) {
    @@ -792,36 +815,34 @@

    Collection Functions

    -

    Return the maximum element (or element-based computation).

    +

    Wrap code that reassigns argument variables in a separate function than +the one that accesses arguments.length to avoid a perf hit. (#1991)

    -
    function max(obj, iteratee, context) {
    -  var result = -Infinity, lastComputed = -Infinity,
    -      value, computed;
    -  if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
    -    obj = isArrayLike(obj) ? obj : values(obj);
    -    for (var i = 0, length = obj.length; i < length; i++) {
    -      value = obj[i];
    -      if (value != null && value > result) {
    -        result = value;
    -      }
    +            
      var reducer = function(obj, iteratee, memo, initial) {
    +    var _keys = !isArrayLike(obj) && keys(obj),
    +        length = (_keys || obj).length,
    +        index = dir > 0 ? 0 : length - 1;
    +    if (!initial) {
    +      memo = obj[_keys ? _keys[index] : index];
    +      index += dir;
         }
    -  } else {
    -    iteratee = cb(iteratee, context);
    -    each(obj, function(v, index, list) {
    -      computed = iteratee(v, index, list);
    -      if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
    -        result = v;
    -        lastComputed = computed;
    -      }
    -    });
    -  }
    -  return result;
    -}
    - - - + for (; index >= 0 && index < length; index += dir) { + var currentKey = _keys ? _keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + }; + + return function(obj, iteratee, memo, context) { + var initial = arguments.length >= 3; + return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); + }; +}
    + + +
  • @@ -829,33 +850,12 @@

    Collection Functions

    -

    Return the minimum element (or element-based computation).

    +

    Reduce builds up a single result from a list of values, aka inject, +or foldl.

    -
    function min(obj, iteratee, context) {
    -  var result = Infinity, lastComputed = Infinity,
    -      value, computed;
    -  if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
    -    obj = isArrayLike(obj) ? obj : values(obj);
    -    for (var i = 0, length = obj.length; i < length; i++) {
    -      value = obj[i];
    -      if (value != null && value < result) {
    -        result = value;
    -      }
    -    }
    -  } else {
    -    iteratee = cb(iteratee, context);
    -    each(obj, function(v, index, list) {
    -      computed = iteratee(v, index, list);
    -      if (computed < lastComputed || computed === Infinity && result === Infinity) {
    -        result = v;
    -        lastComputed = computed;
    -      }
    -    });
    -  }
    -  return result;
    -}
    +
    var reduce = createReduce(1);
  • @@ -866,13 +866,11 @@

    Collection Functions

    -

    Shuffle a collection.

    +

    The right-associative version of reduce, also known as foldr.

    -
    function shuffle(obj) {
    -  return sample(obj, Infinity);
    -}
    +
    var reduceRight = createReduce(-1);
    @@ -883,29 +881,20 @@

    Collection Functions

    -

    Sample n random values from a collection using the modern version of the -Fisher-Yates shuffle. -If n is not specified, returns a single random element. -The internal guard argument allows it to work with map.

    +

    Internal function to generate the findIndex and findLastIndex functions.

    -
    function sample(obj, n, guard) {
    -  if (n == null || guard) {
    -    if (!isArrayLike(obj)) obj = values(obj);
    -    return obj[random(obj.length - 1)];
    -  }
    -  var sample = isArrayLike(obj) ? clone(obj) : values(obj);
    -  var length = getLength(sample);
    -  n = Math.max(Math.min(n, length), 0);
    -  var last = length - 1;
    -  for (var index = 0; index < n; index++) {
    -    var rand = random(index, last);
    -    var temp = sample[index];
    -    sample[index] = sample[rand];
    -    sample[rand] = temp;
    -  }
    -  return sample.slice(0, n);
    +            
    function createPredicateIndexFinder(dir) {
    +  return function(array, predicate, context) {
    +    predicate = cb(predicate, context);
    +    var length = getLength(array);
    +    var index = dir > 0 ? 0 : length - 1;
    +    for (; index >= 0 && index < length; index += dir) {
    +      if (predicate(array[index], index, array)) return index;
    +    }
    +    return -1;
    +  };
     }
    @@ -917,29 +906,11 @@

    Collection Functions

    -

    Sort the object’s values by a criterion produced by an iteratee.

    +

    Returns the first index on an array-like that passes a predicate test.

    -
    function sortBy(obj, iteratee, context) {
    -  var index = 0;
    -  iteratee = cb(iteratee, context);
    -  return pluck(map(obj, function(value, key, list) {
    -    return {
    -      value: value,
    -      index: index++,
    -      criteria: iteratee(value, key, list)
    -    };
    -  }).sort(function(left, right) {
    -    var a = left.criteria;
    -    var b = right.criteria;
    -    if (a !== b) {
    -      if (a > b || a === void 0) return 1;
    -      if (a < b || b === void 0) return -1;
    -    }
    -    return left.index - right.index;
    -  }), 'value');
    -}
    +
    var findIndex = createPredicateIndexFinder(1);
    @@ -950,20 +921,17 @@

    Collection Functions

    -

    An internal function used for aggregate “group by” operations.

    +

    Returns the first key on an object that passes a predicate test.

    -
    function group(behavior, partition) {
    -  return function(obj, iteratee, context) {
    -    var result = partition ? [[], []] : {};
    -    iteratee = cb(iteratee, context);
    -    each(obj, function(value, index) {
    -      var key = iteratee(value, index, obj);
    -      behavior(result, value, key);
    -    });
    -    return result;
    -  };
    +            
    function findKey(obj, predicate, context) {
    +  predicate = cb(predicate, context);
    +  var _keys = keys(obj), key;
    +  for (var i = 0, length = _keys.length; i < length; i++) {
    +    key = _keys[i];
    +    if (predicate(obj[key], key, obj)) return key;
    +  }
     }
    @@ -975,14 +943,15 @@

    Collection Functions

    -

    Groups the object’s values by a criterion. Pass either a string attribute -to group by, or a function that returns the criterion.

    +

    Return the first value which passes a truth test.

    -
    var groupBy = group(function(result, value, key) {
    -  if (_has(result, key)) result[key].push(value); else result[key] = [value];
    -});
    +
    function find(obj, predicate, context) {
    +  var keyFinder = isArrayLike(obj) ? findIndex : findKey;
    +  var key = keyFinder(obj, predicate, context);
    +  if (key !== void 0 && key !== -1) return obj[key];
    +}
    @@ -993,14 +962,18 @@

    Collection Functions

    -

    Indexes the object’s values by a criterion, similar to groupBy, but for -when you know that your index values will be unique.

    +

    Return all the elements that pass a truth test.

    -
    var indexBy = group(function(result, value, key) {
    -  result[key] = value;
    -});
    +
    function filter(obj, predicate, context) {
    +  var results = [];
    +  predicate = cb(predicate, context);
    +  each(obj, function(value, index, list) {
    +    if (predicate(value, index, list)) results.push(value);
    +  });
    +  return results;
    +}
    @@ -1011,17 +984,15 @@

    Collection Functions

    -

    Counts instances of an object that group by a certain criterion. Pass -either a string attribute to count by, or a function that returns the -criterion.

    +

    Returns a negated version of the passed-in predicate.

    -
    var countBy = group(function(result, value, key) {
    -  if (_has(result, key)) result[key]++; else result[key] = 1;
    -});
    -
    -var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
    +
    function negate(predicate) {
    +  return function() {
    +    return !predicate.apply(this, arguments);
    +  };
    +}
    @@ -1032,14 +1003,13 @@

    Collection Functions

    -

    Safely create a real, live array from anything iterable.

    +

    Return all the elements for which a truth test fails.

    -
    function toArray(obj) {
    -  if (!obj) return [];
    -  if (isArray(obj)) return slice.call(obj);
    -  if (isString(obj)) {
    +
    function reject(obj, predicate, context) {
    +  return filter(obj, negate(cb(predicate)), context);
    +}
    @@ -1050,14 +1020,19 @@

    Collection Functions

    -

    Keep surrogate pair characters together

    +

    Determine whether all of the elements match a truth test.

    -
        return obj.match(reStrSymbol);
    +            
    function every(obj, predicate, context) {
    +  predicate = cb(predicate, context);
    +  var _keys = !isArrayLike(obj) && keys(obj),
    +      length = (_keys || obj).length;
    +  for (var index = 0; index < length; index++) {
    +    var currentKey = _keys ? _keys[index] : index;
    +    if (!predicate(obj[currentKey], currentKey, obj)) return false;
       }
    -  if (isArrayLike(obj)) return map(obj, identity);
    -  return values(obj);
    +  return true;
     }
    @@ -1069,13 +1044,19 @@

    Collection Functions

    -

    Return the number of elements in an object.

    +

    Determine if at least one element in the object matches a truth test.

    -
    function size(obj) {
    -  if (obj == null) return 0;
    -  return isArrayLike(obj) ? obj.length : keys(obj).length;
    +            
    function some(obj, predicate, context) {
    +  predicate = cb(predicate, context);
    +  var _keys = !isArrayLike(obj) && keys(obj),
    +      length = (_keys || obj).length;
    +  for (var index = 0; index < length; index++) {
    +    var currentKey = _keys ? _keys[index] : index;
    +    if (predicate(obj[currentKey], currentKey, obj)) return true;
    +  }
    +  return false;
     }
    @@ -1087,14 +1068,19 @@

    Collection Functions

    -

    Split a collection into two arrays: one whose elements all satisfy the given -predicate, and one whose elements all do not satisfy the predicate.

    +

    Retrieve the values of an object’s properties.

    -
    var partition = group(function(result, value, pass) {
    -  result[pass ? 0 : 1].push(value);
    -}, true);
    +
    function values(obj) {
    +  var _keys = keys(obj);
    +  var length = _keys.length;
    +  var values = Array(length);
    +  for (var i = 0; i < length; i++) {
    +    values[i] = obj[_keys[i]];
    +  }
    +  return values;
    +}
    @@ -1105,10 +1091,24 @@

    Collection Functions

    -

    Array Functions

    +

    Use a comparator function to figure out the smallest index at which +an object should be inserted so as to maintain order. Uses binary search.

    +
    function sortedIndex(array, obj, iteratee, context) {
    +  iteratee = cb(iteratee, context, 1);
    +  var value = iteratee(obj);
    +  var low = 0, high = getLength(array);
    +  while (low < high) {
    +    var mid = Math.floor((low + high) / 2);
    +    if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
    +  }
    +  return low;
    +}
    +
    +var isNumber = tagTester('Number');
    + @@ -1118,9 +1118,14 @@

    Array Functions

    - +

    Is the given value NaN?

    +
    +
    function isNaN$1(obj) {
    +  return isNumber(obj) && _isNaN(obj);
    +}
    + @@ -1130,15 +1135,32 @@

    Array Functions

    -

    Get the first element of an array. Passing n will return the first N -values in the array. The guard check allows it to work with map.

    +

    Internal function to generate the indexOf and lastIndexOf functions.

    -
    function first(array, n, guard) {
    -  if (array == null || array.length < 1) return n == null ? void 0 : [];
    -  if (n == null || guard) return array[0];
    -  return initial(array, array.length - n);
    +            
    function createIndexFinder(dir, predicateFind, sortedIndex) {
    +  return function(array, item, idx) {
    +    var i = 0, length = getLength(array);
    +    if (typeof idx == 'number') {
    +      if (dir > 0) {
    +        i = idx >= 0 ? idx : Math.max(idx + length, i);
    +      } else {
    +        length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
    +      }
    +    } else if (sortedIndex && idx && length) {
    +      idx = sortedIndex(array, item);
    +      return array[idx] === item ? idx : -1;
    +    }
    +    if (item !== item) {
    +      idx = predicateFind(slice.call(array, i, length), isNaN$1);
    +      return idx >= 0 ? idx + i : -1;
    +    }
    +    for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
    +      if (array[idx] === item) return idx;
    +    }
    +    return -1;
    +  };
     }
    @@ -1150,15 +1172,14 @@

    Array Functions

    -

    Returns everything but the last entry of the array. Especially useful on -the arguments object. Passing n will return all the values in -the array, excluding the last N.

    +

    Return the position of the first occurrence of an item in an array, +or -1 if the item is not included in the array. +If the array is large and already in sort order, pass true +for isSorted to use binary search.

    -
    function initial(array, n, guard) {
    -  return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
    -}
    +
    var indexOf = createIndexFinder(1, findIndex, sortedIndex);
    @@ -1169,16 +1190,15 @@

    Array Functions

    -

    Get the last element of an array. Passing n will return the last N -values in the array.

    +

    Determine if the array or object contains a given item (using ===).

    -
    function last(array, n, guard) {
    -  if (array == null || array.length < 1) return n == null ? void 0 : [];
    -  if (n == null || guard) return array[array.length - 1];
    -  return rest(array, Math.max(0, array.length - n));
    -}
    +
    function contains(obj, item, fromIndex, guard) {
    +  if (!isArrayLike(obj)) obj = values(obj);
    +  if (typeof fromIndex != 'number' || guard) fromIndex = 0;
    +  return indexOf(obj, item, fromIndex) >= 0;
    +}
    @@ -1189,15 +1209,30 @@

    Array Functions

    -

    Returns everything but the first entry of the array. Especially useful on -the arguments object. Passing an n will return the rest N values in the -array.

    +

    Invoke a method (with arguments) on every item in a collection.

    -
    function rest(array, n, guard) {
    -  return slice.call(array, n == null || guard ? 1 : n);
    -}
    +
    var invoke = restArguments(function(obj, path, args) {
    +  var contextPath, func;
    +  if (isFunction$1(path)) {
    +    func = path;
    +  } else if (isArray(path)) {
    +    contextPath = path.slice(0, -1);
    +    path = path[path.length - 1];
    +  }
    +  return map(obj, function(context) {
    +    var method = func;
    +    if (!method) {
    +      if (contextPath && contextPath.length) {
    +        context = deepGet(context, contextPath);
    +      }
    +      if (context == null) return void 0;
    +      method = context[path];
    +    }
    +    return method == null ? method : method.apply(context, args);
    +  });
    +});
    @@ -1208,12 +1243,12 @@

    Array Functions

    -

    Trim out all falsy values from an array.

    +

    Convenience version of a common use case of map: fetching a property.

    -
    function compact(array) {
    -  return filter(array, Boolean);
    +            
    function pluck(obj, key) {
    +  return map(obj, property(key));
     }
    @@ -1225,16 +1260,14 @@

    Array Functions

    -

    Internal implementation of a recursive flatten function.

    +

    Convenience version of a common use case of filter: selecting only objects +containing specific key:value pairs.

    -
    function _flatten(input, shallow, strict, output) {
    -  output = output || [];
    -  var idx = output.length;
    -  for (var i = 0, length = getLength(input); i < length; i++) {
    -    var value = input[i];
    -    if (isArrayLike(value) && (isArray(value) || isArguments(value))) {
    +
    function where(obj, attrs) {
    +  return filter(obj, matcher(attrs));
    +}
    @@ -1245,22 +1278,13 @@

    Array Functions

    -

    Flatten current level of array or arguments object.

    +

    Convenience version of a common use case of find: getting the first object +containing specific key:value pairs.

    -
          if (shallow) {
    -        var j = 0, len = value.length;
    -        while (j < len) output[idx++] = value[j++];
    -      } else {
    -        _flatten(value, shallow, strict, output);
    -        idx = output.length;
    -      }
    -    } else if (!strict) {
    -      output[idx++] = value;
    -    }
    -  }
    -  return output;
    +            
    function findWhere(obj, attrs) {
    +  return find(obj, matcher(attrs));
     }
    @@ -1272,12 +1296,32 @@

    Array Functions

    -

    Flatten out an array, either recursively (by default), or just one level.

    +

    Return the maximum element (or element-based computation).

    -
    function flatten(array, shallow) {
    -  return _flatten(array, shallow, false);
    +            
    function max(obj, iteratee, context) {
    +  var result = -Infinity, lastComputed = -Infinity,
    +      value, computed;
    +  if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
    +    obj = isArrayLike(obj) ? obj : values(obj);
    +    for (var i = 0, length = obj.length; i < length; i++) {
    +      value = obj[i];
    +      if (value != null && value > result) {
    +        result = value;
    +      }
    +    }
    +  } else {
    +    iteratee = cb(iteratee, context);
    +    each(obj, function(v, index, list) {
    +      computed = iteratee(v, index, list);
    +      if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
    +        result = v;
    +        lastComputed = computed;
    +      }
    +    });
    +  }
    +  return result;
     }
    @@ -1289,13 +1333,33 @@

    Array Functions

    -

    Return a version of the array that does not contain the specified value(s).

    +

    Return the minimum element (or element-based computation).

    -
    var without = restArguments(function(array, otherArrays) {
    -  return difference(array, otherArrays);
    -});
    +
    function min(obj, iteratee, context) {
    +  var result = Infinity, lastComputed = Infinity,
    +      value, computed;
    +  if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
    +    obj = isArrayLike(obj) ? obj : values(obj);
    +    for (var i = 0, length = obj.length; i < length; i++) {
    +      value = obj[i];
    +      if (value != null && value < result) {
    +        result = value;
    +      }
    +    }
    +  } else {
    +    iteratee = cb(iteratee, context);
    +    each(obj, function(v, index, list) {
    +      computed = iteratee(v, index, list);
    +      if (computed < lastComputed || computed === Infinity && result === Infinity) {
    +        result = v;
    +        lastComputed = computed;
    +      }
    +    });
    +  }
    +  return result;
    +}
    @@ -1306,40 +1370,14 @@

    Array Functions

    -

    Produce a duplicate-free version of the array. If the array has already -been sorted, you have the option of using a faster algorithm. -The faster algorithm will not work with an iteratee if the iteratee -is not a one-to-one function, so providing an iteratee will disable -the faster algorithm.

    +

    Retrieve all the property names of an object.

    -
    function uniq(array, isSorted, iteratee, context) {
    -  if (!isBoolean(isSorted)) {
    -    context = iteratee;
    -    iteratee = isSorted;
    -    isSorted = false;
    -  }
    -  if (iteratee != null) iteratee = cb(iteratee, context);
    -  var result = [];
    -  var seen = [];
    -  for (var i = 0, length = getLength(array); i < length; i++) {
    -    var value = array[i],
    -        computed = iteratee ? iteratee(value, i, array) : value;
    -    if (isSorted && !iteratee) {
    -      if (!i || seen !== computed) result.push(value);
    -      seen = computed;
    -    } else if (iteratee) {
    -      if (!contains(seen, computed)) {
    -        seen.push(computed);
    -        result.push(value);
    -      }
    -    } else if (!contains(result, value)) {
    -      result.push(value);
    -    }
    -  }
    -  return result;
    -}
    +
    function allKeys(obj) {
    +  if (!isObject(obj)) return [];
    +  var keys = [];
    +  for (var key in obj) keys.push(key);
    @@ -1350,14 +1388,13 @@

    Array Functions

    -

    Produce an array that contains the union: each distinct element from all of -the passed-in arrays.

    +

    Ahem, IE < 9.

    -
    var union = restArguments(function(arrays) {
    -  return uniq(_flatten(arrays, true, true));
    -});
    +
      if (hasEnumBug) collectNonEnumProps(obj, keys);
    +  return keys;
    +}
    @@ -1368,25 +1405,11 @@

    Array Functions

    -

    Produce an array that contains every item shared between all the -passed-in arrays.

    +

    Extend a given object with all the properties in passed-in object(s).

    -
    function intersection(array) {
    -  var result = [];
    -  var argsLength = arguments.length;
    -  for (var i = 0, length = getLength(array); i < length; i++) {
    -    var item = array[i];
    -    if (contains(result, item)) continue;
    -    var j;
    -    for (j = 1; j < argsLength; j++) {
    -      if (!contains(arguments[j], item)) break;
    -    }
    -    if (j === argsLength) result.push(item);
    -  }
    -  return result;
    -}
    +
    var extend = createAssigner(allKeys);
    @@ -1397,17 +1420,14 @@

    Array Functions

    -

    Take the difference between one array and a number of other arrays. -Only the elements present in just the first array will remain.

    +

    Create a (shallow-cloned) duplicate of an object.

    -
    var difference = restArguments(function(array, rest) {
    -  rest = _flatten(rest, true, true);
    -  return filter(array, function(value){
    -    return !contains(rest, value);
    -  });
    -});
    +
    function clone(obj) {
    +  if (!isObject(obj)) return obj;
    +  return isArray(obj) ? obj.slice() : extend({}, obj);
    +}
    @@ -1418,19 +1438,16 @@

    Array Functions

    -

    Complement of zip. Unzip accepts an array of arrays and groups -each array’s elements on shared indices.

    +

    Return a random integer between min and max (inclusive).

    -
    function unzip(array) {
    -  var length = array && max(array, getLength).length || 0;
    -  var result = Array(length);
    -
    -  for (var index = 0; index < length; index++) {
    -    result[index] = pluck(array, index);
    +            
    function random(min, max) {
    +  if (max == null) {
    +    max = min;
    +    min = 0;
       }
    -  return result;
    +  return min + Math.floor(Math.random() * (max - min + 1));
     }
    @@ -1442,12 +1459,30 @@

    Array Functions

    -

    Zip together multiple lists into a single array – elements that share -an index go together.

    +

    Sample n random values from a collection using the modern version of the +Fisher-Yates shuffle. +If n is not specified, returns a single random element. +The internal guard argument allows it to work with map.

    -
    var zip = restArguments(unzip);
    +
    function sample(obj, n, guard) {
    +  if (n == null || guard) {
    +    if (!isArrayLike(obj)) obj = values(obj);
    +    return obj[random(obj.length - 1)];
    +  }
    +  var sample = isArrayLike(obj) ? clone(obj) : values(obj);
    +  var length = getLength(sample);
    +  n = Math.max(Math.min(n, length), 0);
    +  var last = length - 1;
    +  for (var index = 0; index < n; index++) {
    +    var rand = random(index, last);
    +    var temp = sample[index];
    +    sample[index] = sample[rand];
    +    sample[rand] = temp;
    +  }
    +  return sample.slice(0, n);
    +}
    @@ -1458,22 +1493,12 @@

    Array Functions

    -

    Converts lists into objects. Pass either a single array of [key, value] -pairs, or two parallel arrays of the same length – one of keys, and one of -the corresponding values. Passing by pairs is the reverse of pairs.

    +

    Shuffle a collection.

    -
    function object(list, values) {
    -  var result = {};
    -  for (var i = 0, length = getLength(list); i < length; i++) {
    -    if (values) {
    -      result[list[i]] = values[i];
    -    } else {
    -      result[list[i][0]] = list[i][1];
    -    }
    -  }
    -  return result;
    +            
    function shuffle(obj) {
    +  return sample(obj, Infinity);
     }
    @@ -1485,20 +1510,28 @@

    Array Functions

    -

    Generator function to create the findIndex and findLastIndex functions.

    +

    Sort the object’s values by a criterion produced by an iteratee.

    -
    function createPredicateIndexFinder(dir) {
    -  return function(array, predicate, context) {
    -    predicate = cb(predicate, context);
    -    var length = getLength(array);
    -    var index = dir > 0 ? 0 : length - 1;
    -    for (; index >= 0 && index < length; index += dir) {
    -      if (predicate(array[index], index, array)) return index;
    +            
    function sortBy(obj, iteratee, context) {
    +  var index = 0;
    +  iteratee = cb(iteratee, context);
    +  return pluck(map(obj, function(value, key, list) {
    +    return {
    +      value: value,
    +      index: index++,
    +      criteria: iteratee(value, key, list)
    +    };
    +  }).sort(function(left, right) {
    +    var a = left.criteria;
    +    var b = right.criteria;
    +    if (a !== b) {
    +      if (a > b || a === void 0) return 1;
    +      if (a < b || b === void 0) return -1;
         }
    -    return -1;
    -  };
    +    return left.index - right.index;
    +  }), 'value');
     }
    @@ -1510,12 +1543,21 @@

    Array Functions

    -

    Returns the first index on an array-like that passes a predicate test.

    +

    An internal function used for aggregate “group by” operations.

    -
    var findIndex = createPredicateIndexFinder(1);
    -var findLastIndex = createPredicateIndexFinder(-1);
    +
    function group(behavior, partition) {
    +  return function(obj, iteratee, context) {
    +    var result = partition ? [[], []] : {};
    +    iteratee = cb(iteratee, context);
    +    each(obj, function(value, index) {
    +      var key = iteratee(value, index, obj);
    +      behavior(result, value, key);
    +    });
    +    return result;
    +  };
    +}
    @@ -1526,21 +1568,14 @@

    Array Functions

    -

    Use a comparator function to figure out the smallest index at which -an object should be inserted so as to maintain order. Uses binary search.

    +

    Groups the object’s values by a criterion. Pass either a string attribute +to group by, or a function that returns the criterion.

    -
    function sortedIndex(array, obj, iteratee, context) {
    -  iteratee = cb(iteratee, context, 1);
    -  var value = iteratee(obj);
    -  var low = 0, high = getLength(array);
    -  while (low < high) {
    -    var mid = Math.floor((low + high) / 2);
    -    if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
    -  }
    -  return low;
    -}
    +
    var groupBy = group(function(result, value, key) {
    +  if (has(result, key)) result[key].push(value); else result[key] = [value];
    +});
    @@ -1551,33 +1586,14 @@

    Array Functions

    -

    Generator function to create the indexOf and lastIndexOf functions.

    +

    Indexes the object’s values by a criterion, similar to groupBy, but for +when you know that your index values will be unique.

    -
    function createIndexFinder(dir, predicateFind, sortedIndex) {
    -  return function(array, item, idx) {
    -    var i = 0, length = getLength(array);
    -    if (typeof idx == 'number') {
    -      if (dir > 0) {
    -        i = idx >= 0 ? idx : Math.max(idx + length, i);
    -      } else {
    -        length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
    -      }
    -    } else if (sortedIndex && idx && length) {
    -      idx = sortedIndex(array, item);
    -      return array[idx] === item ? idx : -1;
    -    }
    -    if (item !== item) {
    -      idx = predicateFind(slice.call(array, i, length), isNaN);
    -      return idx >= 0 ? idx + i : -1;
    -    }
    -    for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
    -      if (array[idx] === item) return idx;
    -    }
    -    return -1;
    -  };
    -}
    +
    var indexBy = group(function(result, value, key) {
    +  result[key] = value;
    +});
    @@ -1588,15 +1604,19 @@

    Array Functions

    -

    Return the position of the first occurrence of an item in an array, -or -1 if the item is not included in the array. -If the array is large and already in sort order, pass true -for isSorted to use binary search.

    +

    Counts instances of an object that group by a certain criterion. Pass +either a string attribute to count by, or a function that returns the +criterion.

    -
    var indexOf = createIndexFinder(1, findIndex, sortedIndex);
    -var lastIndexOf = createIndexFinder(-1, findLastIndex);
    +
    var countBy = group(function(result, value, key) {
    +  if (has(result, key)) result[key]++; else result[key] = 1;
    +});
    +
    +var isString = tagTester('String');
    +
    +var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
    @@ -1607,30 +1627,14 @@

    Array Functions

    -

    Generate an integer Array containing an arithmetic progression. A port of -the native Python range() function. See -the Python documentation.

    +

    Safely create a real, live array from anything iterable.

    -
    function range(start, stop, step) {
    -  if (stop == null) {
    -    stop = start || 0;
    -    start = 0;
    -  }
    -  if (!step) {
    -    step = stop < start ? -1 : 1;
    -  }
    -
    -  var length = Math.max(Math.ceil((stop - start) / step), 0);
    -  var range = Array(length);
    -
    -  for (var idx = 0; idx < length; idx++, start += step) {
    -    range[idx] = start;
    -  }
    -
    -  return range;
    -}
    +
    function toArray(obj) {
    +  if (!obj) return [];
    +  if (isArray(obj)) return slice.call(obj);
    +  if (isString(obj)) {
    @@ -1641,19 +1645,14 @@

    Array Functions

    -

    Chunk a single array into multiple arrays, each containing count or fewer -items.

    +

    Keep surrogate pair characters together

    -
    function chunk(array, count) {
    -  if (count == null || count < 1) return [];
    -  var result = [];
    -  var i = 0, length = array.length;
    -  while (i < length) {
    -    result.push(slice.call(array, i, i += count));
    +            
        return obj.match(reStrSymbol);
       }
    -  return result;
    +  if (isArrayLike(obj)) return map(obj, identity);
    +  return values(obj);
     }
    @@ -1665,10 +1664,15 @@

    Array Functions

    -

    Function (ahem) Functions

    +

    Return the number of elements in an object.

    +
    function size(obj) {
    +  if (obj == null) return 0;
    +  return isArrayLike(obj) ? obj.length : keys(obj).length;
    +}
    + @@ -1678,9 +1682,15 @@

    Function (ahem) Functions

    - +

    Split a collection into two arrays: one whose elements all satisfy the given +predicate, and one whose elements all do not satisfy the predicate.

    +
    +
    var partition = group(function(result, value, pass) {
    +  result[pass ? 0 : 1].push(value);
    +}, true);
    + @@ -1690,17 +1700,14 @@

    Function (ahem) Functions

    -

    Determines whether to execute a function as a constructor -or a normal function with the provided arguments.

    +

    Returns everything but the last entry of the array. Especially useful on +the arguments object. Passing n will return all the values in +the array, excluding the last N.

    -
    function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
    -  if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
    -  var self = baseCreate(sourceFunc.prototype);
    -  var result = sourceFunc.apply(self, args);
    -  if (isObject(result)) return result;
    -  return self;
    +            
    function initial(array, n, guard) {
    +  return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
     }
    @@ -1712,19 +1719,16 @@

    Function (ahem) Functions

    -

    Create a function bound to a given object (assigning this, and arguments, -optionally). Delegates to ECMAScript 5‘s native Function.bind if -available.

    +

    Get the first element of an array. Passing n will return the first N +values in the array. The guard check allows it to work with map.

    -
    var bind = restArguments(function(func, context, args) {
    -  if (!isFunction(func)) throw new TypeError('Bind must be called on a function');
    -  var bound = restArguments(function(callArgs) {
    -    return executeBound(func, bound, context, this, args.concat(callArgs));
    -  });
    -  return bound;
    -});
    +
    function first(array, n, guard) {
    +  if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
    +  if (n == null || guard) return array[0];
    +  return initial(array, array.length - n);
    +}
    @@ -1735,28 +1739,15 @@

    Function (ahem) Functions

    -

    Partially apply a function by creating a version that has had some of its -arguments pre-filled, without changing its dynamic this context. _ acts -as a placeholder by default, allowing any combination of arguments to be -pre-filled. Set partial.placeholder for a custom placeholder argument.

    +

    Returns everything but the first entry of the array. Especially useful on +the arguments object. Passing an n will return the rest N values in the +array.

    -
    var partial = restArguments(function(func, boundArgs) {
    -  var placeholder = partial.placeholder;
    -  var bound = function() {
    -    var position = 0, length = boundArgs.length;
    -    var args = Array(length);
    -    for (var i = 0; i < length; i++) {
    -      args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
    -    }
    -    while (position < arguments.length) args.push(arguments[position++]);
    -    return executeBound(func, bound, this, this, args);
    -  };
    -  return bound;
    -});
    -
    -partial.placeholder = _;
    +
    function rest(array, n, guard) {
    +  return slice.call(array, n == null || guard ? 1 : n);
    +}
    @@ -1767,21 +1758,16 @@

    Function (ahem) Functions

    -

    Bind a number of an object’s methods to that object. Remaining arguments -are the method names to be bound. Useful for ensuring that all callbacks -defined on an object belong to it.

    +

    Get the last element of an array. Passing n will return the last N +values in the array.

    -
    var bindAll = restArguments(function(obj, _keys) {
    -  _keys = _flatten(_keys, false, false);
    -  var index = _keys.length;
    -  if (index < 1) throw new Error('bindAll must be passed function names');
    -  while (index--) {
    -    var key = _keys[index];
    -    obj[key] = bind(obj[key], obj);
    -  }
    -});
    +
    function last(array, n, guard) {
    +  if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
    +  if (n == null || guard) return array[array.length - 1];
    +  return rest(array, Math.max(0, array.length - n));
    +}
    @@ -1792,20 +1778,15 @@

    Function (ahem) Functions

    -

    Memoize an expensive function by storing its results.

    +

    Trim out all falsy values from an array.

    -
    function memoize(func, hasher) {
    -  var memoize = function(key) {
    -    var cache = memoize.cache;
    -    var address = '' + (hasher ? hasher.apply(this, arguments) : key);
    -    if (!_has(cache, address)) cache[address] = func.apply(this, arguments);
    -    return cache[address];
    -  };
    -  memoize.cache = {};
    -  return memoize;
    -}
    +
    function compact(array) {
    +  return filter(array, Boolean);
    +}
    +
    +var isArguments = tagTester('Arguments');
    @@ -1816,16 +1797,20 @@

    Function (ahem) Functions

    -

    Delays a function for the given number of milliseconds, and then calls -it with the arguments supplied.

    +

    Define a fallback version of the method in browsers (ahem, IE < 9), where +there isn’t any inspectable “Arguments” type.

    -
    var delay = restArguments(function(func, wait, args) {
    -  return setTimeout(function() {
    -    return func.apply(null, args);
    -  }, wait);
    -});
    +
    (function() {
    +  if (!isArguments(arguments)) {
    +    isArguments = function(obj) {
    +      return has(obj, 'callee');
    +    };
    +  }
    +}());
    +
    +var isArguments$1 = isArguments;
    @@ -1836,12 +1821,16 @@

    Function (ahem) Functions

    -

    Defers a function, scheduling it to run after the current call stack has -cleared.

    +

    Internal implementation of a recursive flatten function.

    -
    var defer = partial(delay, _, 1);
    +
    function flatten(input, shallow, strict, output) {
    +  output = output || [];
    +  var idx = output.length;
    +  for (var i = 0, length = getLength(input); i < length; i++) {
    +    var value = input[i];
    +    if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) {
    @@ -1852,53 +1841,22 @@

    Function (ahem) Functions

    -

    Returns a function, that, when invoked, will only be triggered at most once -during a given window of time. Normally, the throttled function will run -as much as it can, without ever going more than once per wait duration; -but if you’d like to disable the execution on the leading edge, pass -{leading: false}. To disable execution on the trailing edge, ditto.

    +

    Flatten current level of array or arguments object.

    -
    function throttle(func, wait, options) {
    -  var timeout, context, args, result;
    -  var previous = 0;
    -  if (!options) options = {};
    -
    -  var later = function() {
    -    previous = options.leading === false ? 0 : now();
    -    timeout = null;
    -    result = func.apply(context, args);
    -    if (!timeout) context = args = null;
    -  };
    -
    -  var throttled = function() {
    -    var _now = now();
    -    if (!previous && options.leading === false) previous = _now;
    -    var remaining = wait - (_now - previous);
    -    context = this;
    -    args = arguments;
    -    if (remaining <= 0 || remaining > wait) {
    -      if (timeout) {
    -        clearTimeout(timeout);
    -        timeout = null;
    +            
          if (shallow) {
    +        var j = 0, len = value.length;
    +        while (j < len) output[idx++] = value[j++];
    +      } else {
    +        flatten(value, shallow, strict, output);
    +        idx = output.length;
           }
    -      previous = _now;
    -      result = func.apply(context, args);
    -      if (!timeout) context = args = null;
    -    } else if (!timeout && options.trailing !== false) {
    -      timeout = setTimeout(later, remaining);
    +    } else if (!strict) {
    +      output[idx++] = value;
         }
    -    return result;
    -  };
    -
    -  throttled.cancel = function() {
    -    clearTimeout(timeout);
    -    previous = 0;
    -    timeout = context = args = null;
    -  };
    -
    -  return throttled;
    +  }
    +  return output;
     }
    @@ -1910,40 +1868,12 @@

    Function (ahem) Functions

    -

    Returns a function, that, as long as it continues to be invoked, will not -be triggered. The function will be called after it stops being called for -N milliseconds. If immediate is passed, trigger the function on the -leading edge, instead of the trailing.

    +

    Flatten out an array, either recursively (by default), or just one level.

    -
    function debounce(func, wait, immediate) {
    -  var timeout, result;
    -
    -  var later = function(context, args) {
    -    timeout = null;
    -    if (args) result = func.apply(context, args);
    -  };
    -
    -  var debounced = restArguments(function(args) {
    -    if (timeout) clearTimeout(timeout);
    -    if (immediate) {
    -      var callNow = !timeout;
    -      timeout = setTimeout(later, wait);
    -      if (callNow) result = func.apply(this, args);
    -    } else {
    -      timeout = delay(later, wait, this, args);
    -    }
    -
    -    return result;
    -  });
    -
    -  debounced.cancel = function() {
    -    clearTimeout(timeout);
    -    timeout = null;
    -  };
    -
    -  return debounced;
    +            
    function flatten$1(array, shallow) {
    +  return flatten(array, shallow, false);
     }
    @@ -1955,15 +1885,17 @@

    Function (ahem) Functions

    -

    Returns the first function passed as an argument to the second, -allowing you to adjust arguments, run code before and after, and -conditionally execute the original function.

    +

    Take the difference between one array and a number of other arrays. +Only the elements present in just the first array will remain.

    -
    function wrap(func, wrapper) {
    -  return partial(wrapper, func);
    -}
    +
    var difference = restArguments(function(array, rest) {
    +  rest = flatten(rest, true, true);
    +  return filter(array, function(value){
    +    return !contains(rest, value);
    +  });
    +});
    @@ -1974,15 +1906,13 @@

    Function (ahem) Functions

    -

    Returns a negated version of the passed-in predicate.

    +

    Return a version of the array that does not contain the specified value(s).

    -
    function negate(predicate) {
    -  return function() {
    -    return !predicate.apply(this, arguments);
    -  };
    -}
    +
    var without = restArguments(function(array, otherArrays) {
    +  return difference(array, otherArrays);
    +});
    @@ -1993,20 +1923,12 @@

    Function (ahem) Functions

    -

    Returns a function that is the composition of a list of functions, each -consuming the return value of the function that follows.

    +

    Is a given value a boolean?

    -
    function compose() {
    -  var args = arguments;
    -  var start = args.length - 1;
    -  return function() {
    -    var i = start;
    -    var result = args[start].apply(this, arguments);
    -    while (i--) result = args[i].call(this, result);
    -    return result;
    -  };
    +            
    function isBoolean(obj) {
    +  return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
     }
    @@ -2018,16 +1940,39 @@

    Function (ahem) Functions

    -

    Returns a function that will only be executed on and after the Nth call.

    +

    Produce a duplicate-free version of the array. If the array has already +been sorted, you have the option of using a faster algorithm. +The faster algorithm will not work with an iteratee if the iteratee +is not a one-to-one function, so providing an iteratee will disable +the faster algorithm.

    -
    function after(times, func) {
    -  return function() {
    -    if (--times < 1) {
    -      return func.apply(this, arguments);
    +            
    function uniq(array, isSorted, iteratee, context) {
    +  if (!isBoolean(isSorted)) {
    +    context = iteratee;
    +    iteratee = isSorted;
    +    isSorted = false;
    +  }
    +  if (iteratee != null) iteratee = cb(iteratee, context);
    +  var result = [];
    +  var seen = [];
    +  for (var i = 0, length = getLength(array); i < length; i++) {
    +    var value = array[i],
    +        computed = iteratee ? iteratee(value, i, array) : value;
    +    if (isSorted && !iteratee) {
    +      if (!i || seen !== computed) result.push(value);
    +      seen = computed;
    +    } else if (iteratee) {
    +      if (!contains(seen, computed)) {
    +        seen.push(computed);
    +        result.push(value);
    +      }
    +    } else if (!contains(result, value)) {
    +      result.push(value);
         }
    -  };
    +  }
    +  return result;
     }
    @@ -2039,20 +1984,14 @@

    Function (ahem) Functions

    -

    Returns a function that will only be executed up to (but not including) the Nth call.

    +

    Produce an array that contains the union: each distinct element from all of +the passed-in arrays.

    -
    function before(times, func) {
    -  var memo;
    -  return function() {
    -    if (--times > 0) {
    -      memo = func.apply(this, arguments);
    -    }
    -    if (times <= 1) func = null;
    -    return memo;
    -  };
    -}
    +
    var union = restArguments(function(arrays) {
    +  return uniq(flatten(arrays, true, true));
    +});
    @@ -2063,12 +2002,25 @@

    Function (ahem) Functions

    -

    Returns a function that will be executed at most one time, no matter how -often you call it. Useful for lazy initialization.

    +

    Produce an array that contains every item shared between all the +passed-in arrays.

    -
    var once = partial(before, 2);
    +
    function intersection(array) {
    +  var result = [];
    +  var argsLength = arguments.length;
    +  for (var i = 0, length = getLength(array); i < length; i++) {
    +    var item = array[i];
    +    if (contains(result, item)) continue;
    +    var j;
    +    for (j = 1; j < argsLength; j++) {
    +      if (!contains(arguments[j], item)) break;
    +    }
    +    if (j === argsLength) result.push(item);
    +  }
    +  return result;
    +}
    @@ -2079,10 +2031,21 @@

    Function (ahem) Functions

    -

    Object Functions

    +

    Complement of zip. Unzip accepts an array of arrays and groups +each array’s elements on shared indices.

    +
    function unzip(array) {
    +  var length = array && max(array, getLength).length || 0;
    +  var result = Array(length);
    +
    +  for (var index = 0; index < length; index++) {
    +    result[index] = pluck(array, index);
    +  }
    +  return result;
    +}
    + @@ -2092,9 +2055,13 @@

    Object Functions

    - +

    Zip together multiple lists into a single array – elements that share +an index go together.

    + +
    var zip = restArguments(unzip);
    + @@ -2104,18 +2071,23 @@

    Object Functions

    -

    Keys in IE < 9 that won’t be iterated by for key in ... and thus missed.

    +

    Converts lists into objects. Pass either a single array of [key, value] +pairs, or two parallel arrays of the same length – one of keys, and one of +the corresponding values. Passing by pairs is the reverse of pairs.

    -
    var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
    -var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
    -  'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
    -
    -function collectNonEnumProps(obj, _keys) {
    -  var nonEnumIdx = nonEnumerableProps.length;
    -  var constructor = obj.constructor;
    -  var proto = isFunction(constructor) && constructor.prototype || ObjProto;
    +
    function object(list, values) {
    +  var result = {};
    +  for (var i = 0, length = getLength(list); i < length; i++) {
    +    if (values) {
    +      result[list[i]] = values[i];
    +    } else {
    +      result[list[i][0]] = list[i][1];
    +    }
    +  }
    +  return result;
    +}
    @@ -2126,20 +2098,11 @@

    Object Functions

    -

    Constructor is a special case.

    +

    Returns the last index on an array-like that passes a predicate test.

    -
      var prop = 'constructor';
    -  if (_has(obj, prop) && !contains(_keys, prop)) _keys.push(prop);
    -
    -  while (nonEnumIdx--) {
    -    prop = nonEnumerableProps[nonEnumIdx];
    -    if (prop in obj && obj[prop] !== proto[prop] && !contains(_keys, prop)) {
    -      _keys.push(prop);
    -    }
    -  }
    -}
    +
    var findLastIndex = createPredicateIndexFinder(-1);
    @@ -2150,16 +2113,12 @@

    Object Functions

    -

    Retrieve the names of an object’s own properties. -Delegates to ECMAScript 5‘s native Object.keys.

    +

    Return the position of the last occurrence of an item in an array, +or -1 if the item is not included in the array.

    -
    function keys(obj) {
    -  if (!isObject(obj)) return [];
    -  if (nativeKeys) return nativeKeys(obj);
    -  var _keys = [];
    -  for (var key in obj) if (_has(obj, key)) _keys.push(key);
    +
    var lastIndexOf = createIndexFinder(-1, findLastIndex);
    @@ -2170,12 +2129,29 @@

    Object Functions

    -

    Ahem, IE < 9.

    +

    Generate an integer Array containing an arithmetic progression. A port of +the native Python range() function. See +the Python documentation.

    -
      if (hasEnumBug) collectNonEnumProps(obj, _keys);
    -  return _keys;
    +            
    function range(start, stop, step) {
    +  if (stop == null) {
    +    stop = start || 0;
    +    start = 0;
    +  }
    +  if (!step) {
    +    step = stop < start ? -1 : 1;
    +  }
    +
    +  var length = Math.max(Math.ceil((stop - start) / step), 0);
    +  var range = Array(length);
    +
    +  for (var idx = 0; idx < length; idx++, start += step) {
    +    range[idx] = start;
    +  }
    +
    +  return range;
     }
    @@ -2187,14 +2163,20 @@

    Object Functions

    -

    Retrieve all the property names of an object.

    +

    Chunk a single array into multiple arrays, each containing count or fewer +items.

    -
    function allKeys(obj) {
    -  if (!isObject(obj)) return [];
    -  var _keys = [];
    -  for (var key in obj) _keys.push(key);
    +
    function chunk(array, count) {
    +  if (count == null || count < 1) return [];
    +  var result = [];
    +  var i = 0, length = array.length;
    +  while (i < length) {
    +    result.push(slice.call(array, i, i += count));
    +  }
    +  return result;
    +}
    @@ -2205,12 +2187,12 @@

    Object Functions

    -

    Ahem, IE < 9.

    +

    Create a naked function reference for surrogate-prototype-swapping.

    -
      if (hasEnumBug) collectNonEnumProps(obj, _keys);
    -  return _keys;
    +            
    function ctor() {
    +  return function(){};
     }
    @@ -2222,18 +2204,18 @@

    Object Functions

    -

    Retrieve the values of an object’s properties.

    +

    An internal function for creating a new object that inherits from another.

    -
    function values(obj) {
    -  var _keys = keys(obj);
    -  var length = _keys.length;
    -  var values = Array(length);
    -  for (var i = 0; i < length; i++) {
    -    values[i] = obj[_keys[i]];
    -  }
    -  return values;
    +            
    function baseCreate(prototype) {
    +  if (!isObject(prototype)) return {};
    +  if (nativeCreate) return nativeCreate(prototype);
    +  var Ctor = ctor();
    +  Ctor.prototype = prototype;
    +  var result = new Ctor;
    +  Ctor.prototype = null;
    +  return result;
     }
    @@ -2245,21 +2227,17 @@

    Object Functions

    -

    Returns the results of applying the iteratee to each element of the object. -In contrast to map it returns an object.

    +

    Determines whether to execute a function as a constructor +or a normal function with the provided arguments.

    -
    function mapObject(obj, iteratee, context) {
    -  iteratee = cb(iteratee, context);
    -  var _keys = keys(obj),
    -      length = _keys.length,
    -      results = {};
    -  for (var index = 0; index < length; index++) {
    -    var currentKey = _keys[index];
    -    results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
    -  }
    -  return results;
    +            
    function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
    +  if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
    +  var self = baseCreate(sourceFunc.prototype);
    +  var result = sourceFunc.apply(self, args);
    +  if (isObject(result)) return result;
    +  return self;
     }
    @@ -2271,20 +2249,19 @@

    Object Functions

    -

    Convert an object into a list of [key, value] pairs. -The opposite of object.

    +

    Create a function bound to a given object (assigning this, and arguments, +optionally). Delegates to ECMAScript 5‘s native Function.bind if +available.

    -
    function pairs(obj) {
    -  var _keys = keys(obj);
    -  var length = _keys.length;
    -  var pairs = Array(length);
    -  for (var i = 0; i < length; i++) {
    -    pairs[i] = [_keys[i], obj[_keys[i]]];
    -  }
    -  return pairs;
    -}
    +
    var bind = restArguments(function(func, context, args) {
    +  if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function');
    +  var bound = restArguments(function(callArgs) {
    +    return executeBound(func, bound, context, this, args.concat(callArgs));
    +  });
    +  return bound;
    +});
    @@ -2295,18 +2272,28 @@

    Object Functions

    -

    Invert the keys and values of an object. The values must be serializable.

    +

    Partially apply a function by creating a version that has had some of its +arguments pre-filled, without changing its dynamic this context. _ acts +as a placeholder by default, allowing any combination of arguments to be +pre-filled. Set partial.placeholder for a custom placeholder argument.

    -
    function invert(obj) {
    -  var result = {};
    -  var _keys = keys(obj);
    -  for (var i = 0, length = _keys.length; i < length; i++) {
    -    result[obj[_keys[i]]] = _keys[i];
    -  }
    -  return result;
    -}
    +
    var partial = restArguments(function(func, boundArgs) {
    +  var placeholder = partial.placeholder;
    +  var bound = function() {
    +    var position = 0, length = boundArgs.length;
    +    var args = Array(length);
    +    for (var i = 0; i < length; i++) {
    +      args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
    +    }
    +    while (position < arguments.length) args.push(arguments[position++]);
    +    return executeBound(func, bound, this, this, args);
    +  };
    +  return bound;
    +});
    +
    +partial.placeholder = _;
    @@ -2317,17 +2304,22 @@

    Object Functions

    -

    Return a sorted list of the function names available on the object.

    +

    Bind a number of an object’s methods to that object. Remaining arguments +are the method names to be bound. Useful for ensuring that all callbacks +defined on an object belong to it.

    -
    function functions(obj) {
    -  var names = [];
    -  for (var key in obj) {
    -    if (isFunction(obj[key])) names.push(key);
    +            
    var bindAll = restArguments(function(obj, keys) {
    +  keys = flatten(keys, false, false);
    +  var index = keys.length;
    +  if (index < 1) throw new Error('bindAll must be passed function names');
    +  while (index--) {
    +    var key = keys[index];
    +    obj[key] = bind(obj[key], obj);
       }
    -  return names.sort();
    -}
    + return obj; +});
    @@ -2338,26 +2330,19 @@

    Object Functions

    -

    An internal function for creating assigner functions.

    +

    Memoize an expensive function by storing its results.

    -
    function createAssigner(keysFunc, defaults) {
    -  return function(obj) {
    -    var length = arguments.length;
    -    if (defaults) obj = Object(obj);
    -    if (length < 2 || obj == null) return obj;
    -    for (var index = 1; index < length; index++) {
    -      var source = arguments[index],
    -          _keys = keysFunc(source),
    -          l = _keys.length;
    -      for (var i = 0; i < l; i++) {
    -        var key = _keys[i];
    -        if (!defaults || obj[key] === void 0) obj[key] = source[key];
    -      }
    -    }
    -    return obj;
    +            
    function memoize(func, hasher) {
    +  var memoize = function(key) {
    +    var cache = memoize.cache;
    +    var address = '' + (hasher ? hasher.apply(this, arguments) : key);
    +    if (!has(cache, address)) cache[address] = func.apply(this, arguments);
    +    return cache[address];
       };
    +  memoize.cache = {};
    +  return memoize;
     }
    @@ -2369,11 +2354,16 @@

    Object Functions

    -

    Extend a given object with all the properties in passed-in object(s).

    +

    Delays a function for the given number of milliseconds, and then calls +it with the arguments supplied.

    -
    var extend = createAssigner(allKeys);
    +
    var delay = restArguments(function(func, wait, args) {
    +  return setTimeout(function() {
    +    return func.apply(null, args);
    +  }, wait);
    +});
    @@ -2384,12 +2374,12 @@

    Object Functions

    -

    Assigns a given object with all the own properties in the passed-in object(s). -(https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)

    +

    Defers a function, scheduling it to run after the current call stack has +cleared.

    -
    var extendOwn = createAssigner(keys);
    +
    var defer = partial(delay, _, 1);
    @@ -2400,18 +2390,13 @@

    Object Functions

    -

    Returns the first key on an object that passes a predicate test.

    +

    A (possibly faster) way to get the current timestamp as an integer.

    -
    function findKey(obj, predicate, context) {
    -  predicate = cb(predicate, context);
    -  var _keys = keys(obj), key;
    -  for (var i = 0, length = _keys.length; i < length; i++) {
    -    key = _keys[i];
    -    if (predicate(obj[key], key, obj)) return key;
    -  }
    -}
    +
    var now = Date.now || function() {
    +  return new Date().getTime();
    +};
    @@ -2422,12 +2407,53 @@

    Object Functions

    -

    Internal pick helper function to determine if obj has key key.

    +

    Returns a function, that, when invoked, will only be triggered at most once +during a given window of time. Normally, the throttled function will run +as much as it can, without ever going more than once per wait duration; +but if you’d like to disable the execution on the leading edge, pass +{leading: false}. To disable execution on the trailing edge, ditto.

    -
    function keyInObj(value, key, obj) {
    -  return key in obj;
    +            
    function throttle(func, wait, options) {
    +  var timeout, context, args, result;
    +  var previous = 0;
    +  if (!options) options = {};
    +
    +  var later = function() {
    +    previous = options.leading === false ? 0 : now();
    +    timeout = null;
    +    result = func.apply(context, args);
    +    if (!timeout) context = args = null;
    +  };
    +
    +  var throttled = function() {
    +    var _now = now();
    +    if (!previous && options.leading === false) previous = _now;
    +    var remaining = wait - (_now - previous);
    +    context = this;
    +    args = arguments;
    +    if (remaining <= 0 || remaining > wait) {
    +      if (timeout) {
    +        clearTimeout(timeout);
    +        timeout = null;
    +      }
    +      previous = _now;
    +      result = func.apply(context, args);
    +      if (!timeout) context = args = null;
    +    } else if (!timeout && options.trailing !== false) {
    +      timeout = setTimeout(later, remaining);
    +    }
    +    return result;
    +  };
    +
    +  throttled.cancel = function() {
    +    clearTimeout(timeout);
    +    previous = 0;
    +    timeout = context = args = null;
    +  };
    +
    +  return throttled;
     }
    @@ -2439,28 +2465,41 @@

    Object Functions

    -

    Return a copy of the object only containing the whitelisted properties.

    +

    Returns a function, that, as long as it continues to be invoked, will not +be triggered. The function will be called after it stops being called for +N milliseconds. If immediate is passed, trigger the function on the +leading edge, instead of the trailing.

    -
    var pick = restArguments(function(obj, _keys) {
    -  var result = {}, iteratee = _keys[0];
    -  if (obj == null) return result;
    -  if (isFunction(iteratee)) {
    -    if (_keys.length > 1) iteratee = optimizeCb(iteratee, _keys[1]);
    -    _keys = allKeys(obj);
    -  } else {
    -    iteratee = keyInObj;
    -    _keys = _flatten(_keys, false, false);
    -    obj = Object(obj);
    -  }
    -  for (var i = 0, length = _keys.length; i < length; i++) {
    -    var key = _keys[i];
    -    var value = obj[key];
    -    if (iteratee(value, key, obj)) result[key] = value;
    -  }
    -  return result;
    -});
    +
    function debounce(func, wait, immediate) {
    +  var timeout, result;
    +
    +  var later = function(context, args) {
    +    timeout = null;
    +    if (args) result = func.apply(context, args);
    +  };
    +
    +  var debounced = restArguments(function(args) {
    +    if (timeout) clearTimeout(timeout);
    +    if (immediate) {
    +      var callNow = !timeout;
    +      timeout = setTimeout(later, wait);
    +      if (callNow) result = func.apply(this, args);
    +    } else {
    +      timeout = delay(later, wait, this, args);
    +    }
    +
    +    return result;
    +  });
    +
    +  debounced.cancel = function() {
    +    clearTimeout(timeout);
    +    timeout = null;
    +  };
    +
    +  return debounced;
    +}
    @@ -2471,23 +2510,15 @@

    Object Functions

    -

    Return a copy of the object without the blacklisted properties.

    +

    Returns the first function passed as an argument to the second, +allowing you to adjust arguments, run code before and after, and +conditionally execute the original function.

    -
    var omit = restArguments(function(obj, _keys) {
    -  var iteratee = _keys[0], context;
    -  if (isFunction(iteratee)) {
    -    iteratee = negate(iteratee);
    -    if (_keys.length > 1) context = _keys[1];
    -  } else {
    -    _keys = map(_flatten(_keys, false, false), String);
    -    iteratee = function(value, key) {
    -      return !contains(_keys, key);
    -    };
    -  }
    -  return pick(obj, iteratee, context);
    -});
    +
    function wrap(func, wrapper) {
    +  return partial(wrapper, func);
    +}
    @@ -2498,11 +2529,21 @@

    Object Functions

    -

    Fill in a given object with default properties.

    +

    Returns a function that is the composition of a list of functions, each +consuming the return value of the function that follows.

    -
    var defaults = createAssigner(allKeys, true);
    +
    function compose() {
    +  var args = arguments;
    +  var start = args.length - 1;
    +  return function() {
    +    var i = start;
    +    var result = args[start].apply(this, arguments);
    +    while (i--) result = args[i].call(this, result);
    +    return result;
    +  };
    +}
    @@ -2513,16 +2554,16 @@

    Object Functions

    -

    Creates an object that inherits from the given prototype object. -If additional properties are provided then they will be added to the -created object.

    +

    Returns a function that will only be executed on and after the Nth call.

    -
    function create(prototype, props) {
    -  var result = baseCreate(prototype);
    -  if (props) extendOwn(result, props);
    -  return result;
    +            
    function after(times, func) {
    +  return function() {
    +    if (--times < 1) {
    +      return func.apply(this, arguments);
    +    }
    +  };
     }
    @@ -2534,13 +2575,19 @@

    Object Functions

    -

    Create a (shallow-cloned) duplicate of an object.

    +

    Returns a function that will only be executed up to (but not including) the Nth call.

    -
    function clone(obj) {
    -  if (!isObject(obj)) return obj;
    -  return isArray(obj) ? obj.slice() : extend({}, obj);
    +            
    function before(times, func) {
    +  var memo;
    +  return function() {
    +    if (--times > 0) {
    +      memo = func.apply(this, arguments);
    +    }
    +    if (times <= 1) func = null;
    +    return memo;
    +  };
     }
    @@ -2552,16 +2599,12 @@

    Object Functions

    -

    Invokes interceptor with the obj, and then returns obj. -The primary purpose of this method is to “tap into” a method chain, in -order to perform operations on intermediate results within the chain.

    +

    Returns a function that will be executed at most one time, no matter how +often you call it. Useful for lazy initialization.

    -
    function tap(obj, interceptor) {
    -  interceptor(obj);
    -  return obj;
    -}
    +
    var once = partial(before, 2);
    @@ -2572,19 +2615,21 @@

    Object Functions

    -

    Returns whether an object has a given set of key:value pairs.

    +

    Returns the results of applying the iteratee to each element of the object. +In contrast to map it returns an object.

    -
    function isMatch(object, attrs) {
    -  var _keys = keys(attrs), length = _keys.length;
    -  if (object == null) return !length;
    -  var obj = Object(object);
    -  for (var i = 0; i < length; i++) {
    -    var key = _keys[i];
    -    if (attrs[key] !== obj[key] || !(key in obj)) return false;
    +            
    function mapObject(obj, iteratee, context) {
    +  iteratee = cb(iteratee, context);
    +  var _keys = keys(obj),
    +      length = _keys.length,
    +      results = {};
    +  for (var index = 0; index < length; index++) {
    +    var currentKey = _keys[index];
    +    results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
       }
    -  return true;
    +  return results;
     }
    @@ -2596,11 +2641,20 @@

    Object Functions

    -

    Internal recursive comparison function for isEqual.

    +

    Convert an object into a list of [key, value] pairs. +The opposite of object.

    -
    function eq(a, b, aStack, bStack) {
    +
    function pairs(obj) {
    +  var _keys = keys(obj);
    +  var length = _keys.length;
    +  var pairs = Array(length);
    +  for (var i = 0; i < length; i++) {
    +    pairs[i] = [_keys[i], obj[_keys[i]]];
    +  }
    +  return pairs;
    +}
    @@ -2611,12 +2665,18 @@

    Object Functions

    -

    Identical objects are equal. 0 === -0, but they aren’t identical. -See the Harmony egal proposal.

    +

    Invert the keys and values of an object. The values must be serializable.

    -
      if (a === b) return a !== 0 || 1 / a === 1 / b;
    +
    function invert(obj) {
    +  var result = {};
    +  var _keys = keys(obj);
    +  for (var i = 0, length = _keys.length; i < length; i++) {
    +    result[obj[_keys[i]]] = _keys[i];
    +  }
    +  return result;
    +}
    @@ -2627,11 +2687,17 @@

    Object Functions

    -

    null or undefined only equal to itself (strict comparison).

    +

    Return a sorted list of the function names available on the object.

    -
      if (a == null || b == null) return false;
    +
    function functions(obj) {
    +  var names = [];
    +  for (var key in obj) {
    +    if (isFunction$1(obj[key])) names.push(key);
    +  }
    +  return names.sort();
    +}
    @@ -2642,11 +2708,13 @@

    Object Functions

    -

    NaNs are equivalent, but non-reflexive.

    +

    Internal pick helper function to determine if obj has key key.

    -
      if (a !== a) return b !== b;
    +
    function keyInObj(value, key, obj) {
    +  return key in obj;
    +}
    @@ -2657,14 +2725,28 @@

    Object Functions

    -

    Exhaust primitive checks

    +

    Return a copy of the object only containing the whitelisted properties.

    -
      var type = typeof a;
    -  if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
    -  return deepEq(a, b, aStack, bStack);
    -}
    +
    var pick = restArguments(function(obj, keys) {
    +  var result = {}, iteratee = keys[0];
    +  if (obj == null) return result;
    +  if (isFunction$1(iteratee)) {
    +    if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);
    +    keys = allKeys(obj);
    +  } else {
    +    iteratee = keyInObj;
    +    keys = flatten(keys, false, false);
    +    obj = Object(obj);
    +  }
    +  for (var i = 0, length = keys.length; i < length; i++) {
    +    var key = keys[i];
    +    var value = obj[key];
    +    if (iteratee(value, key, obj)) result[key] = value;
    +  }
    +  return result;
    +});
    @@ -2675,11 +2757,23 @@

    Object Functions

    -

    Internal recursive comparison function for isEqual.

    +

    Return a copy of the object without the blacklisted properties.

    -
    function deepEq(a, b, aStack, bStack) {
    +
    var omit = restArguments(function(obj, keys) {
    +  var iteratee = keys[0], context;
    +  if (isFunction$1(iteratee)) {
    +    iteratee = negate(iteratee);
    +    if (keys.length > 1) context = keys[1];
    +  } else {
    +    keys = map(flatten(keys, false, false), String);
    +    iteratee = function(value, key) {
    +      return !contains(keys, key);
    +    };
    +  }
    +  return pick(obj, iteratee, context);
    +});
    @@ -2690,12 +2784,11 @@

    Object Functions

    -

    Unwrap any wrapped objects.

    +

    Fill in a given object with default properties.

    -
      if (a instanceof _) a = a._wrapped;
    -  if (b instanceof _) b = b._wrapped;
    +
    var defaults = createAssigner(allKeys, true);
    @@ -2706,13 +2799,17 @@

    Object Functions

    -

    Compare [[Class]] names.

    +

    Creates an object that inherits from the given prototype object. +If additional properties are provided then they will be added to the +created object.

    -
      var className = toString.call(a);
    -  if (className !== toString.call(b)) return false;
    -  switch (className) {
    +
    function create(prototype, props) {
    +  var result = baseCreate(prototype);
    +  if (props) extendOwn(result, props);
    +  return result;
    +}
    @@ -2723,11 +2820,20 @@

    Object Functions

    -

    Strings, numbers, regular expressions, dates, and booleans are compared by value.

    +

    Invokes interceptor with the obj, and then returns obj. +The primary purpose of this method is to “tap into” a method chain, in +order to perform operations on intermediate results within the chain.

    -
        case '[object RegExp]':
    +
    function tap(obj, interceptor) {
    +  interceptor(obj);
    +  return obj;
    +}
    +
    +var getByteLength = shallowProperty('byteLength');
    +
    +var isDataView = tagTester('DataView');
    @@ -2738,11 +2844,12 @@

    Object Functions

    -

    RegExps are coerced to strings for comparison (Note: ‘’ + /a/i === ‘/a/i’)

    +

    Helper to determine whether we should spend extensive checks against +ArrayBuffer et al.

    -
        case '[object String]':
    +
    var isBufferLike = createSizePropertyCheck(getByteLength);
    @@ -2753,13 +2860,15 @@

    Object Functions

    -

    Primitives and their corresponding object wrappers are equivalent; thus, "5" is -equivalent to new String("5").

    +

    Predicate-generating function. Often useful outside of Underscore.

    -
          return '' + a === '' + b;
    -    case '[object Number]':
    +
    function constant(value) {
    +  return function() {
    +    return value;
    +  };
    +}
    @@ -2770,12 +2879,12 @@

    Object Functions

    -

    NaNs are equivalent, but non-reflexive. -Object(NaN) is equivalent to NaN.

    +

    Is a given value a typed array?

    -
          if (+a !== +a) return +b !== +b;
    +
    var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
    +function isTypedArray(obj) {
    @@ -2786,13 +2895,15 @@

    Object Functions

    -

    An egal comparison is performed for other numeric values.

    +

    ArrayBuffer.isView is the most future-proof, so use it when available. +Otherwise, fall back on the above regular expression.

    -
          return +a === 0 ? 1 / +a === 1 / b : +a === +b;
    -    case '[object Date]':
    -    case '[object Boolean]':
    +
      return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) : isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));
    +}
    +
    +var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false);
    @@ -2803,20 +2914,11 @@

    Object Functions

    -

    Coerce dates and booleans to numeric primitive values. Dates are compared by their -millisecond representations. Note that invalid dates with millisecond representations -of NaN are not equivalent.

    +

    Internal recursive comparison function for isEqual.

    -
          return +a === +b;
    -    case '[object Symbol]':
    -      return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
    -  }
    -
    -  var areArrays = className === '[object Array]';
    -  if (!areArrays) {
    -    if (typeof a != 'object' || typeof b != 'object') return false;
    +
    function eq(a, b, aStack, bStack) {
    @@ -2827,18 +2929,12 @@

    Object Functions

    -

    Objects with different constructors are not equivalent, but Objects or Arrays -from different frames are.

    +

    Identical objects are equal. 0 === -0, but they aren’t identical. +See the Harmony egal proposal.

    -
        var aCtor = a.constructor, bCtor = b.constructor;
    -    if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&
    -                             isFunction(bCtor) && bCtor instanceof bCtor)
    -                        && ('constructor' in a && 'constructor' in b)) {
    -      return false;
    -    }
    -  }
    +
      if (a === b) return a !== 0 || 1 / a === 1 / b;
    @@ -2849,11 +2945,12 @@

    Object Functions

    -

    Assume equality for cyclic structures. The algorithm for detecting cyclic -structures is adapted from ES 5.1 section 15.12.3, abstract operation JO.

    +

    null or undefined only equal to itself (strict comparison).

    +
      if (a == null || b == null) return false;
    + @@ -2863,15 +2960,11 @@

    Object Functions

    -

    Initializing stack of traversed objects. -It’s done here since we only need them for objects and arrays comparison.

    +

    NaNs are equivalent, but non-reflexive.

    -
      aStack = aStack || [];
    -  bStack = bStack || [];
    -  var length = aStack.length;
    -  while (length--) {
    +
      if (a !== a) return b !== b;
    @@ -2882,13 +2975,14 @@

    Object Functions

    -

    Linear search. Performance is inversely proportional to the number of -unique nested structures.

    +

    Exhaust primitive checks

    -
        if (aStack[length] === a) return bStack[length] === b;
    -  }
    +
      var type = typeof a;
    +  if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
    +  return deepEq(a, b, aStack, bStack);
    +}
    @@ -2899,12 +2993,11 @@

    Object Functions

    -

    Add the first object to the stack of traversed objects.

    +

    Internal recursive comparison function for isEqual.

    -
      aStack.push(a);
    -  bStack.push(b);
    +
    function deepEq(a, b, aStack, bStack) {
    @@ -2915,11 +3008,12 @@

    Object Functions

    -

    Recursively compare objects and arrays.

    +

    Unwrap any wrapped objects.

    -
      if (areArrays) {
    +
      if (a instanceof _) a = a._wrapped;
    +  if (b instanceof _) b = b._wrapped;
    @@ -2930,12 +3024,13 @@

    Object Functions

    -

    Compare array lengths to determine if a deep comparison is necessary.

    +

    Compare [[Class]] names.

    -
        length = a.length;
    -    if (length !== b.length) return false;
    +
      var className = toString.call(a);
    +  if (className !== toString.call(b)) return false;
    +  switch (className) {
    @@ -2946,14 +3041,11 @@

    Object Functions

    -

    Deep compare the contents, ignoring non-numeric properties.

    +

    These types are compared by value.

    -
        while (length--) {
    -      if (!eq(a[length], b[length], aStack, bStack)) return false;
    -    }
    -  } else {
    +
        case '[object RegExp]':
    @@ -2964,12 +3056,11 @@

    Object Functions

    -

    Deep compare objects.

    +

    RegExps are coerced to strings for comparison (Note: ‘’ + /a/i === ‘/a/i’)

    -
        var _keys = keys(a), key;
    -    length = _keys.length;
    +
        case '[object String]':
    @@ -2980,12 +3071,13 @@

    Object Functions

    -

    Ensure that both objects contain the same number of properties before comparing deep equality.

    +

    Primitives and their corresponding object wrappers are equivalent; thus, "5" is +equivalent to new String("5").

    -
        if (keys(b).length !== length) return false;
    -    while (length--) {
    +
          return '' + a === '' + b;
    +    case '[object Number]':
    @@ -2996,14 +3088,12 @@

    Object Functions

    -

    Deep compare each member

    +

    NaNs are equivalent, but non-reflexive. +Object(NaN) is equivalent to NaN.

    -
          key = _keys[length];
    -      if (!(_has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
    -    }
    -  }
    +
          if (+a !== +a) return +b !== +b;
    @@ -3014,14 +3104,13 @@

    Object Functions

    -

    Remove the first object from the stack of traversed objects.

    +

    An egal comparison is performed for other numeric values.

    -
      aStack.pop();
    -  bStack.pop();
    -  return true;
    -}
    +
          return +a === 0 ? 1 / +a === 1 / b : +a === +b;
    +    case '[object Date]':
    +    case '[object Boolean]':
    @@ -3032,13 +3121,16 @@

    Object Functions

    -

    Perform a deep comparison to check if two objects are equal.

    +

    Coerce dates and booleans to numeric primitive values. Dates are compared by their +millisecond representations. Note that invalid dates with millisecond representations +of NaN are not equivalent.

    -
    function isEqual(a, b) {
    -  return eq(a, b);
    -}
    +
          return +a === +b;
    +    case '[object Symbol]':
    +      return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
    +    case '[object ArrayBuffer]':
    @@ -3049,16 +3141,25 @@

    Object Functions

    -

    Is a given array, string, or object empty? -An “empty” object has no enumerable own-properties.

    +

    Coerce to DataView so we can fall through to the next case.

    -
    function isEmpty(obj) {
    -  if (obj == null) return true;
    -  if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments(obj))) return obj.length === 0;
    -  return keys(obj).length === 0;
    -}
    +
          return deepEq(new DataView(a), new DataView(b), aStack, bStack);
    +    case '[object DataView]':
    +      var byteLength = getByteLength(a);
    +      if (byteLength !== getByteLength(b)) {
    +        return false;
    +      }
    +      while (byteLength--) {
    +        if (a.getUint8(byteLength) !== b.getUint8(byteLength)) {
    +          return false;
    +        }
    +      }
    +      return true;
    +  }
    +
    +  if (isTypedArray$1(a)) {
    @@ -3069,13 +3170,16 @@

    Object Functions

    -

    Is a given value a DOM element?

    +

    Coerce typed arrays to DataView.

    -
    function isElement(obj) {
    -  return !!(obj && obj.nodeType === 1);
    -}
    +
        return deepEq(new DataView(a.buffer), new DataView(b.buffer), aStack, bStack);
    +  }
    +
    +  var areArrays = className === '[object Array]';
    +  if (!areArrays) {
    +    if (typeof a != 'object' || typeof b != 'object') return false;
    @@ -3086,15 +3190,18 @@

    Object Functions

    -

    Internal function for creating a toString-based type tester.

    +

    Objects with different constructors are not equivalent, but Objects or Arrays +from different frames are.

    -
    function tagTester(name) {
    -  return function(obj) {
    -    return toString.call(obj) === '[object ' + name + ']';
    -  };
    -}
    +
        var aCtor = a.constructor, bCtor = b.constructor;
    +    if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&
    +                             isFunction$1(bCtor) && bCtor instanceof bCtor)
    +                        && ('constructor' in a && 'constructor' in b)) {
    +      return false;
    +    }
    +  }
    @@ -3105,13 +3212,11 @@

    Object Functions

    -

    Is a given value an array? -Delegates to ECMA5’s native Array.isArray

    +

    Assume equality for cyclic structures. The algorithm for detecting cyclic +structures is adapted from ES 5.1 section 15.12.3, abstract operation JO.

    -
    var isArray = nativeIsArray || tagTester('Array');
    - @@ -3121,14 +3226,15 @@

    Object Functions

    -

    Is a given variable an object?

    +

    Initializing stack of traversed objects. +It’s done here since we only need them for objects and arrays comparison.

    -
    function isObject(obj) {
    -  var type = typeof obj;
    -  return type === 'function' || type === 'object' && !!obj;
    -}
    +
      aStack = aStack || [];
    +  bStack = bStack || [];
    +  var length = aStack.length;
    +  while (length--) {
    @@ -3139,22 +3245,13 @@

    Object Functions

    -

    Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError, isMap, isWeakMap, isSet, isWeakSet.

    +

    Linear search. Performance is inversely proportional to the number of +unique nested structures.

    -
    var isArguments = tagTester('Arguments');
    -var isFunction = tagTester('Function');
    -var isString = tagTester('String');
    -var isNumber = tagTester('Number');
    -var isDate = tagTester('Date');
    -var isRegExp = tagTester('RegExp');
    -var isError = tagTester('Error');
    -var isSymbol = tagTester('Symbol');
    -var isMap = tagTester('Map');
    -var isWeakMap = tagTester('WeakMap');
    -var isSet = tagTester('Set');
    -var isWeakSet = tagTester('WeakSet');
    +
        if (aStack[length] === a) return bStack[length] === b;
    +  }
    @@ -3165,18 +3262,12 @@

    Object Functions

    -

    Define a fallback version of the method in browsers (ahem, IE < 9), where -there isn’t any inspectable “Arguments” type.

    +

    Add the first object to the stack of traversed objects.

    -
    (function() {
    -  if (!isArguments(arguments)) {
    -    isArguments = function(obj) {
    -      return _has(obj, 'callee');
    -    };
    -  }
    -}());
    +
      aStack.push(a);
    +  bStack.push(b);
    @@ -3187,17 +3278,11 @@

    Object Functions

    -

    Optimize isFunction if appropriate. Work around some typeof bugs in old v8, -IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).

    +

    Recursively compare objects and arrays.

    -
    var nodelist = root.document && root.document.childNodes;
    -if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
    -  isFunction = function(obj) {
    -    return typeof obj == 'function' || false;
    -  };
    -}
    +
      if (areArrays) {
    @@ -3208,13 +3293,12 @@

    Object Functions

    -

    Is a given object a finite number?

    +

    Compare array lengths to determine if a deep comparison is necessary.

    -
    function isFinite(obj) {
    -  return !isSymbol(obj) && _isFinite(obj) && !_isNaN(parseFloat(obj));
    -}
    +
        length = a.length;
    +    if (length !== b.length) return false;
    @@ -3225,13 +3309,14 @@

    Object Functions

    -

    Is the given value NaN?

    +

    Deep compare the contents, ignoring non-numeric properties.

    -
    function isNaN(obj) {
    -  return isNumber(obj) && _isNaN(obj);
    -}
    +
        while (length--) {
    +      if (!eq(a[length], b[length], aStack, bStack)) return false;
    +    }
    +  } else {
    @@ -3242,13 +3327,12 @@

    Object Functions

    -

    Is a given value a boolean?

    +

    Deep compare objects.

    -
    function isBoolean(obj) {
    -  return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
    -}
    +
        var _keys = keys(a), key;
    +    length = _keys.length;
    @@ -3259,13 +3343,12 @@

    Object Functions

    -

    Is a given value equal to null?

    +

    Ensure that both objects contain the same number of properties before comparing deep equality.

    -
    function isNull(obj) {
    -  return obj === null;
    -}
    +
        if (keys(b).length !== length) return false;
    +    while (length--) {
    @@ -3276,13 +3359,14 @@

    Object Functions

    -

    Is a given variable undefined?

    +

    Deep compare each member

    -
    function isUndefined(obj) {
    -  return obj === void 0;
    -}
    +
          key = _keys[length];
    +      if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
    +    }
    +  }
    @@ -3293,24 +3377,13 @@

    Object Functions

    -

    Shortcut function for checking if an object has a given property directly -on itself (in other words, not on a prototype).

    +

    Remove the first object from the stack of traversed objects.

    -
    function has(obj, path) {
    -  if (!isArray(path)) {
    -    return _has(obj, path);
    -  }
    -  var length = path.length;
    -  for (var i = 0; i < length; i++) {
    -    var key = path[i];
    -    if (obj == null || !hasOwnProperty.call(obj, key)) {
    -      return false;
    -    }
    -    obj = obj[key];
    -  }
    -  return !!length;
    +            
      aStack.pop();
    +  bStack.pop();
    +  return true;
     }
    @@ -3322,10 +3395,14 @@

    Object Functions

    -

    Utility Functions

    +

    Perform a deep comparison to check if two objects are equal.

    +
    function isEqual(a, b) {
    +  return eq(a, b);
    +}
    + @@ -3335,9 +3412,14 @@

    Utility Functions

    - +

    Is a given array, string, or object empty? +An “empty” object has no enumerable own-properties.

    +
    +
    function isEmpty(obj) {
    +  if (obj == null) return true;
    + @@ -3347,12 +3429,13 @@

    Utility Functions

    -

    Keep the identity function around for default iteratees.

    +

    Skip the more expensive toString-based type checks if obj has no +.length.

    -
    function identity(value) {
    -  return value;
    +            
      if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments$1(obj))) return obj.length === 0;
    +  return keys(obj).length === 0;
     }
    @@ -3364,17 +3447,31 @@

    Utility Functions

    -

    Predicate-generating functions. Often useful outside of Underscore.

    +

    Is a given value a DOM element?

    -
    function constant(value) {
    -  return function() {
    -    return value;
    -  };
    +            
    function isElement(obj) {
    +  return !!(obj && obj.nodeType === 1);
     }
     
    -function noop(){}
    +var isDate = tagTester('Date'); + +var isRegExp = tagTester('RegExp'); + +var isError = tagTester('Error'); + +var isSymbol = tagTester('Symbol'); + +var isMap = tagTester('Map'); + +var isWeakMap = tagTester('WeakMap'); + +var isSet = tagTester('Set'); + +var isWeakSet = tagTester('WeakSet'); + +var isArrayBuffer = tagTester('ArrayBuffer');
    @@ -3385,28 +3482,100 @@

    Utility Functions

    -

    Creates a function that, when passed an object, will traverse that object’s -properties down the given path, specified as an array of keys or indexes.

    +

    Is a given object a finite number?

    -
    function property(path) {
    +            
    function isFinite$1(obj) {
    +  return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));
    +}
    + + + + +
  • +
    + +
    + +
    +

    Is a given value equal to null?

    + +
    + +
    function isNull(obj) {
    +  return obj === null;
    +}
    + +
  • + + +
  • +
    + +
    + +
    +

    Is a given variable undefined?

    + +
    + +
    function isUndefined(obj) {
    +  return obj === void 0;
    +}
    + +
  • + + +
  • +
    + +
    + +
    +

    Shortcut function for checking if an object has a given property directly +on itself (in other words, not on a prototype).

    + +
    + +
    function has$1(obj, path) {
       if (!isArray(path)) {
    -    return shallowProperty(path);
    +    return has(obj, path);
       }
    -  return function(obj) {
    -    return deepGet(obj, path);
    -  };
    +  var length = path.length;
    +  for (var i = 0; i < length; i++) {
    +    var key = path[i];
    +    if (obj == null || !hasOwnProperty.call(obj, key)) {
    +      return false;
    +    }
    +    obj = obj[key];
    +  }
    +  return !!length;
     }
  • -
  • +
  • +
    + +
    + +
    +

    Predicate-generating function. Often useful outside of Underscore.

    + +
    + +
    function noop(){}
    + +
  • + + +
  • - +

    Generates a function for a given object that returns a given property.

    @@ -3424,32 +3593,11 @@

    Utility Functions

  • -
  • -
    - -
    - -
    -

    Returns a predicate for checking whether an object has a given set of -key:value pairs.

    - -
    - -
    function matcher(attrs) {
    -  attrs = extendOwn({}, attrs);
    -  return function(obj) {
    -    return isMatch(obj, attrs);
    -  };
    -}
    - -
  • - - -
  • +
  • - +

    Run a function n times.

    @@ -3465,49 +3613,51 @@

    Utility Functions

  • -
  • +
  • - +
    -

    Return a random integer between min and max (inclusive).

    +

    Functions for escaping and unescaping strings to/from HTML interpolation.

    -
    function random(min, max) {
    -  if (max == null) {
    -    max = min;
    -    min = 0;
    -  }
    -  return min + Math.floor(Math.random() * (max - min + 1));
    -}
    +
    function createEscaper(map) {
    +  var escaper = function(match) {
    +    return map[match];
    +  };
  • -
  • +
  • - +
    -

    A (possibly faster) way to get the current timestamp as an integer.

    +

    Regexes for identifying a key that needs to be escaped.

    -
    var now = Date.now || function() {
    -  return new Date().getTime();
    -};
    +
      var source = '(?:' + keys(map).join('|') + ')';
    +  var testRegexp = RegExp(source);
    +  var replaceRegexp = RegExp(source, 'g');
    +  return function(string) {
    +    string = string == null ? '' : '' + string;
    +    return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
    +  };
    +}
  • -
  • +
  • - +

    List of HTML entities for escaping.

    @@ -3520,59 +3670,61 @@

    Utility Functions

    '"': '&quot;', "'": '&#x27;', '`': '&#x60;' -}; -var unescapeMap = invert(escapeMap);
  • +}; -
  • +
  • - +
    -

    Functions for escaping and unescaping strings to/from HTML interpolation.

    +

    Function for escaping strings to HTML interpolation.

    -
    function createEscaper(map) {
    -  var escaper = function(match) {
    -    return map[match];
    -  };
    +
    var _escape = createEscaper(escapeMap);
  • -
  • +
  • - +
    -

    Regexes for identifying a key that needs to be escaped.

    +

    List of HTML entities for unescaping.

    -
      var source = '(?:' + keys(map).join('|') + ')';
    -  var testRegexp = RegExp(source);
    -  var replaceRegexp = RegExp(source, 'g');
    -  return function(string) {
    -    string = string == null ? '' : '' + string;
    -    return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
    -  };
    -}
    -var escape = createEscaper(escapeMap);
    -var unescape = createEscaper(unescapeMap);
    +
    var unescapeMap = invert(escapeMap);
  • -
  • +
  • - + +
    +

    Function for unescaping strings from HTML interpolation.

    + +
    + +
    var _unescape = createEscaper(unescapeMap);
    + +
  • + + +
  • +
    + +
    +

    Traverses the children of obj along path. If a child is a function, it is invoked with its parent as context. Returns the value of the final @@ -3584,7 +3736,7 @@

    Utility Functions

    if (!isArray(path)) path = [path]; var length = path.length; if (!length) { - return isFunction(fallback) ? fallback.call(obj) : fallback; + return isFunction$1(fallback) ? fallback.call(obj) : fallback; } for (var i = 0; i < length; i++) { var prop = obj == null ? void 0 : obj[path[i]]; @@ -3592,7 +3744,7 @@

    Utility Functions

    prop = fallback; i = length; // Ensure we don't continue iterating. } - obj = isFunction(prop) ? prop.call(obj) : prop; + obj = isFunction$1(prop) ? prop.call(obj) : prop; } return obj; }
    @@ -3600,11 +3752,11 @@

    Utility Functions

  • -
  • +
  • - +

    Generate a unique integer id (unique within the entire client session). Useful for temporary DOM ids.

    @@ -3620,11 +3772,11 @@

    Utility Functions

  • -
  • +
  • - +

    By default, Underscore uses ERB-style template delimiters, change the following template settings to use alternative delimiters.

    @@ -3633,20 +3785,20 @@

    Utility Functions

    var templateSettings = _.templateSettings = {
       evaluate: /<%([\s\S]+?)%>/g,
    -  interpolate: /<%=([\s\S]+?)%>/g,
    -  escape: /<%-([\s\S]+?)%>/g
    +  interpolate: /<%=([\s\S]+?)%>/g,
    +  escape: /<%-([\s\S]+?)%>/g
     };
  • -
  • +
  • - +
    -

    When customizing templateSettings, if you don’t want to define an +

    When customizing _.templateSettings, if you don’t want to define an interpolation, evaluation or escaping regex, we need one that is guaranteed not to match.

    @@ -3657,11 +3809,11 @@

    Utility Functions

  • -
  • +
  • - +

    Certain characters need to be escaped so that they can be put into a string literal.

    @@ -3679,18 +3831,18 @@

    Utility Functions

    var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; -var escapeChar = function(match) { +function escapeChar(match) { return '\\' + escapes[match]; -};
    +}
  • -
  • +
  • - +

    JavaScript micro-templating, similar to John Resig’s implementation. Underscore templating handles arbitrary delimiters, preserves whitespace, @@ -3706,11 +3858,11 @@

    Utility Functions

  • -
  • +
  • - +

    Combine delimiters into one regular expression via alternation.

    @@ -3725,11 +3877,11 @@

    Utility Functions

  • -
  • +
  • - +

    Compile the template source, escaping string literals appropriately.

    @@ -3752,11 +3904,11 @@

    Utility Functions

  • -
  • +
  • - +

    Adobe VMs need the match returned to produce the correct offset.

    @@ -3769,11 +3921,11 @@

    Utility Functions

  • -
  • +
  • - +

    If a variable is not specified, place data values in local scope.

    @@ -3800,11 +3952,11 @@

    Utility Functions

  • -
  • +
  • - +

    Provide the compiled source as a convenience for precompilation.

    @@ -3819,11 +3971,11 @@

    Utility Functions

  • -
  • +
  • - +

    Add a “chain” function. Start chaining a wrapped Underscore object.

    @@ -3838,39 +3990,11 @@

    Utility Functions

  • -
  • -
    - -
    - -
    -

    OOP

    - -
    - -
  • - - -
  • -
    - -
    - -
    -

    If Underscore is called as a function, it returns a wrapped object that -can be used OO-style. This wrapper holds altered versions of all the -underscore functions. Wrapped objects may be chained.

    - -
    - -
  • - - -
  • +
  • - +

    Helper function to continue chaining intermediate results.

    @@ -3883,11 +4007,11 @@

    OOP

  • -
  • +
  • - +

    Add your own custom functions to the Underscore object.

    @@ -3908,11 +4032,11 @@

    OOP

  • -
  • +
  • - +

    Add all mutator Array functions to the wrapper.

    @@ -3922,8 +4046,12 @@

    OOP

    var method = ArrayProto[name]; _.prototype[name] = function() { var obj = this._wrapped; - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; + if (obj != null) { + method.apply(obj, arguments); + if ((name === 'shift' || name === 'splice') && obj.length === 0) { + delete obj[0]; + } + } return chainResult(this, obj); }; });
    @@ -3931,11 +4059,11 @@

    OOP

  • -
  • +
  • - +

    Add all accessor Array functions to the wrapper.

    @@ -3944,18 +4072,20 @@

    OOP

    each(['concat', 'join', 'slice'], function(name) {
       var method = ArrayProto[name];
       _.prototype[name] = function() {
    -    return chainResult(this, method.apply(this._wrapped, arguments));
    +    var obj = this._wrapped;
    +    if (obj != null) obj = method.apply(obj, arguments);
    +    return chainResult(this, obj);
       };
     });
  • -
  • +
  • - +

    Extracts the result from a wrapped and chained object.

    @@ -3968,11 +4098,11 @@

    OOP

  • -
  • +
  • - +

    Provide unwrapping proxy for some methods used in engine operations such as arithmetic and JSON stringification.

    @@ -3983,10 +4113,23 @@

    OOP

    _.prototype.toString = function() { return String(this._wrapped); -}; - -var allExports = ({ - 'default': _, +};
    + +
  • + + +
  • +
    + +
    + +
    +
    Underscore.js 1.10.2
    +
    + +
    +var allExports = {
    +  __proto__: null,
       VERSION: VERSION,
       iteratee: iteratee,
       restArguments: restArguments,
    @@ -4035,7 +4178,7 @@ 

    OOP

    tail: rest, drop: rest, compact: compact, - flatten: flatten, + flatten: flatten$1, without: without, uniq: uniq, unique: uniq, @@ -4090,8 +4233,8 @@

    OOP

    isElement: isElement, isArray: isArray, isObject: isObject, - isArguments: isArguments, - isFunction: isFunction, + isArguments: isArguments$1, + isFunction: isFunction$1, isString: isString, isNumber: isNumber, isDate: isDate, @@ -4102,12 +4245,15 @@

    OOP

    isWeakMap: isWeakMap, isSet: isSet, isWeakSet: isWeakSet, - isFinite: isFinite, - isNaN: isNaN, + isArrayBuffer: isArrayBuffer, + isDataView: isDataView, + isFinite: isFinite$1, + isNaN: isNaN$1, isBoolean: isBoolean, isNull: isNull, isUndefined: isUndefined, - has: has, + isTypedArray: isTypedArray$1, + has: has$1, identity: identity, constant: constant, noop: noop, @@ -4118,24 +4264,38 @@

    OOP

    times: times, random: random, now: now, - escape: escape, - unescape: unescape, + escape: _escape, + unescape: _unescape, result: result, uniqueId: uniqueId, templateSettings: templateSettings, template: template, chain: chain, - mixin: mixin -});
    + mixin: mixin, + 'default': _ +};
  • -
  • +
  • - + +
    +

    In this module, we mix our bundled exports into the _ object and export

    + +
    + +
  • + + +
  • +
    + +
    +

    Add all of the Underscore functions to the wrapper object.

    @@ -4146,20 +4306,47 @@

    OOP

  • -
  • +
  • - +

    Legacy Node.js API

    -
    _$1._ = _$1;
    +            
    _$1._ = _$1;
    + +
  • + + +
  • +
    + +
    + +
    +

    This module is the package entry point for ES module users. In other words,

    +
    + +
     export default _$1;
    -export { VERSION, iteratee, restArguments, each, each as forEach, map, map as collect, reduce, reduce as foldl, reduce as inject, reduceRight, reduceRight as foldr, find, find as detect, filter, filter as select, reject, every, every as all, some, some as any, contains, contains as includes, contains as include, invoke, pluck, where, findWhere, max, min, shuffle, sample, sortBy, groupBy, indexBy, countBy, toArray, size, partition, first, first as head, first as take, initial, last, rest, rest as tail, rest as drop, compact, flatten, without, uniq, uniq as unique, union, intersection, difference, unzip, zip, object, findIndex, findLastIndex, sortedIndex, indexOf, lastIndexOf, range, chunk, bind, partial, bindAll, memoize, delay, defer, throttle, debounce, wrap, negate, compose, after, before, once, keys, allKeys, values, mapObject, pairs, invert, functions, functions as methods, extend, extendOwn, extendOwn as assign, findKey, pick, omit, defaults, create, clone, tap, isMatch, isEqual, isEmpty, isElement, isArray, isObject, isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError, isSymbol, isMap, isWeakMap, isSet, isWeakSet, isFinite, isNaN, isBoolean, isNull, isUndefined, has, identity, constant, noop, property, propertyOf, matcher, matcher as matches, times, random, now, escape, unescape, result, uniqueId, templateSettings, template, chain, mixin };
    +export { VERSION, after, every as all, allKeys, some as any, extendOwn as assign, before, bind, bindAll, chain, chunk, clone, map as collect, compact, compose, constant, contains, countBy, create, debounce, defaults, defer, delay, find as detect, difference, rest as drop, each, _escape as escape, every, extend, extendOwn, filter, find, findIndex, findKey, findLastIndex, findWhere, first, flatten$1 as flatten, reduce as foldl, reduceRight as foldr, each as forEach, functions, groupBy, has$1 as has, first as head, identity, contains as include, contains as includes, indexBy, indexOf, initial, reduce as inject, intersection, invert, invoke, isArguments$1 as isArguments, isArray, isArrayBuffer, isBoolean, isDataView, isDate, isElement, isEmpty, isEqual, isError, isFinite$1 as isFinite, isFunction$1 as isFunction, isMap, isMatch, isNaN$1 as isNaN, isNull, isNumber, isObject, isRegExp, isSet, isString, isSymbol, isTypedArray$1 as isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, keys, last, lastIndexOf, map, mapObject, matcher, matcher as matches, max, memoize, functions as methods, min, mixin, negate, noop, now, object, omit, once, pairs, partial, partition, pick, pluck, property, propertyOf, random, range, reduce, reduceRight, reject, rest, restArguments, result, sample, filter as select, shuffle, size, some, sortBy, sortedIndex, rest as tail, first as take, tap, template, templateSettings, throttle, times, toArray, _unescape as unescape, union, uniq, uniq as unique, uniqueId, unzip, values, where, without, wrap, zip }; + +
  • + + +
  • +
    + +
    + +
    +

    sourceMappingURL=underscore-esm.js.map

    + +
  • diff --git a/index.html b/index.html index e785d72eb..37400f25b 100644 --- a/index.html +++ b/index.html @@ -190,7 +190,8 @@ diff --git a/modules/_baseCreate.js b/modules/_baseCreate.js new file mode 100644 index 000000000..032a97281 --- /dev/null +++ b/modules/_baseCreate.js @@ -0,0 +1,18 @@ +import isObject from './isObject.js'; +import { nativeCreate } from './_setup.js'; + +// Create a naked function reference for surrogate-prototype-swapping. +function ctor() { + return function(){}; +} + +// An internal function for creating a new object that inherits from another. +export default function baseCreate(prototype) { + if (!isObject(prototype)) return {}; + if (nativeCreate) return nativeCreate(prototype); + var Ctor = ctor(); + Ctor.prototype = prototype; + var result = new Ctor; + Ctor.prototype = null; + return result; +} diff --git a/modules/_baseIteratee.js b/modules/_baseIteratee.js new file mode 100644 index 000000000..c276ebec1 --- /dev/null +++ b/modules/_baseIteratee.js @@ -0,0 +1,17 @@ +import identity from './identity.js'; +import isFunction from './isFunction.js'; +import isObject from './isObject.js'; +import isArray from './isArray.js'; +import matcher from './matcher.js'; +import property from './property.js'; +import optimizeCb from './_optimizeCb.js'; + +// An internal function to generate callbacks that can be applied to each +// element in a collection, returning the desired result — either `_.identity`, +// an arbitrary callback, a property matcher, or a property accessor. +export default function baseIteratee(value, context, argCount) { + if (value == null) return identity; + if (isFunction(value)) return optimizeCb(value, context, argCount); + if (isObject(value) && !isArray(value)) return matcher(value); + return property(value); +} diff --git a/modules/_cb.js b/modules/_cb.js new file mode 100644 index 000000000..9b8b55571 --- /dev/null +++ b/modules/_cb.js @@ -0,0 +1,10 @@ +import _ from './underscore.js'; +import baseIteratee from './_baseIteratee.js'; +import iteratee from './iteratee.js'; + +// The function we call internally to generate a callback. It invokes +// `_.iteratee` if overridden, otherwise `baseIteratee`. +export default function cb(value, context, argCount) { + if (_.iteratee !== iteratee) return _.iteratee(value, context); + return baseIteratee(value, context, argCount); +} diff --git a/modules/_chainResult.js b/modules/_chainResult.js new file mode 100644 index 000000000..b786520c9 --- /dev/null +++ b/modules/_chainResult.js @@ -0,0 +1,6 @@ +import _ from './underscore.js'; + +// Helper function to continue chaining intermediate results. +export default function chainResult(instance, obj) { + return instance._chain ? _(obj).chain() : obj; +} diff --git a/modules/_collectNonEnumProps.js b/modules/_collectNonEnumProps.js new file mode 100644 index 000000000..18a2af075 --- /dev/null +++ b/modules/_collectNonEnumProps.js @@ -0,0 +1,40 @@ +import { nonEnumerableProps, ObjProto } from './_setup.js'; +import isFunction from './isFunction.js'; +import has from './_has.js'; + +// Internal helper to create a simple lookup structure. +// `collectNonEnumProps` used to depend on `_.contains`, but this led to +// circular imports. `emulatedSet` is a one-off solution that only works for +// arrays of strings. +function emulatedSet(keys) { + var hash = {}; + for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; + return { + contains: function(key) { return hash[key]; }, + push: function(key) { + hash[key] = true; + return keys.push(key); + } + }; +} + +// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't +// be iterated by `for key in ...` and thus missed. Extends `keys` in place if +// needed. +export default function collectNonEnumProps(obj, keys) { + keys = emulatedSet(keys); + var nonEnumIdx = nonEnumerableProps.length; + var constructor = obj.constructor; + var proto = isFunction(constructor) && constructor.prototype || ObjProto; + + // Constructor is a special case. + var prop = 'constructor'; + if (has(obj, prop) && !keys.contains(prop)) keys.push(prop); + + while (nonEnumIdx--) { + prop = nonEnumerableProps[nonEnumIdx]; + if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { + keys.push(prop); + } + } +} diff --git a/modules/_createAssigner.js b/modules/_createAssigner.js new file mode 100644 index 000000000..b10239317 --- /dev/null +++ b/modules/_createAssigner.js @@ -0,0 +1,18 @@ +// An internal function for creating assigner functions. +export default function createAssigner(keysFunc, defaults) { + return function(obj) { + var length = arguments.length; + if (defaults) obj = Object(obj); + if (length < 2 || obj == null) return obj; + for (var index = 1; index < length; index++) { + var source = arguments[index], + keys = keysFunc(source), + l = keys.length; + for (var i = 0; i < l; i++) { + var key = keys[i]; + if (!defaults || obj[key] === void 0) obj[key] = source[key]; + } + } + return obj; + }; +} diff --git a/modules/_createEscaper.js b/modules/_createEscaper.js new file mode 100644 index 000000000..3828b56f3 --- /dev/null +++ b/modules/_createEscaper.js @@ -0,0 +1,17 @@ +import keys from './keys.js'; + +// Internal helper to generate functions for escaping and unescaping strings +// to/from HTML interpolation. +export default function createEscaper(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped. + var source = '(?:' + keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; +} diff --git a/modules/_createIndexFinder.js b/modules/_createIndexFinder.js new file mode 100644 index 000000000..eadedef0b --- /dev/null +++ b/modules/_createIndexFinder.js @@ -0,0 +1,28 @@ +import getLength from './_getLength.js'; +import { slice } from './_setup.js'; +import isNaN from './isNaN.js'; + +// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. +export default function createIndexFinder(dir, predicateFind, sortedIndex) { + return function(array, item, idx) { + var i = 0, length = getLength(array); + if (typeof idx == 'number') { + if (dir > 0) { + i = idx >= 0 ? idx : Math.max(idx + length, i); + } else { + length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; + } + } else if (sortedIndex && idx && length) { + idx = sortedIndex(array, item); + return array[idx] === item ? idx : -1; + } + if (item !== item) { + idx = predicateFind(slice.call(array, i, length), isNaN); + return idx >= 0 ? idx + i : -1; + } + for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { + if (array[idx] === item) return idx; + } + return -1; + }; +} diff --git a/modules/_createPredicateIndexFinder.js b/modules/_createPredicateIndexFinder.js new file mode 100644 index 000000000..c0659485d --- /dev/null +++ b/modules/_createPredicateIndexFinder.js @@ -0,0 +1,15 @@ +import cb from './_cb.js'; +import getLength from './_getLength.js'; + +// Internal function to generate `_.findIndex` and `_.findLastIndex`. +export default function createPredicateIndexFinder(dir) { + return function(array, predicate, context) { + predicate = cb(predicate, context); + var length = getLength(array); + var index = dir > 0 ? 0 : length - 1; + for (; index >= 0 && index < length; index += dir) { + if (predicate(array[index], index, array)) return index; + } + return -1; + }; +} diff --git a/modules/_createReduce.js b/modules/_createReduce.js new file mode 100644 index 000000000..20f4ee117 --- /dev/null +++ b/modules/_createReduce.js @@ -0,0 +1,28 @@ +import isArrayLike from './_isArrayLike.js'; +import keys from './keys.js'; +import optimizeCb from './_optimizeCb.js'; + +// Internal helper to create a reducing function, iterating left or right. +export default function createReduce(dir) { + // Wrap code that reassigns argument variables in a separate function than + // the one that accesses `arguments.length` to avoid a perf hit. (#1991) + var reducer = function(obj, iteratee, memo, initial) { + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length, + index = dir > 0 ? 0 : length - 1; + if (!initial) { + memo = obj[_keys ? _keys[index] : index]; + index += dir; + } + for (; index >= 0 && index < length; index += dir) { + var currentKey = _keys ? _keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + }; + + return function(obj, iteratee, memo, context) { + var initial = arguments.length >= 3; + return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); + }; +} diff --git a/modules/_createSizePropertyCheck.js b/modules/_createSizePropertyCheck.js new file mode 100644 index 000000000..cc38007bc --- /dev/null +++ b/modules/_createSizePropertyCheck.js @@ -0,0 +1,9 @@ +import { MAX_ARRAY_INDEX } from './_setup.js'; + +// Common internal logic for `isArrayLike` and `isBufferLike`. +export default function createSizePropertyCheck(getSizeProperty) { + return function(collection) { + var sizeProperty = getSizeProperty(collection); + return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; + } +} diff --git a/modules/_deepGet.js b/modules/_deepGet.js new file mode 100644 index 000000000..42bbec310 --- /dev/null +++ b/modules/_deepGet.js @@ -0,0 +1,9 @@ +// Internal function to obtain a nested property in `obj` along `path`. +export default function deepGet(obj, path) { + var length = path.length; + for (var i = 0; i < length; i++) { + if (obj == null) return void 0; + obj = obj[path[i]]; + } + return length ? obj : void 0; +} diff --git a/modules/_escapeMap.js b/modules/_escapeMap.js new file mode 100644 index 000000000..cc9d615f5 --- /dev/null +++ b/modules/_escapeMap.js @@ -0,0 +1,9 @@ +// Internal list of HTML entities for escaping. +export default { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' +}; diff --git a/modules/_executeBound.js b/modules/_executeBound.js new file mode 100644 index 000000000..f54fa7802 --- /dev/null +++ b/modules/_executeBound.js @@ -0,0 +1,13 @@ +import baseCreate from './_baseCreate.js'; +import isObject from './isObject.js'; + +// Internal function to execute `sourceFunc` bound to `context` with optional +// `args`. Determines whether to execute a function as a constructor or as a +// normal function. +export default function executeBound(sourceFunc, boundFunc, context, callingContext, args) { + if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); + var self = baseCreate(sourceFunc.prototype); + var result = sourceFunc.apply(self, args); + if (isObject(result)) return result; + return self; +} diff --git a/modules/_flatten.js b/modules/_flatten.js new file mode 100644 index 000000000..a98726574 --- /dev/null +++ b/modules/_flatten.js @@ -0,0 +1,26 @@ +import getLength from './_getLength.js'; +import isArrayLike from './_isArrayLike.js'; +import isArray from './isArray.js'; +import isArguments from './isArguments.js'; + +// Internal implementation of a recursive `flatten` function. +export default function flatten(input, shallow, strict, output) { + output = output || []; + var idx = output.length; + for (var i = 0, length = getLength(input); i < length; i++) { + var value = input[i]; + if (isArrayLike(value) && (isArray(value) || isArguments(value))) { + // Flatten current level of array or arguments object. + if (shallow) { + var j = 0, len = value.length; + while (j < len) output[idx++] = value[j++]; + } else { + flatten(value, shallow, strict, output); + idx = output.length; + } + } else if (!strict) { + output[idx++] = value; + } + } + return output; +} diff --git a/modules/_getByteLength.js b/modules/_getByteLength.js new file mode 100644 index 000000000..11e452875 --- /dev/null +++ b/modules/_getByteLength.js @@ -0,0 +1,4 @@ +import shallowProperty from './_shallowProperty.js'; + +// Internal helper to obtain the `byteLength` property of an object. +export default shallowProperty('byteLength'); diff --git a/modules/_getLength.js b/modules/_getLength.js new file mode 100644 index 000000000..090b156b0 --- /dev/null +++ b/modules/_getLength.js @@ -0,0 +1,4 @@ +import shallowProperty from './_shallowProperty.js'; + +// Internal helper to obtain the `length` property of an object. +export default shallowProperty('length'); diff --git a/modules/_group.js b/modules/_group.js new file mode 100644 index 000000000..8fdd9857c --- /dev/null +++ b/modules/_group.js @@ -0,0 +1,15 @@ +import cb from './_cb.js'; +import each from './each.js'; + +// An internal function used for aggregate "group by" operations. +export default function group(behavior, partition) { + return function(obj, iteratee, context) { + var result = partition ? [[], []] : {}; + iteratee = cb(iteratee, context); + each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; +} diff --git a/modules/_has.js b/modules/_has.js new file mode 100644 index 000000000..06361812d --- /dev/null +++ b/modules/_has.js @@ -0,0 +1,6 @@ +import { hasOwnProperty } from './_setup.js'; + +// Internal function to check whether `key` is an own property name of `obj`. +export default function has(obj, key) { + return obj != null && hasOwnProperty.call(obj, key); +} diff --git a/modules/_isArrayLike.js b/modules/_isArrayLike.js new file mode 100644 index 000000000..a87fe488b --- /dev/null +++ b/modules/_isArrayLike.js @@ -0,0 +1,8 @@ +import createSizePropertyCheck from './_createSizePropertyCheck.js'; +import getLength from './_getLength.js'; + +// Internal helper for collection methods to determine whether a collection +// should be iterated as an array or as an object. +// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength +// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 +export default createSizePropertyCheck(getLength); diff --git a/modules/_isBufferLike.js b/modules/_isBufferLike.js new file mode 100644 index 000000000..8cab6ee01 --- /dev/null +++ b/modules/_isBufferLike.js @@ -0,0 +1,6 @@ +import createSizePropertyCheck from './_createSizePropertyCheck.js'; +import getByteLength from './_getByteLength.js'; + +// Internal helper to determine whether we should spend extensive checks against +// `ArrayBuffer` et al. +export default createSizePropertyCheck(getByteLength); diff --git a/modules/_keyInObj.js b/modules/_keyInObj.js new file mode 100644 index 000000000..f72a85141 --- /dev/null +++ b/modules/_keyInObj.js @@ -0,0 +1,5 @@ +// Internal `_.pick` helper function to determine whether `key` is an enumerable +// property name of `obj`. +export default function keyInObj(value, key, obj) { + return key in obj; +} diff --git a/modules/_optimizeCb.js b/modules/_optimizeCb.js new file mode 100644 index 000000000..59e40e660 --- /dev/null +++ b/modules/_optimizeCb.js @@ -0,0 +1,21 @@ +// Internal function that returns an efficient (for current engines) version +// of the passed-in callback, to be repeatedly applied in other Underscore +// functions. +export default function optimizeCb(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + // The 2-argument case is omitted because we’re not using it. + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; +} diff --git a/modules/_setup.js b/modules/_setup.js new file mode 100644 index 000000000..13c770c75 --- /dev/null +++ b/modules/_setup.js @@ -0,0 +1,42 @@ +// Current version. +export var VERSION = '1.10.2'; + +// Establish the root object, `window` (`self`) in the browser, `global` +// on the server, or `this` in some virtual machines. We use `self` +// instead of `window` for `WebWorker` support. +export var root = typeof self == 'object' && self.self === self && self || + typeof global == 'object' && global.global === global && global || + Function('return this')() || + {}; + +// Save bytes in the minified (but not gzipped) version: +export var ArrayProto = Array.prototype, ObjProto = Object.prototype; +export var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; + +// Create quick reference variables for speed access to core prototypes. +export var push = ArrayProto.push, + slice = ArrayProto.slice, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + +// Modern feature detection. +export var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined'; + +// All **ECMAScript 5+** native function implementations that we hope to use +// are declared here. +export var nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeCreate = Object.create, + nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; + +// Create references to these builtin functions because we override them. +export var _isNaN = isNaN, + _isFinite = isFinite; + +// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. +export var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); +export var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', + 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; + +// The largest integer that can be represented exactly. +export var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; diff --git a/modules/_shallowProperty.js b/modules/_shallowProperty.js new file mode 100644 index 000000000..00bf09022 --- /dev/null +++ b/modules/_shallowProperty.js @@ -0,0 +1,6 @@ +// Internal helper to generate a function to obtain property `key` from `obj`. +export default function shallowProperty(key) { + return function(obj) { + return obj == null ? void 0 : obj[key]; + }; +} diff --git a/modules/_tagTester.js b/modules/_tagTester.js new file mode 100644 index 000000000..341b35bfd --- /dev/null +++ b/modules/_tagTester.js @@ -0,0 +1,8 @@ +import { toString } from './_setup.js'; + +// Internal function for creating a `toString`-based type tester. +export default function tagTester(name) { + return function(obj) { + return toString.call(obj) === '[object ' + name + ']'; + }; +} diff --git a/modules/_unescapeMap.js b/modules/_unescapeMap.js new file mode 100644 index 000000000..af35e3d70 --- /dev/null +++ b/modules/_unescapeMap.js @@ -0,0 +1,5 @@ +import invert from './invert.js'; +import escapeMap from './_escapeMap.js'; + +// Internal list of HTML entities for unescaping. +export default invert(escapeMap); diff --git a/modules/after.js b/modules/after.js new file mode 100644 index 000000000..863e8b517 --- /dev/null +++ b/modules/after.js @@ -0,0 +1,8 @@ +// Returns a function that will only be executed on and after the Nth call. +export default function after(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; +} diff --git a/modules/allKeys.js b/modules/allKeys.js new file mode 100644 index 000000000..489cead5f --- /dev/null +++ b/modules/allKeys.js @@ -0,0 +1,13 @@ +import isObject from './isObject.js'; +import { hasEnumBug } from './_setup.js'; +import collectNonEnumProps from './_collectNonEnumProps.js'; + +// Retrieve all the enumerable property names of an object. +export default function allKeys(obj) { + if (!isObject(obj)) return []; + var keys = []; + for (var key in obj) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; +} diff --git a/modules/before.js b/modules/before.js new file mode 100644 index 000000000..74ec24486 --- /dev/null +++ b/modules/before.js @@ -0,0 +1,12 @@ +// Returns a function that will only be executed up to (but not including) the +// Nth call. +export default function before(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } + if (times <= 1) func = null; + return memo; + }; +} diff --git a/modules/bind.js b/modules/bind.js new file mode 100644 index 000000000..c172e3459 --- /dev/null +++ b/modules/bind.js @@ -0,0 +1,13 @@ +import restArguments from './restArguments.js'; +import isFunction from './isFunction.js'; +import executeBound from './_executeBound.js'; + +// Create a function bound to a given object (assigning `this`, and arguments, +// optionally). +export default restArguments(function(func, context, args) { + if (!isFunction(func)) throw new TypeError('Bind must be called on a function'); + var bound = restArguments(function(callArgs) { + return executeBound(func, bound, context, this, args.concat(callArgs)); + }); + return bound; +}); diff --git a/modules/bindAll.js b/modules/bindAll.js new file mode 100644 index 000000000..da51aebdb --- /dev/null +++ b/modules/bindAll.js @@ -0,0 +1,17 @@ +import restArguments from './restArguments.js'; +import flatten from './_flatten.js'; +import bind from './bind.js'; + +// Bind a number of an object's methods to that object. Remaining arguments +// are the method names to be bound. Useful for ensuring that all callbacks +// defined on an object belong to it. +export default restArguments(function(obj, keys) { + keys = flatten(keys, false, false); + var index = keys.length; + if (index < 1) throw new Error('bindAll must be passed function names'); + while (index--) { + var key = keys[index]; + obj[key] = bind(obj[key], obj); + } + return obj; +}); diff --git a/modules/chain.js b/modules/chain.js new file mode 100644 index 000000000..d9dcf057e --- /dev/null +++ b/modules/chain.js @@ -0,0 +1,8 @@ +import _ from './underscore.js'; + +// Start chaining a wrapped Underscore object. +export default function chain(obj) { + var instance = _(obj); + instance._chain = true; + return instance; +} diff --git a/modules/chunk.js b/modules/chunk.js new file mode 100644 index 000000000..5e01af5db --- /dev/null +++ b/modules/chunk.js @@ -0,0 +1,13 @@ +import { slice } from './_setup.js'; + +// Chunk a single array into multiple arrays, each containing `count` or fewer +// items. +export default function chunk(array, count) { + if (count == null || count < 1) return []; + var result = []; + var i = 0, length = array.length; + while (i < length) { + result.push(slice.call(array, i, i += count)); + } + return result; +} diff --git a/modules/clone.js b/modules/clone.js new file mode 100644 index 000000000..b74689b50 --- /dev/null +++ b/modules/clone.js @@ -0,0 +1,9 @@ +import isObject from './isObject.js'; +import isArray from './isArray.js'; +import extend from './extend.js'; + +// Create a (shallow-cloned) duplicate of an object. +export default function clone(obj) { + if (!isObject(obj)) return obj; + return isArray(obj) ? obj.slice() : extend({}, obj); +} diff --git a/modules/compact.js b/modules/compact.js new file mode 100644 index 000000000..d5d519e38 --- /dev/null +++ b/modules/compact.js @@ -0,0 +1,6 @@ +import filter from './filter.js'; + +// Trim out all falsy values from an array. +export default function compact(array) { + return filter(array, Boolean); +} diff --git a/modules/compose.js b/modules/compose.js new file mode 100644 index 000000000..0d2584c88 --- /dev/null +++ b/modules/compose.js @@ -0,0 +1,12 @@ +// Returns a function that is the composition of a list of functions, each +// consuming the return value of the function that follows. +export default function compose() { + var args = arguments; + var start = args.length - 1; + return function() { + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; + }; +} diff --git a/modules/constant.js b/modules/constant.js new file mode 100644 index 000000000..6cfd92ce7 --- /dev/null +++ b/modules/constant.js @@ -0,0 +1,6 @@ +// Predicate-generating function. Often useful outside of Underscore. +export default function constant(value) { + return function() { + return value; + }; +} diff --git a/modules/contains.js b/modules/contains.js new file mode 100644 index 000000000..11cf64d61 --- /dev/null +++ b/modules/contains.js @@ -0,0 +1,10 @@ +import isArrayLike from './_isArrayLike.js'; +import values from './values.js'; +import indexOf from './indexOf.js'; + +// Determine if the array or object contains a given item (using `===`). +export default function contains(obj, item, fromIndex, guard) { + if (!isArrayLike(obj)) obj = values(obj); + if (typeof fromIndex != 'number' || guard) fromIndex = 0; + return indexOf(obj, item, fromIndex) >= 0; +} diff --git a/modules/countBy.js b/modules/countBy.js new file mode 100644 index 000000000..5d4cc7d94 --- /dev/null +++ b/modules/countBy.js @@ -0,0 +1,9 @@ +import group from './_group.js'; +import has from './_has.js'; + +// Counts instances of an object that group by a certain criterion. Pass +// either a string attribute to count by, or a function that returns the +// criterion. +export default group(function(result, value, key) { + if (has(result, key)) result[key]++; else result[key] = 1; +}); diff --git a/modules/create.js b/modules/create.js new file mode 100644 index 000000000..353e5a504 --- /dev/null +++ b/modules/create.js @@ -0,0 +1,11 @@ +import baseCreate from './_baseCreate.js'; +import extendOwn from './extendOwn.js'; + +// Creates an object that inherits from the given prototype object. +// If additional properties are provided then they will be added to the +// created object. +export default function create(prototype, props) { + var result = baseCreate(prototype); + if (props) extendOwn(result, props); + return result; +} diff --git a/modules/debounce.js b/modules/debounce.js new file mode 100644 index 000000000..c77d9568e --- /dev/null +++ b/modules/debounce.js @@ -0,0 +1,35 @@ +import restArguments from './restArguments.js'; +import delay from './delay.js'; + +// Returns a function, that, as long as it continues to be invoked, will not +// be triggered. The function will be triggered after it stops being called for +// N milliseconds. If `immediate` is passed, trigger the function on the +// leading edge, instead of the trailing. +export default function debounce(func, wait, immediate) { + var timeout, result; + + var later = function(context, args) { + timeout = null; + if (args) result = func.apply(context, args); + }; + + var debounced = restArguments(function(args) { + if (timeout) clearTimeout(timeout); + if (immediate) { + var callNow = !timeout; + timeout = setTimeout(later, wait); + if (callNow) result = func.apply(this, args); + } else { + timeout = delay(later, wait, this, args); + } + + return result; + }); + + debounced.cancel = function() { + clearTimeout(timeout); + timeout = null; + }; + + return debounced; +} diff --git a/modules/defaults.js b/modules/defaults.js new file mode 100644 index 000000000..48016cca4 --- /dev/null +++ b/modules/defaults.js @@ -0,0 +1,5 @@ +import createAssigner from './_createAssigner.js'; +import allKeys from './allKeys.js'; + +// Fill in a given object with default properties. +export default createAssigner(allKeys, true); diff --git a/modules/defer.js b/modules/defer.js new file mode 100644 index 000000000..19c85fd5e --- /dev/null +++ b/modules/defer.js @@ -0,0 +1,7 @@ +import partial from './partial.js'; +import delay from './delay.js'; +import _ from './underscore.js'; + +// Defers a function, scheduling it to run after the current call stack has +// cleared. +export default partial(delay, _, 1); diff --git a/modules/delay.js b/modules/delay.js new file mode 100644 index 000000000..c144a846d --- /dev/null +++ b/modules/delay.js @@ -0,0 +1,9 @@ +import restArguments from './restArguments.js'; + +// Delays a function for the given number of milliseconds, and then calls +// it with the arguments supplied. +export default restArguments(function(func, wait, args) { + return setTimeout(function() { + return func.apply(null, args); + }, wait); +}); diff --git a/modules/difference.js b/modules/difference.js new file mode 100644 index 000000000..c769923dd --- /dev/null +++ b/modules/difference.js @@ -0,0 +1,13 @@ +import restArguments from './restArguments.js'; +import flatten from './_flatten.js'; +import filter from './filter.js'; +import contains from './contains.js'; + +// Take the difference between one array and a number of other arrays. +// Only the elements present in just the first array will remain. +export default restArguments(function(array, rest) { + rest = flatten(rest, true, true); + return filter(array, function(value){ + return !contains(rest, value); + }); +}); diff --git a/modules/each.js b/modules/each.js new file mode 100644 index 000000000..d05020099 --- /dev/null +++ b/modules/each.js @@ -0,0 +1,23 @@ +import optimizeCb from './_optimizeCb.js'; +import isArrayLike from './_isArrayLike.js'; +import keys from './keys.js'; + +// The cornerstone for collection functions, an `each` +// implementation, aka `forEach`. +// Handles raw objects in addition to array-likes. Treats all +// sparse array-likes as if they were dense. +export default function each(obj, iteratee, context) { + iteratee = optimizeCb(iteratee, context); + var i, length; + if (isArrayLike(obj)) { + for (i = 0, length = obj.length; i < length; i++) { + iteratee(obj[i], i, obj); + } + } else { + var _keys = keys(obj); + for (i = 0, length = _keys.length; i < length; i++) { + iteratee(obj[_keys[i]], _keys[i], obj); + } + } + return obj; +} diff --git a/modules/escape.js b/modules/escape.js new file mode 100644 index 000000000..2bcb68f00 --- /dev/null +++ b/modules/escape.js @@ -0,0 +1,5 @@ +import createEscaper from './_createEscaper.js'; +import escapeMap from './_escapeMap.js'; + +// Function for escaping strings to HTML interpolation. +export default createEscaper(escapeMap); diff --git a/modules/every.js b/modules/every.js new file mode 100644 index 000000000..9bc1408b4 --- /dev/null +++ b/modules/every.js @@ -0,0 +1,15 @@ +import cb from './_cb.js'; +import isArrayLike from './_isArrayLike.js'; +import keys from './keys.js'; + +// Determine whether all of the elements pass a truth test. +export default function every(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; +} diff --git a/modules/extend.js b/modules/extend.js new file mode 100644 index 000000000..e22032b4a --- /dev/null +++ b/modules/extend.js @@ -0,0 +1,5 @@ +import createAssigner from './_createAssigner.js'; +import allKeys from './allKeys.js'; + +// Extend a given object with all the properties in passed-in object(s). +export default createAssigner(allKeys); diff --git a/modules/extendOwn.js b/modules/extendOwn.js new file mode 100644 index 000000000..5338451da --- /dev/null +++ b/modules/extendOwn.js @@ -0,0 +1,7 @@ +import createAssigner from './_createAssigner.js'; +import keys from './keys.js'; + +// Assigns a given object with all the own properties in the passed-in +// object(s). +// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) +export default createAssigner(keys); diff --git a/modules/filter.js b/modules/filter.js new file mode 100644 index 000000000..d1701125d --- /dev/null +++ b/modules/filter.js @@ -0,0 +1,12 @@ +import cb from './_cb.js'; +import each from './each.js'; + +// Return all the elements that pass a truth test. +export default function filter(obj, predicate, context) { + var results = []; + predicate = cb(predicate, context); + each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); + }); + return results; +} diff --git a/modules/find.js b/modules/find.js new file mode 100644 index 000000000..d1f4d280e --- /dev/null +++ b/modules/find.js @@ -0,0 +1,10 @@ +import isArrayLike from './_isArrayLike.js'; +import findIndex from './findIndex.js'; +import findKey from './findKey.js'; + +// Return the first value which passes a truth test. +export default function find(obj, predicate, context) { + var keyFinder = isArrayLike(obj) ? findIndex : findKey; + var key = keyFinder(obj, predicate, context); + if (key !== void 0 && key !== -1) return obj[key]; +} diff --git a/modules/findIndex.js b/modules/findIndex.js new file mode 100644 index 000000000..b2c87f518 --- /dev/null +++ b/modules/findIndex.js @@ -0,0 +1,4 @@ +import createPredicateIndexFinder from './_createPredicateIndexFinder.js'; + +// Returns the first index on an array-like that passes a truth test. +export default createPredicateIndexFinder(1); diff --git a/modules/findKey.js b/modules/findKey.js new file mode 100644 index 000000000..e80f1c116 --- /dev/null +++ b/modules/findKey.js @@ -0,0 +1,12 @@ +import cb from './_cb.js'; +import keys from './keys.js'; + +// Returns the first key on an object that passes a truth test. +export default function findKey(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = keys(obj), key; + for (var i = 0, length = _keys.length; i < length; i++) { + key = _keys[i]; + if (predicate(obj[key], key, obj)) return key; + } +} diff --git a/modules/findLastIndex.js b/modules/findLastIndex.js new file mode 100644 index 000000000..58f26a73f --- /dev/null +++ b/modules/findLastIndex.js @@ -0,0 +1,4 @@ +import createPredicateIndexFinder from './_createPredicateIndexFinder.js'; + +// Returns the last index on an array-like that passes a truth test. +export default createPredicateIndexFinder(-1); diff --git a/modules/findWhere.js b/modules/findWhere.js new file mode 100644 index 000000000..6e8bce9e0 --- /dev/null +++ b/modules/findWhere.js @@ -0,0 +1,8 @@ +import find from './find.js'; +import matcher from './matcher.js'; + +// Convenience version of a common use case of `_.find`: getting the first +// object containing specific `key:value` pairs. +export default function findWhere(obj, attrs) { + return find(obj, matcher(attrs)); +} diff --git a/modules/first.js b/modules/first.js new file mode 100644 index 000000000..3b6685e17 --- /dev/null +++ b/modules/first.js @@ -0,0 +1,9 @@ +import initial from './initial.js'; + +// Get the first element of an array. Passing **n** will return the first N +// values in the array. The **guard** check allows it to work with `_.map`. +export default function first(array, n, guard) { + if (array == null || array.length < 1) return n == null || guard ? void 0 : []; + if (n == null || guard) return array[0]; + return initial(array, array.length - n); +} diff --git a/modules/flatten.js b/modules/flatten.js new file mode 100644 index 000000000..035bbd213 --- /dev/null +++ b/modules/flatten.js @@ -0,0 +1,6 @@ +import _flatten from './_flatten.js'; + +// Flatten out an array, either recursively (by default), or just one level. +export default function flatten(array, shallow) { + return _flatten(array, shallow, false); +} diff --git a/modules/functions.js b/modules/functions.js new file mode 100644 index 000000000..a16e5683b --- /dev/null +++ b/modules/functions.js @@ -0,0 +1,10 @@ +import isFunction from './isFunction.js'; + +// Return a sorted list of the function names available on the object. +export default function functions(obj) { + var names = []; + for (var key in obj) { + if (isFunction(obj[key])) names.push(key); + } + return names.sort(); +} diff --git a/modules/groupBy.js b/modules/groupBy.js new file mode 100644 index 000000000..2670958d8 --- /dev/null +++ b/modules/groupBy.js @@ -0,0 +1,8 @@ +import group from './_group.js'; +import has from './_has.js'; + +// Groups the object's values by a criterion. Pass either a string attribute +// to group by, or a function that returns the criterion. +export default group(function(result, value, key) { + if (has(result, key)) result[key].push(value); else result[key] = [value]; +}); diff --git a/modules/has.js b/modules/has.js new file mode 100644 index 000000000..66d2410cf --- /dev/null +++ b/modules/has.js @@ -0,0 +1,21 @@ +import isArray from './isArray.js'; +import _has from './_has.js'; +import { hasOwnProperty } from './_setup.js'; + +// Shortcut function for checking if an object has a given property directly on +// itself (in other words, not on a prototype). Unlike the internal `has` +// function, this public version can also traverse nested properties. +export default function has(obj, path) { + if (!isArray(path)) { + return _has(obj, path); + } + var length = path.length; + for (var i = 0; i < length; i++) { + var key = path[i]; + if (obj == null || !hasOwnProperty.call(obj, key)) { + return false; + } + obj = obj[key]; + } + return !!length; +} diff --git a/modules/identity.js b/modules/identity.js new file mode 100644 index 000000000..6df631c16 --- /dev/null +++ b/modules/identity.js @@ -0,0 +1,4 @@ +// Keep the identity function around for default iteratees. +export default function identity(value) { + return value; +} diff --git a/modules/index-all.js b/modules/index-all.js index e1663067f..dd2cbc1d2 100644 --- a/modules/index-all.js +++ b/modules/index-all.js @@ -1,2 +1,18 @@ +// ESM Exports +// =========== +// This module is the package entry point for ES module users. In other words, +// it is the module they are interfacing with when they import from the whole +// package instead of from a submodule, like this: +// +// ```js +// import { map } from 'underscore'; +// ``` +// +// The difference with `./index-default`, which is the package entry point for +// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and +// default exports are considered to be siblings, so when you have a default +// export, its properties are not automatically available as named exports. For +// this reason, we re-export the named exports in addition to providing the same +// default export as in `./index-default`. export { default } from './index-default.js'; export * from './index.js'; diff --git a/modules/index-default.js b/modules/index-default.js index 4a4a112c7..d3a2b1e8b 100644 --- a/modules/index-default.js +++ b/modules/index-default.js @@ -1,9 +1,27 @@ +// Default Export +// ============== +// In this module, we mix our bundled exports into the `_` object and export +// the result. This is analogous to setting `module.exports = _` in CommonJS. +// Hence, this module is also the entry point of our UMD bundle and the package +// entry point for CommonJS and AMD users. In other words, this is (the source +// of) the module you are interfacing with when you do any of the following: +// +// ```js +// // CommonJS +// var _ = require('underscore'); +// +// // AMD +// define(['underscore'], function(_) {...}); +// +// // UMD in the browser +// // _ is available as a global variable +// ``` import * as allExports from './index.js'; import { mixin } from './index.js'; // Add all of the Underscore functions to the wrapper object. var _ = mixin(allExports); -// Legacy Node.js API +// Legacy Node.js API. _._ = _; // Export the Underscore API. export default _; diff --git a/modules/index.js b/modules/index.js index 1b30cef75..cbb468d44 100644 --- a/modules/index.js +++ b/modules/index.js @@ -1,1731 +1,197 @@ +// Named Exports +// ============= + // Underscore.js 1.10.2 // https://underscorejs.org // (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. -// Baseline setup -// -------------- - -// Establish the root object, `window` (`self`) in the browser, `global` -// on the server, or `this` in some virtual machines. We use `self` -// instead of `window` for `WebWorker` support. -var root = typeof self == 'object' && self.self === self && self || - typeof global == 'object' && global.global === global && global || - Function('return this')() || - {}; - -// 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, - slice = ArrayProto.slice, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - -// Modern feature detection. -var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined'; - -// All **ECMAScript 5+** native function implementations that we hope to use -// are declared here. -var nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeCreate = Object.create, - nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; - -// Create references to these builtin functions because we override them. -var _isNaN = root.isNaN, - _isFinite = root.isFinite; - -// Naked function reference for surrogate-prototype-swapping. -var Ctor = function(){}; - -// The Underscore object. All exported functions below are added to it in the -// modules/index-all.js using the mixin function. -export default function _(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; -} - -// Current version. -export var VERSION = _.VERSION = '1.10.2'; - -// Internal function that returns an efficient (for current engines) version -// of the passed-in callback, to be repeatedly applied in other Underscore -// functions. -function optimizeCb(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - // The 2-argument case is omitted because we’re not using it. - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; -} - -// An internal function to generate callbacks that can be applied to each -// element in a collection, returning the desired result — either `identity`, -// an arbitrary callback, a property matcher, or a property accessor. -function baseIteratee(value, context, argCount) { - if (value == null) return identity; - if (isFunction(value)) return optimizeCb(value, context, argCount); - if (isObject(value) && !isArray(value)) return matcher(value); - return property(value); -} - -// External wrapper for our callback generator. Users may customize -// `_.iteratee` if they want additional predicate/iteratee shorthand styles. -// This abstraction hides the internal-only argCount argument. -_.iteratee = iteratee; -export function iteratee(value, context) { - return baseIteratee(value, context, Infinity); -} - -// The function we actually call internally. It invokes _.iteratee if -// overridden, otherwise baseIteratee. -function cb(value, context, argCount) { - if (_.iteratee !== iteratee) return _.iteratee(value, context); - return baseIteratee(value, context, argCount); -} - -// Some functions take a variable number of arguments, or a few expected -// arguments at the beginning and then a variable number of values to operate -// on. This helper accumulates all remaining arguments past the function’s -// argument length (or an explicit `startIndex`), into an array that becomes -// the last argument. Similar to ES6’s "rest parameter". -export function restArguments(func, startIndex) { - startIndex = startIndex == null ? func.length - 1 : +startIndex; - return function() { - var length = Math.max(arguments.length - startIndex, 0), - rest = Array(length), - index = 0; - for (; index < length; index++) { - rest[index] = arguments[index + startIndex]; - } - switch (startIndex) { - case 0: return func.call(this, rest); - case 1: return func.call(this, arguments[0], rest); - case 2: return func.call(this, arguments[0], arguments[1], rest); - } - var args = Array(startIndex + 1); - for (index = 0; index < startIndex; index++) { - args[index] = arguments[index]; - } - args[startIndex] = rest; - return func.apply(this, args); - }; -} - -// An internal function for creating a new object that inherits from another. -function baseCreate(prototype) { - if (!isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; -} - -function shallowProperty(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; -} - -function _has(obj, path) { - return obj != null && hasOwnProperty.call(obj, path); -} - -function deepGet(obj, path) { - var length = path.length; - for (var i = 0; i < length; i++) { - if (obj == null) return void 0; - obj = obj[path[i]]; - } - return length ? obj : void 0; -} - -// Common logic for isArrayLike and isBufferLike. -var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; -function createSizePropertyCheck(getSizeProperty) { - return function(collection) { - var sizeProperty = getSizeProperty(collection); - return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; - } -} - -// Helper for collection methods to determine whether a collection -// should be iterated as an array or as an object. -// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength -// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 -var getLength = shallowProperty('length'); -var isArrayLike = createSizePropertyCheck(getLength); - -// Likewise to determine whether we should spend extensive checks against -// `ArrayBuffer` et al. -var getByteLength = shallowProperty('byteLength'); -var isBufferLike = createSizePropertyCheck(getByteLength); - -// Collection Functions -// -------------------- - -// The cornerstone, an `each` implementation, aka `forEach`. -// Handles raw objects in addition to array-likes. Treats all -// sparse array-likes as if they were dense. -export function each(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var _keys = keys(obj); - for (i = 0, length = _keys.length; i < length; i++) { - iteratee(obj[_keys[i]], _keys[i], obj); - } - } - return obj; -} -export { each as forEach }; - -// Return the results of applying the iteratee to each element. -export function map(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} -export { map as collect }; - -// Create a reducing function iterating left or right. -function createReduce(dir) { - // Wrap code that reassigns argument variables in a separate function than - // the one that accesses `arguments.length` to avoid a perf hit. (#1991) - var reducer = function(obj, iteratee, memo, initial) { - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - index = dir > 0 ? 0 : length - 1; - if (!initial) { - memo = obj[_keys ? _keys[index] : index]; - index += dir; - } - for (; index >= 0 && index < length; index += dir) { - var currentKey = _keys ? _keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - return function(obj, iteratee, memo, context) { - var initial = arguments.length >= 3; - return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); - }; -} - -// **Reduce** builds up a single result from a list of values, aka `inject`, -// or `foldl`. -export var reduce = createReduce(1); -export { reduce as foldl, reduce as inject }; - -// The right-associative version of reduce, also known as `foldr`. -export var reduceRight = createReduce(-1); -export { reduceRight as foldr }; - -// Return the first value which passes a truth test. -export function find(obj, predicate, context) { - var keyFinder = isArrayLike(obj) ? findIndex : findKey; - var key = keyFinder(obj, predicate, context); - if (key !== void 0 && key !== -1) return obj[key]; -} -export { find as detect }; - -// Return all the elements that pass a truth test. -export function filter(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; -} -export { filter as select }; - -// Return all the elements for which a truth test fails. -export function reject(obj, predicate, context) { - return filter(obj, negate(cb(predicate)), context); -} - -// Determine whether all of the elements match a truth test. -export function every(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; -} -export { every as all }; - -// Determine if at least one element in the object matches a truth test. -export function some(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; -} -export { some as any }; - -// Determine if the array or object contains a given item (using `===`). -export function contains(obj, item, fromIndex, guard) { - if (!isArrayLike(obj)) obj = values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return indexOf(obj, item, fromIndex) >= 0; -} -export { contains as includes, contains as include }; - -// Invoke a method (with arguments) on every item in a collection. -export var invoke = restArguments(function(obj, path, args) { - var contextPath, func; - if (isFunction(path)) { - func = path; - } else if (isArray(path)) { - contextPath = path.slice(0, -1); - path = path[path.length - 1]; - } - return map(obj, function(context) { - var method = func; - if (!method) { - if (contextPath && contextPath.length) { - context = deepGet(context, contextPath); - } - if (context == null) return void 0; - method = context[path]; - } - return method == null ? method : method.apply(context, args); - }); -}); - -// Convenience version of a common use case of `map`: fetching a property. -export function pluck(obj, key) { - return map(obj, property(key)); -} - -// Convenience version of a common use case of `filter`: selecting only objects -// containing specific `key:value` pairs. -export function where(obj, attrs) { - return filter(obj, matcher(attrs)); -} - -// Convenience version of a common use case of `find`: getting the first object -// containing specific `key:value` pairs. -export function findWhere(obj, attrs) { - return find(obj, matcher(attrs)); -} - -// Return the maximum element (or element-based computation). -export function max(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed > lastComputed || computed === -Infinity && result === -Infinity) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} - -// Return the minimum element (or element-based computation). -export function min(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed < lastComputed || computed === Infinity && result === Infinity) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} - -// Shuffle a collection. -export function shuffle(obj) { - return sample(obj, Infinity); -} - -// Sample **n** random values from a collection using the modern version of the -// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). -// If **n** is not specified, returns a single random element. -// The internal `guard` argument allows it to work with `map`. -export function sample(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = values(obj); - return obj[random(obj.length - 1)]; - } - var sample = isArrayLike(obj) ? clone(obj) : values(obj); - var length = getLength(sample); - n = Math.max(Math.min(n, length), 0); - var last = length - 1; - for (var index = 0; index < n; index++) { - var rand = random(index, last); - var temp = sample[index]; - sample[index] = sample[rand]; - sample[rand] = temp; - } - return sample.slice(0, n); -} - -// Sort the object's values by a criterion produced by an iteratee. -export function sortBy(obj, iteratee, context) { - var index = 0; - iteratee = cb(iteratee, context); - return pluck(map(obj, function(value, key, list) { - return { - value: value, - index: index++, - criteria: iteratee(value, key, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); -} - -// An internal function used for aggregate "group by" operations. -function group(behavior, partition) { - return function(obj, iteratee, context) { - var result = partition ? [[], []] : {}; - iteratee = cb(iteratee, context); - each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; -} - -// Groups the object's values by a criterion. Pass either a string attribute -// to group by, or a function that returns the criterion. -export var groupBy = group(function(result, value, key) { - if (_has(result, key)) result[key].push(value); else result[key] = [value]; -}); - -// Indexes the object's values by a criterion, similar to `groupBy`, but for -// when you know that your index values will be unique. -export var indexBy = group(function(result, value, key) { - result[key] = value; -}); - -// Counts instances of an object that group by a certain criterion. Pass -// either a string attribute to count by, or a function that returns the -// criterion. -export var countBy = group(function(result, value, key) { - if (_has(result, key)) result[key]++; else result[key] = 1; -}); - -var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; -// Safely create a real, live array from anything iterable. -export function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together - return obj.match(reStrSymbol); - } - if (isArrayLike(obj)) return map(obj, identity); - return values(obj); -} - -// Return the number of elements in an object. -export function size(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : keys(obj).length; -} - -// Split a collection into two arrays: one whose elements all satisfy the given -// predicate, and one whose elements all do not satisfy the predicate. -export var partition = group(function(result, value, pass) { - result[pass ? 0 : 1].push(value); -}, true); - -// Array Functions -// --------------- - -// Get the first element of an array. Passing **n** will return the first N -// values in the array. The **guard** check allows it to work with `map`. -export function first(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[0]; - return initial(array, array.length - n); -} -export { first as head, first as take }; - -// Returns everything but the last entry of the array. Especially useful on -// the arguments object. Passing **n** will return all the values in -// the array, excluding the last N. -export function initial(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); -} - -// Get the last element of an array. Passing **n** will return the last N -// values in the array. -export function last(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[array.length - 1]; - return rest(array, Math.max(0, array.length - n)); -} - -// Returns everything but the first entry of the array. Especially useful on -// the arguments object. Passing an **n** will return the rest N values in the -// array. -export function rest(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); -} -export { rest as tail, rest as drop }; - -// Trim out all falsy values from an array. -export function compact(array) { - return filter(array, Boolean); -} - -// Internal implementation of a recursive `flatten` function. -function _flatten(input, shallow, strict, output) { - output = output || []; - var idx = output.length; - for (var i = 0, length = getLength(input); i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (isArray(value) || isArguments(value))) { - // Flatten current level of array or arguments object. - if (shallow) { - var j = 0, len = value.length; - while (j < len) output[idx++] = value[j++]; - } else { - _flatten(value, shallow, strict, output); - idx = output.length; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; -} - -// Flatten out an array, either recursively (by default), or just one level. -export function flatten(array, shallow) { - return _flatten(array, shallow, false); -} - -// Return a version of the array that does not contain the specified value(s). -export var without = restArguments(function(array, otherArrays) { - return difference(array, otherArrays); -}); - -// Produce a duplicate-free version of the array. If the array has already -// been sorted, you have the option of using a faster algorithm. -// The faster algorithm will not work with an iteratee if the iteratee -// is not a one-to-one function, so providing an iteratee will disable -// the faster algorithm. -export function uniq(array, isSorted, iteratee, context) { - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted && !iteratee) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!contains(result, value)) { - result.push(value); - } - } - return result; -} -export { uniq as unique }; - -// Produce an array that contains the union: each distinct element from all of -// the passed-in arrays. -export var union = restArguments(function(arrays) { - return uniq(_flatten(arrays, true, true)); -}); - -// Produce an array that contains every item shared between all the -// passed-in arrays. -export function intersection(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = getLength(array); i < length; i++) { - var item = array[i]; - if (contains(result, item)) continue; - var j; - for (j = 1; j < argsLength; j++) { - if (!contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; -} - -// Take the difference between one array and a number of other arrays. -// Only the elements present in just the first array will remain. -export var difference = restArguments(function(array, rest) { - rest = _flatten(rest, true, true); - return filter(array, function(value){ - return !contains(rest, value); - }); -}); - -// Complement of zip. Unzip accepts an array of arrays and groups -// each array's elements on shared indices. -export function unzip(array) { - var length = array && max(array, getLength).length || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = pluck(array, index); - } - return result; -} - -// Zip together multiple lists into a single array -- elements that share -// an index go together. -export var zip = restArguments(unzip); - -// Converts lists into objects. Pass either a single array of `[key, value]` -// pairs, or two parallel arrays of the same length -- one of keys, and one of -// the corresponding values. Passing by pairs is the reverse of pairs. -export function object(list, values) { - var result = {}; - for (var i = 0, length = getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; -} - -// Generator function to create the findIndex and findLastIndex functions. -function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; -} - -// Returns the first index on an array-like that passes a predicate test. -export var findIndex = createPredicateIndexFinder(1); -export var findLastIndex = createPredicateIndexFinder(-1); - -// Use a comparator function to figure out the smallest index at which -// an object should be inserted so as to maintain order. Uses binary search. -export function sortedIndex(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; -} - -// Generator function to create the indexOf and lastIndexOf functions. -function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(slice.call(array, i, length), isNaN); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; -} - -// Return the position of the first occurrence of an item in an array, -// or -1 if the item is not included in the array. -// If the array is large and already in sort order, pass `true` -// for **isSorted** to use binary search. -export var indexOf = createIndexFinder(1, findIndex, sortedIndex); -export var lastIndexOf = createIndexFinder(-1, findLastIndex); - -// Generate an integer Array containing an arithmetic progression. A port of -// the native Python `range()` function. See -// [the Python documentation](https://docs.python.org/library/functions.html#range). -export function range(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - if (!step) { - step = stop < start ? -1 : 1; - } - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; -} - -// Chunk a single array into multiple arrays, each containing `count` or fewer -// items. -export function chunk(array, count) { - if (count == null || count < 1) return []; - var result = []; - var i = 0, length = array.length; - while (i < length) { - result.push(slice.call(array, i, i += count)); - } - return result; -} - -// Function (ahem) Functions -// ------------------ - -// Determines whether to execute a function as a constructor -// or a normal function with the provided arguments. -function executeBound(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (isObject(result)) return result; - return self; -} - -// Create a function bound to a given object (assigning `this`, and arguments, -// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if -// available. -export var bind = restArguments(function(func, context, args) { - if (!isFunction(func)) throw new TypeError('Bind must be called on a function'); - var bound = restArguments(function(callArgs) { - return executeBound(func, bound, context, this, args.concat(callArgs)); - }); - return bound; -}); - -// Partially apply a function by creating a version that has had some of its -// arguments pre-filled, without changing its dynamic `this` context. _ acts -// as a placeholder by default, allowing any combination of arguments to be -// pre-filled. Set `partial.placeholder` for a custom placeholder argument. -export var partial = restArguments(function(func, boundArgs) { - var placeholder = partial.placeholder; - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; -}); - -partial.placeholder = _; - -// Bind a number of an object's methods to that object. Remaining arguments -// are the method names to be bound. Useful for ensuring that all callbacks -// defined on an object belong to it. -export var bindAll = restArguments(function(obj, _keys) { - _keys = _flatten(_keys, false, false); - var index = _keys.length; - if (index < 1) throw new Error('bindAll must be passed function names'); - while (index--) { - var key = _keys[index]; - obj[key] = bind(obj[key], obj); - } - return obj; -}); - -// Memoize an expensive function by storing its results. -export function memoize(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!_has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; -} - -// Delays a function for the given number of milliseconds, and then calls -// it with the arguments supplied. -export var delay = restArguments(function(func, wait, args) { - return setTimeout(function() { - return func.apply(null, args); - }, wait); -}); - -// Defers a function, scheduling it to run after the current call stack has -// cleared. -export var defer = partial(delay, _, 1); - -// Returns a function, that, when invoked, will only be triggered at most once -// during a given window of time. Normally, the throttled function will run -// as much as it can, without ever going more than once per `wait` duration; -// but if you'd like to disable the execution on the leading edge, pass -// `{leading: false}`. To disable execution on the trailing edge, ditto. -export function throttle(func, wait, options) { - var timeout, context, args, result; - var previous = 0; - if (!options) options = {}; - - var later = function() { - previous = options.leading === false ? 0 : now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - - var throttled = function() { - var _now = now(); - if (!previous && options.leading === false) previous = _now; - var remaining = wait - (_now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = _now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - - throttled.cancel = function() { - clearTimeout(timeout); - previous = 0; - timeout = context = args = null; - }; - - return throttled; -} - -// Returns a function, that, as long as it continues to be invoked, will not -// be triggered. The function will be called after it stops being called for -// N milliseconds. If `immediate` is passed, trigger the function on the -// leading edge, instead of the trailing. -export function debounce(func, wait, immediate) { - var timeout, result; - - var later = function(context, args) { - timeout = null; - if (args) result = func.apply(context, args); - }; - - var debounced = restArguments(function(args) { - if (timeout) clearTimeout(timeout); - if (immediate) { - var callNow = !timeout; - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(this, args); - } else { - timeout = delay(later, wait, this, args); - } - - return result; - }); - - debounced.cancel = function() { - clearTimeout(timeout); - timeout = null; - }; - - return debounced; -} - -// Returns the first function passed as an argument to the second, -// allowing you to adjust arguments, run code before and after, and -// conditionally execute the original function. -export function wrap(func, wrapper) { - return partial(wrapper, func); -} - -// Returns a negated version of the passed-in predicate. -export function negate(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; -} - -// Returns a function that is the composition of a list of functions, each -// consuming the return value of the function that follows. -export function compose() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; -} - -// Returns a function that will only be executed on and after the Nth call. -export function after(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; -} - -// Returns a function that will only be executed up to (but not including) the Nth call. -export function before(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; -} - -// Returns a function that will be executed at most one time, no matter how -// often you call it. Useful for lazy initialization. -export var once = partial(before, 2); +// Baseline setup. +export { VERSION } from './_setup.js'; +export { default as restArguments } from './restArguments.js'; // Object Functions // ---------------- - -// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. -var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); -var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - -function collectNonEnumProps(obj, _keys) { - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = isFunction(constructor) && constructor.prototype || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (_has(obj, prop) && !contains(_keys, prop)) _keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !contains(_keys, prop)) { - _keys.push(prop); - } - } -} - -// Retrieve the names of an object's own properties. -// Delegates to **ECMAScript 5**'s native `Object.keys`. -export function keys(obj) { - if (!isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var _keys = []; - for (var key in obj) if (_has(obj, key)) _keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, _keys); - return _keys; -} - -// Retrieve all the property names of an object. -export function allKeys(obj) { - if (!isObject(obj)) return []; - var _keys = []; - for (var key in obj) _keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, _keys); - return _keys; -} - -// Retrieve the values of an object's properties. -export function values(obj) { - var _keys = keys(obj); - var length = _keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[_keys[i]]; - } - return values; -} - -// Returns the results of applying the iteratee to each element of the object. -// In contrast to map it returns an object. -export function mapObject(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = keys(obj), - length = _keys.length, - results = {}; - for (var index = 0; index < length; index++) { - var currentKey = _keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} - -// Convert an object into a list of `[key, value]` pairs. -// The opposite of object. -export function pairs(obj) { - var _keys = keys(obj); - var length = _keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [_keys[i], obj[_keys[i]]]; - } - return pairs; -} - -// Invert the keys and values of an object. The values must be serializable. -export function invert(obj) { - var result = {}; - var _keys = keys(obj); - for (var i = 0, length = _keys.length; i < length; i++) { - result[obj[_keys[i]]] = _keys[i]; - } - return result; -} - -// Return a sorted list of the function names available on the object. -export function functions(obj) { - var names = []; - for (var key in obj) { - if (isFunction(obj[key])) names.push(key); - } - return names.sort(); -} -export { functions as methods }; - -// An internal function for creating assigner functions. -function createAssigner(keysFunc, defaults) { - return function(obj) { - var length = arguments.length; - if (defaults) obj = Object(obj); - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - _keys = keysFunc(source), - l = _keys.length; - for (var i = 0; i < l; i++) { - var key = _keys[i]; - if (!defaults || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; -} - -// Extend a given object with all the properties in passed-in object(s). -export var extend = createAssigner(allKeys); - -// Assigns a given object with all the own properties in the passed-in object(s). -// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) -export var extendOwn = createAssigner(keys); -export { extendOwn as assign }; - -// Returns the first key on an object that passes a predicate test. -export function findKey(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = keys(obj), key; - for (var i = 0, length = _keys.length; i < length; i++) { - key = _keys[i]; - if (predicate(obj[key], key, obj)) return key; - } -} - -// Internal pick helper function to determine if `obj` has key `key`. -function keyInObj(value, key, obj) { - return key in obj; -} - -// Return a copy of the object only containing the whitelisted properties. -export var pick = restArguments(function(obj, _keys) { - var result = {}, iteratee = _keys[0]; - if (obj == null) return result; - if (isFunction(iteratee)) { - if (_keys.length > 1) iteratee = optimizeCb(iteratee, _keys[1]); - _keys = allKeys(obj); - } else { - iteratee = keyInObj; - _keys = _flatten(_keys, false, false); - obj = Object(obj); - } - for (var i = 0, length = _keys.length; i < length; i++) { - var key = _keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; -}); - -// Return a copy of the object without the blacklisted properties. -export var omit = restArguments(function(obj, _keys) { - var iteratee = _keys[0], context; - if (isFunction(iteratee)) { - iteratee = negate(iteratee); - if (_keys.length > 1) context = _keys[1]; - } else { - _keys = map(_flatten(_keys, false, false), String); - iteratee = function(value, key) { - return !contains(_keys, key); - }; - } - return pick(obj, iteratee, context); -}); - -// Fill in a given object with default properties. -export var defaults = createAssigner(allKeys, true); - -// Creates an object that inherits from the given prototype object. -// If additional properties are provided then they will be added to the -// created object. -export function create(prototype, props) { - var result = baseCreate(prototype); - if (props) extendOwn(result, props); - return result; -} - -// Create a (shallow-cloned) duplicate of an object. -export function clone(obj) { - if (!isObject(obj)) return obj; - return isArray(obj) ? obj.slice() : extend({}, obj); -} - -// Invokes interceptor with the obj, and then returns obj. -// The primary purpose of this method is to "tap into" a method chain, in -// order to perform operations on intermediate results within the chain. -export function tap(obj, interceptor) { - interceptor(obj); - return obj; -} - -// Returns whether an object has a given set of `key:value` pairs. -export function isMatch(object, attrs) { - var _keys = keys(attrs), length = _keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = _keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; -} - - -// Internal recursive comparison function for `isEqual`. -function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // `null` or `undefined` only equal to itself (strict comparison). - if (a == null || b == null) return false; - // `NaN`s are equivalent, but non-reflexive. - if (a !== a) return b !== b; - // Exhaust primitive checks - var type = typeof a; - if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; - return deepEq(a, b, aStack, bStack); -} - -// Internal recursive comparison function for `isEqual`. -function deepEq(a, b, aStack, bStack) { - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - - switch (className) { - // These types are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN. - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // 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); - case '[object ArrayBuffer]': - // Coerce to `DataView` so we can fall through to the next case. - return deepEq(new DataView(a), new DataView(b), aStack, bStack); - case '[object DataView]': - var byteLength = getByteLength(a); - if (byteLength !== getByteLength(b)) { - return false; - } - while (byteLength--) { - if (a.getUint8(byteLength) !== b.getUint8(byteLength)) { - return false; - } - } - return true; - } - - if (isTypedArray(a)) { - // Coerce typed arrays to `DataView`. - return deepEq(new DataView(a.buffer), new DataView(b.buffer), aStack, bStack); - } - - var areArrays = className === '[object Array]'; - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && - isFunction(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var _keys = keys(a), key; - length = _keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = _keys[length]; - if (!(_has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; -} - -// Perform a deep comparison to check if two objects are equal. -export function isEqual(a, b) { - return eq(a, b); -} - -// Is a given array, string, or object empty? -// An "empty" object has no enumerable own-properties. -export function isEmpty(obj) { - if (obj == null) return true; - // Skip the more expensive `toString`-based type checks if `obj` has no - // `.length`. - if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments(obj))) return obj.length === 0; - return keys(obj).length === 0; -} - -// Is a given value a DOM element? -export function isElement(obj) { - return !!(obj && obj.nodeType === 1); -} - -// Internal function for creating a toString-based type tester. -function tagTester(name) { - return function(obj) { - return toString.call(obj) === '[object ' + name + ']'; - }; -} - -// Is a given value an array? -// Delegates to ECMA5's native Array.isArray -export var isArray = nativeIsArray || tagTester('Array'); - -// Is a given variable an object? -export function isObject(obj) { - var type = typeof obj; - return type === 'function' || type === 'object' && !!obj; -} - -// Add some isType methods. -export var isArguments = tagTester('Arguments'); -export var isFunction = tagTester('Function'); -export var isString = tagTester('String'); -export var isNumber = tagTester('Number'); -export var isDate = tagTester('Date'); -export var isRegExp = tagTester('RegExp'); -export var isError = tagTester('Error'); -export var isSymbol = tagTester('Symbol'); -export var isMap = tagTester('Map'); -export var isWeakMap = tagTester('WeakMap'); -export var isSet = tagTester('Set'); -export var isWeakSet = tagTester('WeakSet'); -export var isArrayBuffer = tagTester('ArrayBuffer'); -export var isDataView = tagTester('DataView'); - -// Define a fallback version of the method in browsers (ahem, IE < 9), where -// there isn't any inspectable "Arguments" type. -(function() { - if (!isArguments(arguments)) { - isArguments = function(obj) { - return _has(obj, 'callee'); - }; - } -}()); - -// Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, -// IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). -var nodelist = root.document && root.document.childNodes; -if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { - isFunction = function(obj) { - return typeof obj == 'function' || false; - }; -} - -// Is a given object a finite number? -export function isFinite(obj) { - return !isSymbol(obj) && _isFinite(obj) && !_isNaN(parseFloat(obj)); -} - -// Is the given value `NaN`? -export function isNaN(obj) { - return isNumber(obj) && _isNaN(obj); -} - -// Is a given value a boolean? -export function isBoolean(obj) { - return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; -} - -// Is a given value equal to null? -export function isNull(obj) { - return obj === null; -} - -// Is a given variable undefined? -export function isUndefined(obj) { - return obj === void 0; -} - -// Is a given value a typed array? -var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; -export var isTypedArray = supportsArrayBuffer ? function(obj) { - // `ArrayBuffer.isView` is the most future-proof, so use it when available. - // Otherwise, fall back on the above regular expression. - return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) : isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); -} : constant(false); - -// Shortcut function for checking if an object has a given property directly -// on itself (in other words, not on a prototype). -export function has(obj, path) { - if (!isArray(path)) { - return _has(obj, path); - } - var length = path.length; - for (var i = 0; i < length; i++) { - var key = path[i]; - if (obj == null || !hasOwnProperty.call(obj, key)) { - return false; - } - obj = obj[key]; - } - return !!length; -} +// Our most fundamental functions operate on any JavaScript object. +// Most functions in Underscore depend on at least one function in this section. + +// A group of functions that check the types of core JavaScript values. +// These are often informally referred to as the "isType" functions. +export { default as isObject } from './isObject.js'; +export { default as isNull } from './isNull.js'; +export { default as isUndefined } from './isUndefined.js'; +export { default as isBoolean } from './isBoolean.js'; +export { default as isElement } from './isElement.js'; +export { default as isString } from './isString.js'; +export { default as isNumber } from './isNumber.js'; +export { default as isDate } from './isDate.js'; +export { default as isRegExp } from './isRegExp.js'; +export { default as isError } from './isError.js'; +export { default as isSymbol } from './isSymbol.js'; +export { default as isMap } from './isMap.js'; +export { default as isWeakMap } from './isWeakMap.js'; +export { default as isSet } from './isSet.js'; +export { default as isWeakSet } from './isWeakSet.js'; +export { default as isArrayBuffer } from './isArrayBuffer.js'; +export { default as isDataView } from './isDataView.js'; +export { default as isArray } from './isArray.js'; +export { default as isFunction } from './isFunction.js'; +export { default as isArguments } from './isArguments.js'; +export { default as isFinite } from './isFinite.js'; +export { default as isNaN } from './isNaN.js'; +export { default as isTypedArray } from './isTypedArray.js'; +export { default as isEmpty } from './isEmpty.js'; +export { default as isMatch } from './isMatch.js'; +export { default as isEqual } from './isEqual.js'; + +// Functions that treat an object as a dictionary of key-value pairs. +export { default as keys } from './keys.js'; +export { default as allKeys } from './allKeys.js'; +export { default as values } from './values.js'; +export { default as pairs } from './pairs.js'; +export { default as invert } from './invert.js'; +export { default as functions, + default as methods } from './functions.js'; +export { default as extend } from './extend.js'; +export { default as extendOwn, + default as assign } from './extendOwn.js'; +export { default as defaults } from './defaults.js'; +export { default as create } from './create.js'; +export { default as clone } from './clone.js'; +export { default as tap } from './tap.js'; +export { default as has } from './has.js'; +export { default as mapObject } from './mapObject.js'; // Utility Functions // ----------------- +// A bit of a grab bag: Predicate-generating functions for use with filters and +// loops, string escaping and templating, create random numbers and unique ids, +// and functions that facilitate Underscore's chaining and iteration conventions. +export { default as identity } from './identity.js'; +export { default as constant } from './constant.js'; +export { default as noop } from './noop.js'; +export { default as property } from './property.js'; +export { default as propertyOf } from './propertyOf.js'; +export { default as matcher, + default as matches } from './matcher.js'; +export { default as times } from './times.js'; +export { default as random } from './random.js'; +export { default as now } from './now.js'; +export { default as escape } from './escape.js'; +export { default as unescape } from './unescape.js'; +export { default as templateSettings } from './templateSettings.js'; +export { default as template } from './template.js'; +export { default as result } from './result.js'; +export { default as uniqueId } from './uniqueId.js'; +export { default as chain } from './chain.js'; +export { default as iteratee } from './iteratee.js'; -// Keep the identity function around for default iteratees. -export function identity(value) { - return value; -} - -// Predicate-generating functions. Often useful outside of Underscore. -export function constant(value) { - return function() { - return value; - }; -} - -export function noop(){} - -// Creates a function that, when passed an object, will traverse that object’s -// properties down the given `path`, specified as an array of keys or indexes. -export function property(path) { - if (!isArray(path)) { - return shallowProperty(path); - } - return function(obj) { - return deepGet(obj, path); - }; -} - -// Generates a function for a given object that returns a given property. -export function propertyOf(obj) { - if (obj == null) { - return function(){}; - } - return function(path) { - return !isArray(path) ? obj[path] : deepGet(obj, path); - }; -} - -// Returns a predicate for checking whether an object has a given set of -// `key:value` pairs. -export function matcher(attrs) { - attrs = extendOwn({}, attrs); - return function(obj) { - return isMatch(obj, attrs); - }; -} -export { matcher as matches }; - -// Run a function **n** times. -export function times(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; -} - -// Return a random integer between min and max (inclusive). -export function random(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); -} - -// A (possibly faster) way to get the current timestamp as an integer. -export var now = Date.now || function() { - return new Date().getTime(); -}; - -// List of HTML entities for escaping. -var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' -}; -var unescapeMap = invert(escapeMap); - -// Functions for escaping and unescaping strings to/from HTML interpolation. -function createEscaper(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; -} -export var escape = createEscaper(escapeMap); -export var unescape = createEscaper(unescapeMap); - -// Traverses the children of `obj` along `path`. If a child is a function, it -// is invoked with its parent as context. Returns the value of the final -// child, or `fallback` if any child is undefined. -export function result(obj, path, fallback) { - if (!isArray(path)) path = [path]; - var length = path.length; - if (!length) { - return isFunction(fallback) ? fallback.call(obj) : fallback; - } - for (var i = 0; i < length; i++) { - var prop = obj == null ? void 0 : obj[path[i]]; - if (prop === void 0) { - prop = fallback; - i = length; // Ensure we don't continue iterating. - } - obj = isFunction(prop) ? prop.call(obj) : prop; - } - return obj; -} - -// Generate a unique integer id (unique within the entire client session). -// Useful for temporary DOM ids. -var idCounter = 0; -export function uniqueId(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; -} - -// By default, Underscore uses ERB-style template delimiters, change the -// following template settings to use alternative delimiters. -export var templateSettings = _.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g -}; - -// When customizing `templateSettings`, if you don't want to define an -// interpolation, evaluation or escaping regex, we need one that is -// guaranteed not to match. -var noMatch = /(.)^/; - -// Certain characters need to be escaped so that they can be put into a -// string literal. -var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' -}; - -var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; - -var escapeChar = function(match) { - return '\\' + escapes[match]; -}; - -// JavaScript micro-templating, similar to John Resig's implementation. -// Underscore templating handles arbitrary delimiters, preserves whitespace, -// and correctly escapes quotes within interpolated code. -// NB: `oldSettings` only exists for backwards compatibility. -export function template(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escapeRegExp, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offset. - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - var render; - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled source as a convenience for precompilation. - var argument = settings.variable || 'obj'; - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; -} +// Function (ahem) Functions +// ------------------------- +// These functions take a function as an argument and return a new function +// as the result. Also known as higher-order functions. +export { default as partial } from './partial.js'; +export { default as bind } from './bind.js'; +export { default as bindAll } from './bindAll.js'; +export { default as memoize } from './memoize.js'; +export { default as delay } from './delay.js'; +export { default as defer } from './defer.js'; +export { default as throttle } from './throttle.js'; +export { default as debounce } from './debounce.js'; +export { default as wrap } from './wrap.js'; +export { default as negate } from './negate.js'; +export { default as compose } from './compose.js'; +export { default as after } from './after.js'; +export { default as before } from './before.js'; +export { default as once } from './once.js'; + +// Finders +// ------- +// Functions that extract (the position of) a single element from an object +// or array based on some criterion. +export { default as findKey } from './findKey.js'; +export { default as findIndex } from './findIndex.js'; +export { default as findLastIndex } from './findLastIndex.js'; +export { default as sortedIndex } from './sortedIndex.js'; +export { default as indexOf } from './indexOf.js'; +export { default as lastIndexOf } from './lastIndexOf.js'; +export { default as find, + default as detect } from './find.js'; +export { default as findWhere } from './findWhere.js'; -// Add a "chain" function. Start chaining a wrapped Underscore object. -export function chain(obj) { - var instance = _(obj); - instance._chain = true; - return instance; -} +// Collection Functions +// -------------------- +// Functions that work on any collection of elements: either an array, or +// an object of key-value pairs. +export { default as each, + default as forEach } from './each.js'; +export { default as map, + default as collect } from './map.js'; +export { default as reduce, + default as foldl, + default as inject } from './reduce.js'; +export { default as reduceRight, + default as foldr } from './reduceRight.js'; +export { default as filter, + default as select } from './filter.js'; +export { default as reject } from './reject.js'; +export { default as every, + default as all } from './every.js'; +export { default as some, + default as any } from './some.js'; +export { default as contains, + default as includes, + default as include } from './contains.js'; +export { default as invoke } from './invoke.js'; +export { default as pluck } from './pluck.js'; +export { default as where } from './where.js'; +export { default as max } from './max.js'; +export { default as min } from './min.js'; +export { default as shuffle } from './shuffle.js'; +export { default as sample } from './sample.js'; +export { default as sortBy } from './sortBy.js'; +export { default as groupBy } from './groupBy.js'; +export { default as indexBy } from './indexBy.js'; +export { default as countBy } from './countBy.js'; +export { default as partition } from './partition.js'; +export { default as toArray } from './toArray.js'; +export { default as size } from './size.js'; + +// `_.pick` and `_.omit` are actually object functions, but we put +// them here in order to create a more natural reading order in the +// monolithic build as they depend on `_.contains`. +export { default as pick } from './pick.js'; +export { default as omit } from './omit.js'; -// OOP +// Array Functions // --------------- -// If Underscore is called as a function, it returns a wrapped object that -// can be used OO-style. This wrapper holds altered versions of all the -// underscore functions. Wrapped objects may be chained. - -// Helper function to continue chaining intermediate results. -function chainResult(instance, obj) { - return instance._chain ? _(obj).chain() : obj; -} +// Functions that operate on arrays (and array-likes) only, because they’re +// expressed in terms of operations on an ordered list of values. +export { default as first, + default as head, + default as take } from './first.js'; +export { default as initial } from './initial.js'; +export { default as last } from './last.js'; +export { default as rest, + default as tail, + default as drop } from './rest.js'; +export { default as compact } from './compact.js'; +export { default as flatten } from './flatten.js'; +export { default as without } from './without.js'; +export { default as uniq, + default as unique } from './uniq.js'; +export { default as union } from './union.js'; +export { default as intersection } from './intersection.js'; +export { default as difference } from './difference.js'; +export { default as unzip } from './unzip.js'; +export { default as zip } from './zip.js'; +export { default as object } from './object.js'; +export { default as range } from './range.js'; +export { default as chunk } from './chunk.js'; -// Add your own custom functions to the Underscore object. -export function mixin(obj) { - each(functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return chainResult(this, func.apply(_, args)); - }; - }); - return _; -} - -// Add all mutator Array functions to the wrapper. -each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) { - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) { - delete obj[0]; - } - } - return chainResult(this, obj); - }; -}); - -// Add all accessor Array functions to the wrapper. -each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) obj = method.apply(obj, arguments); - return chainResult(this, obj); - }; -}); - -// Extracts the result from a wrapped and chained object. -_.prototype.value = function() { - return this._wrapped; -}; - -// Provide unwrapping proxy for some methods used in engine operations -// such as arithmetic and JSON stringification. -_.prototype.valueOf = _.prototype.toJSON = _.prototype.value; - -_.prototype.toString = function() { - return String(this._wrapped); -}; +// OOP +// --- +// These modules support the "object-oriented" calling style. See also +// `underscore.js` and `index-default.js`. +export { default as mixin } from './mixin.js'; +export { default } from './underscore-oop.js'; diff --git a/modules/indexBy.js b/modules/indexBy.js new file mode 100644 index 000000000..8fb81ea05 --- /dev/null +++ b/modules/indexBy.js @@ -0,0 +1,7 @@ +import group from './_group.js'; + +// Indexes the object's values by a criterion, similar to `_.groupBy`, but for +// when you know that your index values will be unique. +export default group(function(result, value, key) { + result[key] = value; +}); diff --git a/modules/indexOf.js b/modules/indexOf.js new file mode 100644 index 000000000..a926ba5a4 --- /dev/null +++ b/modules/indexOf.js @@ -0,0 +1,9 @@ +import sortedIndex from './sortedIndex.js'; +import findIndex from './findIndex.js'; +import createIndexFinder from './_createIndexFinder.js'; + +// Return the position of the first occurrence of an item in an array, +// or -1 if the item is not included in the array. +// If the array is large and already in sort order, pass `true` +// for **isSorted** to use binary search. +export default createIndexFinder(1, findIndex, sortedIndex); diff --git a/modules/initial.js b/modules/initial.js new file mode 100644 index 000000000..0b991dcca --- /dev/null +++ b/modules/initial.js @@ -0,0 +1,8 @@ +import { slice } from './_setup.js'; + +// Returns everything but the last entry of the array. Especially useful on +// the arguments object. Passing **n** will return all the values in +// the array, excluding the last N. +export default function initial(array, n, guard) { + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); +} diff --git a/modules/intersection.js b/modules/intersection.js new file mode 100644 index 000000000..60d1df40a --- /dev/null +++ b/modules/intersection.js @@ -0,0 +1,19 @@ +import getLength from './_getLength.js'; +import contains from './contains.js'; + +// Produce an array that contains every item shared between all the +// passed-in arrays. +export default function intersection(array) { + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = getLength(array); i < length; i++) { + var item = array[i]; + if (contains(result, item)) continue; + var j; + for (j = 1; j < argsLength; j++) { + if (!contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; +} diff --git a/modules/invert.js b/modules/invert.js new file mode 100644 index 000000000..898b16a07 --- /dev/null +++ b/modules/invert.js @@ -0,0 +1,11 @@ +import keys from './keys.js'; + +// Invert the keys and values of an object. The values must be serializable. +export default function invert(obj) { + var result = {}; + var _keys = keys(obj); + for (var i = 0, length = _keys.length; i < length; i++) { + result[obj[_keys[i]]] = _keys[i]; + } + return result; +} diff --git a/modules/invoke.js b/modules/invoke.js new file mode 100644 index 000000000..151d05238 --- /dev/null +++ b/modules/invoke.js @@ -0,0 +1,27 @@ +import restArguments from './restArguments.js'; +import isFunction from './isFunction.js'; +import isArray from './isArray.js'; +import map from './map.js'; +import deepGet from './_deepGet.js'; + +// Invoke a method (with arguments) on every item in a collection. +export default restArguments(function(obj, path, args) { + var contextPath, func; + if (isFunction(path)) { + func = path; + } else if (isArray(path)) { + contextPath = path.slice(0, -1); + path = path[path.length - 1]; + } + return map(obj, function(context) { + var method = func; + if (!method) { + if (contextPath && contextPath.length) { + context = deepGet(context, contextPath); + } + if (context == null) return void 0; + method = context[path]; + } + return method == null ? method : method.apply(context, args); + }); +}); diff --git a/modules/isArguments.js b/modules/isArguments.js new file mode 100644 index 000000000..61582bf81 --- /dev/null +++ b/modules/isArguments.js @@ -0,0 +1,16 @@ +import tagTester from './_tagTester.js'; +import has from './_has.js'; + +var isArguments = tagTester('Arguments'); + +// Define a fallback version of the method in browsers (ahem, IE < 9), where +// there isn't any inspectable "Arguments" type. +(function() { + if (!isArguments(arguments)) { + isArguments = function(obj) { + return has(obj, 'callee'); + }; + } +}()); + +export default isArguments; diff --git a/modules/isArray.js b/modules/isArray.js new file mode 100644 index 000000000..7ead47d70 --- /dev/null +++ b/modules/isArray.js @@ -0,0 +1,6 @@ +import { nativeIsArray } from './_setup.js'; +import tagTester from './_tagTester.js'; + +// Is a given value an array? +// Delegates to ECMA5's native `Array.isArray`. +export default nativeIsArray || tagTester('Array'); diff --git a/modules/isArrayBuffer.js b/modules/isArrayBuffer.js new file mode 100644 index 000000000..867ba4b24 --- /dev/null +++ b/modules/isArrayBuffer.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('ArrayBuffer'); diff --git a/modules/isBoolean.js b/modules/isBoolean.js new file mode 100644 index 000000000..3dddf2c10 --- /dev/null +++ b/modules/isBoolean.js @@ -0,0 +1,6 @@ +import { toString } from './_setup.js'; + +// Is a given value a boolean? +export default function isBoolean(obj) { + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; +} diff --git a/modules/isDataView.js b/modules/isDataView.js new file mode 100644 index 000000000..aa504e9ba --- /dev/null +++ b/modules/isDataView.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('DataView'); diff --git a/modules/isDate.js b/modules/isDate.js new file mode 100644 index 000000000..25e1d1c3c --- /dev/null +++ b/modules/isDate.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('Date'); diff --git a/modules/isElement.js b/modules/isElement.js new file mode 100644 index 000000000..4ab415a8f --- /dev/null +++ b/modules/isElement.js @@ -0,0 +1,4 @@ +// Is a given value a DOM element? +export default function isElement(obj) { + return !!(obj && obj.nodeType === 1); +} diff --git a/modules/isEmpty.js b/modules/isEmpty.js new file mode 100644 index 000000000..387fb1a85 --- /dev/null +++ b/modules/isEmpty.js @@ -0,0 +1,15 @@ +import isArrayLike from './_isArrayLike.js'; +import isArray from './isArray.js'; +import isString from './isString.js'; +import isArguments from './isArguments.js'; +import keys from './keys.js'; + +// Is a given array, string, or object empty? +// An "empty" object has no enumerable own-properties. +export default function isEmpty(obj) { + if (obj == null) return true; + // Skip the more expensive `toString`-based type checks if `obj` has no + // `.length`. + if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments(obj))) return obj.length === 0; + return keys(obj).length === 0; +} diff --git a/modules/isEqual.js b/modules/isEqual.js new file mode 100644 index 000000000..3a6a39808 --- /dev/null +++ b/modules/isEqual.js @@ -0,0 +1,136 @@ +import _ from './underscore.js'; +import { toString, SymbolProto } from './_setup.js'; +import getByteLength from './_getByteLength.js'; +import isTypedArray from './isTypedArray.js'; +import isFunction from './isFunction.js'; +import keys from './keys.js'; +import has from './_has.js'; + +// Internal recursive comparison function for `_.isEqual`. +function eq(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // `null` or `undefined` only equal to itself (strict comparison). + if (a == null || b == null) return false; + // `NaN`s are equivalent, but non-reflexive. + if (a !== a) return b !== b; + // Exhaust primitive checks + var type = typeof a; + if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; + return deepEq(a, b, aStack, bStack); +} + +// Internal recursive comparison function for `_.isEqual`. +function deepEq(a, b, aStack, bStack) { + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + switch (className) { + // These types are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN. + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // 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); + case '[object ArrayBuffer]': + // Coerce to `DataView` so we can fall through to the next case. + return deepEq(new DataView(a), new DataView(b), aStack, bStack); + case '[object DataView]': + var byteLength = getByteLength(a); + if (byteLength !== getByteLength(b)) { + return false; + } + while (byteLength--) { + if (a.getUint8(byteLength) !== b.getUint8(byteLength)) { + return false; + } + } + return true; + } + + if (isTypedArray(a)) { + // Coerce typed arrays to `DataView`. + return deepEq(new DataView(a.buffer), new DataView(b.buffer), aStack, bStack); + } + + var areArrays = className === '[object Array]'; + if (!areArrays) { + if (typeof a != 'object' || typeof b != 'object') return false; + + // Objects with different constructors are not equivalent, but `Object`s or `Array`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && + isFunction(bCtor) && bCtor instanceof bCtor) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + } + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + + // Initializing stack of traversed objects. + // It's done here since we only need them for objects and arrays comparison. + aStack = aStack || []; + bStack = bStack || []; + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } + + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + + // Recursively compare objects and arrays. + if (areArrays) { + // Compare array lengths to determine if a deep comparison is necessary. + length = a.length; + if (length !== b.length) return false; + // Deep compare the contents, ignoring non-numeric properties. + while (length--) { + if (!eq(a[length], b[length], aStack, bStack)) return false; + } + } else { + // Deep compare objects. + var _keys = keys(a), key; + length = _keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + if (keys(b).length !== length) return false; + while (length--) { + // Deep compare each member + key = _keys[length]; + if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return true; +} + +// Perform a deep comparison to check if two objects are equal. +export default function isEqual(a, b) { + return eq(a, b); +} diff --git a/modules/isError.js b/modules/isError.js new file mode 100644 index 000000000..178fa3ec8 --- /dev/null +++ b/modules/isError.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('Error'); diff --git a/modules/isFinite.js b/modules/isFinite.js new file mode 100644 index 000000000..fbeb79ef5 --- /dev/null +++ b/modules/isFinite.js @@ -0,0 +1,7 @@ +import { _isFinite } from './_setup.js'; +import isSymbol from './isSymbol.js'; + +// Is a given object a finite number? +export default function isFinite(obj) { + return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); +} diff --git a/modules/isFunction.js b/modules/isFunction.js new file mode 100644 index 000000000..35c41be0c --- /dev/null +++ b/modules/isFunction.js @@ -0,0 +1,15 @@ +import tagTester from './_tagTester.js'; +import { root } from './_setup.js'; + +var isFunction = tagTester('Function'); + +// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old +// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). +var nodelist = root.document && root.document.childNodes; +if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { + isFunction = function(obj) { + return typeof obj == 'function' || false; + }; +} + +export default isFunction; diff --git a/modules/isMap.js b/modules/isMap.js new file mode 100644 index 000000000..89a35786a --- /dev/null +++ b/modules/isMap.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('Map'); diff --git a/modules/isMatch.js b/modules/isMatch.js new file mode 100644 index 000000000..81e43d95d --- /dev/null +++ b/modules/isMatch.js @@ -0,0 +1,13 @@ +import keys from './keys.js'; + +// Returns whether an object has a given set of `key:value` pairs. +export default function isMatch(object, attrs) { + var _keys = keys(attrs), length = _keys.length; + if (object == null) return !length; + var obj = Object(object); + for (var i = 0; i < length; i++) { + var key = _keys[i]; + if (attrs[key] !== obj[key] || !(key in obj)) return false; + } + return true; +} diff --git a/modules/isNaN.js b/modules/isNaN.js new file mode 100644 index 000000000..9fa7afee3 --- /dev/null +++ b/modules/isNaN.js @@ -0,0 +1,7 @@ +import { _isNaN } from './_setup.js'; +import isNumber from './isNumber.js'; + +// Is the given value `NaN`? +export default function isNaN(obj) { + return isNumber(obj) && _isNaN(obj); +} diff --git a/modules/isNull.js b/modules/isNull.js new file mode 100644 index 000000000..e729c2eee --- /dev/null +++ b/modules/isNull.js @@ -0,0 +1,4 @@ +// Is a given value equal to null? +export default function isNull(obj) { + return obj === null; +} diff --git a/modules/isNumber.js b/modules/isNumber.js new file mode 100644 index 000000000..627d8d4da --- /dev/null +++ b/modules/isNumber.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('Number'); diff --git a/modules/isObject.js b/modules/isObject.js new file mode 100644 index 000000000..73230f007 --- /dev/null +++ b/modules/isObject.js @@ -0,0 +1,5 @@ +// Is a given variable an object? +export default function isObject(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; +} diff --git a/modules/isRegExp.js b/modules/isRegExp.js new file mode 100644 index 000000000..ef64d1e84 --- /dev/null +++ b/modules/isRegExp.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('RegExp'); diff --git a/modules/isSet.js b/modules/isSet.js new file mode 100644 index 000000000..6e03b28a1 --- /dev/null +++ b/modules/isSet.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('Set'); diff --git a/modules/isString.js b/modules/isString.js new file mode 100644 index 000000000..f02707d3d --- /dev/null +++ b/modules/isString.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('String'); diff --git a/modules/isSymbol.js b/modules/isSymbol.js new file mode 100644 index 000000000..de4050d56 --- /dev/null +++ b/modules/isSymbol.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('Symbol'); diff --git a/modules/isTypedArray.js b/modules/isTypedArray.js new file mode 100644 index 000000000..a65c917ee --- /dev/null +++ b/modules/isTypedArray.js @@ -0,0 +1,15 @@ +import { supportsArrayBuffer, nativeIsView, toString } from './_setup.js'; +import isDataView from './isDataView.js'; +import constant from './constant.js'; +import isBufferLike from './_isBufferLike.js'; + +// Is a given value a typed array? +var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; +function isTypedArray(obj) { + // `ArrayBuffer.isView` is the most future-proof, so use it when available. + // Otherwise, fall back on the above regular expression. + return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) : + isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); +} + +export default supportsArrayBuffer ? isTypedArray : constant(false); diff --git a/modules/isUndefined.js b/modules/isUndefined.js new file mode 100644 index 000000000..eddf88f18 --- /dev/null +++ b/modules/isUndefined.js @@ -0,0 +1,4 @@ +// Is a given variable undefined? +export default function isUndefined(obj) { + return obj === void 0; +} diff --git a/modules/isWeakMap.js b/modules/isWeakMap.js new file mode 100644 index 000000000..2d4a0428e --- /dev/null +++ b/modules/isWeakMap.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('WeakMap'); diff --git a/modules/isWeakSet.js b/modules/isWeakSet.js new file mode 100644 index 000000000..5331048e6 --- /dev/null +++ b/modules/isWeakSet.js @@ -0,0 +1,3 @@ +import tagTester from './_tagTester.js'; + +export default tagTester('WeakSet'); diff --git a/modules/iteratee.js b/modules/iteratee.js new file mode 100644 index 000000000..9057701bc --- /dev/null +++ b/modules/iteratee.js @@ -0,0 +1,10 @@ +import _ from './underscore.js'; +import baseIteratee from './_baseIteratee.js'; + +// External wrapper for our callback generator. Users may customize +// `_.iteratee` if they want additional predicate/iteratee shorthand styles. +// This abstraction hides the internal-only `argCount` argument. +export default function iteratee(value, context) { + return baseIteratee(value, context, Infinity); +} +_.iteratee = iteratee; diff --git a/modules/keys.js b/modules/keys.js new file mode 100644 index 000000000..f5b596cfc --- /dev/null +++ b/modules/keys.js @@ -0,0 +1,16 @@ +import isObject from './isObject.js'; +import { nativeKeys, hasEnumBug } from './_setup.js'; +import has from './_has.js'; +import collectNonEnumProps from './_collectNonEnumProps.js'; + +// Retrieve the names of an object's own properties. +// Delegates to **ECMAScript 5**'s native `Object.keys`. +export default function keys(obj) { + if (!isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (has(obj, key)) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; +} diff --git a/modules/last.js b/modules/last.js new file mode 100644 index 000000000..3f30ebc1e --- /dev/null +++ b/modules/last.js @@ -0,0 +1,9 @@ +import rest from './rest.js'; + +// Get the last element of an array. Passing **n** will return the last N +// values in the array. +export default function last(array, n, guard) { + if (array == null || array.length < 1) return n == null || guard ? void 0 : []; + if (n == null || guard) return array[array.length - 1]; + return rest(array, Math.max(0, array.length - n)); +} diff --git a/modules/lastIndexOf.js b/modules/lastIndexOf.js new file mode 100644 index 000000000..bcacf4959 --- /dev/null +++ b/modules/lastIndexOf.js @@ -0,0 +1,6 @@ +import findLastIndex from './findLastIndex.js'; +import createIndexFinder from './_createIndexFinder.js'; + +// Return the position of the last occurrence of an item in an array, +// or -1 if the item is not included in the array. +export default createIndexFinder(-1, findLastIndex); diff --git a/modules/map.js b/modules/map.js new file mode 100644 index 000000000..a2e512165 --- /dev/null +++ b/modules/map.js @@ -0,0 +1,16 @@ +import cb from './_cb.js'; +import isArrayLike from './_isArrayLike.js'; +import keys from './keys.js'; + +// Return the results of applying the iteratee to each element. +export default function map(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length, + results = Array(length); + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } + return results; +} diff --git a/modules/mapObject.js b/modules/mapObject.js new file mode 100644 index 000000000..2b44d2867 --- /dev/null +++ b/modules/mapObject.js @@ -0,0 +1,16 @@ +import cb from './_cb.js'; +import keys from './keys.js'; + +// Returns the results of applying the `iteratee` to each element of `obj`. +// In contrast to `_.map` it returns an object. +export default function mapObject(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var _keys = keys(obj), + length = _keys.length, + results = {}; + for (var index = 0; index < length; index++) { + var currentKey = _keys[index]; + results[currentKey] = iteratee(obj[currentKey], currentKey, obj); + } + return results; +} diff --git a/modules/matcher.js b/modules/matcher.js new file mode 100644 index 000000000..245fa9442 --- /dev/null +++ b/modules/matcher.js @@ -0,0 +1,11 @@ +import extendOwn from './extendOwn.js'; +import isMatch from './isMatch.js'; + +// Returns a predicate for checking whether an object has a given set of +// `key:value` pairs. +export default function matcher(attrs) { + attrs = extendOwn({}, attrs); + return function(obj) { + return isMatch(obj, attrs); + }; +} diff --git a/modules/max.js b/modules/max.js new file mode 100644 index 000000000..9873b35de --- /dev/null +++ b/modules/max.js @@ -0,0 +1,29 @@ +import isArrayLike from './_isArrayLike.js'; +import values from './values.js'; +import cb from './_cb.js'; +import each from './each.js'; + +// Return the maximum element (or element-based computation). +export default function max(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + obj = isArrayLike(obj) ? obj : values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value != null && value > result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + each(obj, function(v, index, list) { + computed = iteratee(v, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = v; + lastComputed = computed; + } + }); + } + return result; +} diff --git a/modules/memoize.js b/modules/memoize.js new file mode 100644 index 000000000..50c55f53a --- /dev/null +++ b/modules/memoize.js @@ -0,0 +1,13 @@ +import has from './_has.js'; + +// Memoize an expensive function by storing its results. +export default function memoize(func, hasher) { + var memoize = function(key) { + var cache = memoize.cache; + var address = '' + (hasher ? hasher.apply(this, arguments) : key); + if (!has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; + }; + memoize.cache = {}; + return memoize; +} diff --git a/modules/min.js b/modules/min.js new file mode 100644 index 000000000..32f92a06b --- /dev/null +++ b/modules/min.js @@ -0,0 +1,29 @@ +import isArrayLike from './_isArrayLike.js'; +import values from './values.js'; +import cb from './_cb.js'; +import each from './each.js'; + +// Return the minimum element (or element-based computation). +export default function min(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + obj = isArrayLike(obj) ? obj : values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value != null && value < result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + each(obj, function(v, index, list) { + computed = iteratee(v, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = v; + lastComputed = computed; + } + }); + } + return result; +} diff --git a/modules/mixin.js b/modules/mixin.js new file mode 100644 index 000000000..352a76adc --- /dev/null +++ b/modules/mixin.js @@ -0,0 +1,18 @@ +import _ from './underscore.js'; +import each from './each.js'; +import functions from './functions.js'; +import { push } from './_setup.js'; +import chainResult from './_chainResult.js'; + +// Add your own custom functions to the Underscore object. +export default function mixin(obj) { + each(functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return chainResult(this, func.apply(_, args)); + }; + }); + return _; +} diff --git a/modules/negate.js b/modules/negate.js new file mode 100644 index 000000000..172c7d658 --- /dev/null +++ b/modules/negate.js @@ -0,0 +1,6 @@ +// Returns a negated version of the passed-in predicate. +export default function negate(predicate) { + return function() { + return !predicate.apply(this, arguments); + }; +} diff --git a/modules/noop.js b/modules/noop.js new file mode 100644 index 000000000..9746addc9 --- /dev/null +++ b/modules/noop.js @@ -0,0 +1,2 @@ +// Predicate-generating function. Often useful outside of Underscore. +export default function noop(){} diff --git a/modules/now.js b/modules/now.js new file mode 100644 index 000000000..3ab6b3f45 --- /dev/null +++ b/modules/now.js @@ -0,0 +1,4 @@ +// A (possibly faster) way to get the current timestamp as an integer. +export default Date.now || function() { + return new Date().getTime(); +}; diff --git a/modules/object.js b/modules/object.js new file mode 100644 index 000000000..d983f8f6c --- /dev/null +++ b/modules/object.js @@ -0,0 +1,16 @@ +import getLength from './_getLength.js'; + +// Converts lists into objects. Pass either a single array of `[key, value]` +// pairs, or two parallel arrays of the same length -- one of keys, and one of +// the corresponding values. Passing by pairs is the reverse of `_.pairs`. +export default function object(list, values) { + var result = {}; + for (var i = 0, length = getLength(list); i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; +} diff --git a/modules/omit.js b/modules/omit.js new file mode 100644 index 000000000..cc6746652 --- /dev/null +++ b/modules/omit.js @@ -0,0 +1,22 @@ +import restArguments from './restArguments.js'; +import isFunction from './isFunction.js'; +import negate from './negate.js'; +import map from './map.js'; +import flatten from './_flatten.js'; +import contains from './contains.js'; +import pick from './pick.js'; + +// Return a copy of the object without the blacklisted properties. +export default restArguments(function(obj, keys) { + var iteratee = keys[0], context; + if (isFunction(iteratee)) { + iteratee = negate(iteratee); + if (keys.length > 1) context = keys[1]; + } else { + keys = map(flatten(keys, false, false), String); + iteratee = function(value, key) { + return !contains(keys, key); + }; + } + return pick(obj, iteratee, context); +}); diff --git a/modules/once.js b/modules/once.js new file mode 100644 index 000000000..e7e41ac23 --- /dev/null +++ b/modules/once.js @@ -0,0 +1,6 @@ +import partial from './partial.js'; +import before from './before.js'; + +// Returns a function that will be executed at most one time, no matter how +// often you call it. Useful for lazy initialization. +export default partial(before, 2); diff --git a/modules/pairs.js b/modules/pairs.js new file mode 100644 index 000000000..0e4af7bb3 --- /dev/null +++ b/modules/pairs.js @@ -0,0 +1,13 @@ +import keys from './keys.js'; + +// Convert an object into a list of `[key, value]` pairs. +// The opposite of `_.object` with one argument. +export default function pairs(obj) { + var _keys = keys(obj); + var length = _keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [_keys[i], obj[_keys[i]]]; + } + return pairs; +} diff --git a/modules/partial.js b/modules/partial.js new file mode 100644 index 000000000..4a4a46851 --- /dev/null +++ b/modules/partial.js @@ -0,0 +1,24 @@ +import restArguments from './restArguments.js'; +import executeBound from './_executeBound.js'; +import _ from './underscore.js'; + +// Partially apply a function by creating a version that has had some of its +// arguments pre-filled, without changing its dynamic `this` context. `_` acts +// as a placeholder by default, allowing any combination of arguments to be +// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. +var partial = restArguments(function(func, boundArgs) { + var placeholder = partial.placeholder; + var bound = function() { + var position = 0, length = boundArgs.length; + var args = Array(length); + for (var i = 0; i < length; i++) { + args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; + } + while (position < arguments.length) args.push(arguments[position++]); + return executeBound(func, bound, this, this, args); + }; + return bound; +}); + +partial.placeholder = _; +export default partial; diff --git a/modules/partition.js b/modules/partition.js new file mode 100644 index 000000000..bf63c0de9 --- /dev/null +++ b/modules/partition.js @@ -0,0 +1,7 @@ +import group from './_group.js'; + +// Split a collection into two arrays: one whose elements all pass the given +// truth test, and one whose elements all do not pass the truth test. +export default group(function(result, value, pass) { + result[pass ? 0 : 1].push(value); +}, true); diff --git a/modules/pick.js b/modules/pick.js new file mode 100644 index 000000000..328a4de9e --- /dev/null +++ b/modules/pick.js @@ -0,0 +1,26 @@ +import restArguments from './restArguments.js'; +import isFunction from './isFunction.js'; +import optimizeCb from './_optimizeCb.js'; +import allKeys from './allKeys.js'; +import keyInObj from './_keyInObj.js'; +import flatten from './_flatten.js'; + +// Return a copy of the object only containing the whitelisted properties. +export default restArguments(function(obj, keys) { + var result = {}, iteratee = keys[0]; + if (obj == null) return result; + if (isFunction(iteratee)) { + if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); + keys = allKeys(obj); + } else { + iteratee = keyInObj; + keys = flatten(keys, false, false); + obj = Object(obj); + } + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + return result; +}); diff --git a/modules/pluck.js b/modules/pluck.js new file mode 100644 index 000000000..45a35338f --- /dev/null +++ b/modules/pluck.js @@ -0,0 +1,7 @@ +import map from './map.js'; +import property from './property.js'; + +// Convenience version of a common use case of `_.map`: fetching a property. +export default function pluck(obj, key) { + return map(obj, property(key)); +} diff --git a/modules/property.js b/modules/property.js new file mode 100644 index 000000000..4bf268799 --- /dev/null +++ b/modules/property.js @@ -0,0 +1,14 @@ +import isArray from './isArray.js'; +import shallowProperty from './_shallowProperty.js'; +import deepGet from './_deepGet.js'; + +// Creates a function that, when passed an object, will traverse that object’s +// properties down the given `path`, specified as an array of keys or indices. +export default function property(path) { + if (!isArray(path)) { + return shallowProperty(path); + } + return function(obj) { + return deepGet(obj, path); + }; +} diff --git a/modules/propertyOf.js b/modules/propertyOf.js new file mode 100644 index 000000000..0669af4e2 --- /dev/null +++ b/modules/propertyOf.js @@ -0,0 +1,12 @@ +import isArray from './isArray.js'; +import deepGet from './_deepGet.js'; + +// Generates a function for a given object that returns a given property. +export default function propertyOf(obj) { + if (obj == null) { + return function(){}; + } + return function(path) { + return !isArray(path) ? obj[path] : deepGet(obj, path); + }; +} diff --git a/modules/random.js b/modules/random.js new file mode 100644 index 000000000..d861b60f0 --- /dev/null +++ b/modules/random.js @@ -0,0 +1,8 @@ +// Return a random integer between `min` and `max` (inclusive). +export default function random(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); +} diff --git a/modules/range.js b/modules/range.js new file mode 100644 index 000000000..9c7c6b87c --- /dev/null +++ b/modules/range.js @@ -0,0 +1,21 @@ +// Generate an integer Array containing an arithmetic progression. A port of +// the native Python `range()` function. See +// [the Python documentation](https://docs.python.org/library/functions.html#range). +export default function range(start, stop, step) { + if (stop == null) { + stop = start || 0; + start = 0; + } + if (!step) { + step = stop < start ? -1 : 1; + } + + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); + + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; + } + + return range; +} diff --git a/modules/reduce.js b/modules/reduce.js new file mode 100644 index 000000000..951eaa3e5 --- /dev/null +++ b/modules/reduce.js @@ -0,0 +1,5 @@ +import createReduce from './_createReduce.js'; + +// **Reduce** builds up a single result from a list of values, aka `inject`, +// or `foldl`. +export default createReduce(1); diff --git a/modules/reduceRight.js b/modules/reduceRight.js new file mode 100644 index 000000000..2e8e23ae6 --- /dev/null +++ b/modules/reduceRight.js @@ -0,0 +1,4 @@ +import createReduce from './_createReduce.js'; + +// The right-associative version of reduce, also known as `foldr`. +export default createReduce(-1); diff --git a/modules/reject.js b/modules/reject.js new file mode 100644 index 000000000..ba4c841de --- /dev/null +++ b/modules/reject.js @@ -0,0 +1,8 @@ +import filter from './filter.js'; +import negate from './negate.js'; +import cb from './_cb.js'; + +// Return all the elements for which a truth test fails. +export default function reject(obj, predicate, context) { + return filter(obj, negate(cb(predicate)), context); +} diff --git a/modules/rest.js b/modules/rest.js new file mode 100644 index 000000000..776b55554 --- /dev/null +++ b/modules/rest.js @@ -0,0 +1,8 @@ +import { slice } from './_setup.js'; + +// Returns everything but the first entry of the `array`. Especially useful on +// the `arguments` object. Passing an **n** will return the rest N values in the +// `array`. +export default function rest(array, n, guard) { + return slice.call(array, n == null || guard ? 1 : n); +} diff --git a/modules/restArguments.js b/modules/restArguments.js new file mode 100644 index 000000000..d12057eba --- /dev/null +++ b/modules/restArguments.js @@ -0,0 +1,27 @@ +// Some functions take a variable number of arguments, or a few expected +// arguments at the beginning and then a variable number of values to operate +// on. This helper accumulates all remaining arguments past the function’s +// argument length (or an explicit `startIndex`), into an array that becomes +// the last argument. Similar to ES6’s "rest parameter". +export default function restArguments(func, startIndex) { + startIndex = startIndex == null ? func.length - 1 : +startIndex; + return function() { + var length = Math.max(arguments.length - startIndex, 0), + rest = Array(length), + index = 0; + for (; index < length; index++) { + rest[index] = arguments[index + startIndex]; + } + switch (startIndex) { + case 0: return func.call(this, rest); + case 1: return func.call(this, arguments[0], rest); + case 2: return func.call(this, arguments[0], arguments[1], rest); + } + var args = Array(startIndex + 1); + for (index = 0; index < startIndex; index++) { + args[index] = arguments[index]; + } + args[startIndex] = rest; + return func.apply(this, args); + }; +} diff --git a/modules/result.js b/modules/result.js new file mode 100644 index 000000000..82ab86f8f --- /dev/null +++ b/modules/result.js @@ -0,0 +1,22 @@ +import isArray from './isArray.js'; +import isFunction from './isFunction.js'; + +// Traverses the children of `obj` along `path`. If a child is a function, it +// is invoked with its parent as context. Returns the value of the final +// child, or `fallback` if any child is undefined. +export default function result(obj, path, fallback) { + if (!isArray(path)) path = [path]; + var length = path.length; + if (!length) { + return isFunction(fallback) ? fallback.call(obj) : fallback; + } + for (var i = 0; i < length; i++) { + var prop = obj == null ? void 0 : obj[path[i]]; + if (prop === void 0) { + prop = fallback; + i = length; // Ensure we don't continue iterating. + } + obj = isFunction(prop) ? prop.call(obj) : prop; + } + return obj; +} diff --git a/modules/sample.js b/modules/sample.js new file mode 100644 index 000000000..3a78104c0 --- /dev/null +++ b/modules/sample.js @@ -0,0 +1,27 @@ +import isArrayLike from './_isArrayLike.js'; +import clone from './clone.js'; +import values from './values.js'; +import getLength from './_getLength.js'; +import random from './random.js'; + +// Sample **n** random values from a collection using the modern version of the +// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). +// If **n** is not specified, returns a single random element. +// The internal `guard` argument allows it to work with `_.map`. +export default function sample(obj, n, guard) { + if (n == null || guard) { + if (!isArrayLike(obj)) obj = values(obj); + return obj[random(obj.length - 1)]; + } + var sample = isArrayLike(obj) ? clone(obj) : values(obj); + var length = getLength(sample); + n = Math.max(Math.min(n, length), 0); + var last = length - 1; + for (var index = 0; index < n; index++) { + var rand = random(index, last); + var temp = sample[index]; + sample[index] = sample[rand]; + sample[rand] = temp; + } + return sample.slice(0, n); +} diff --git a/modules/shuffle.js b/modules/shuffle.js new file mode 100644 index 000000000..907b87a05 --- /dev/null +++ b/modules/shuffle.js @@ -0,0 +1,6 @@ +import sample from './sample.js'; + +// Shuffle a collection. +export default function shuffle(obj) { + return sample(obj, Infinity); +} diff --git a/modules/size.js b/modules/size.js new file mode 100644 index 000000000..4ce37148e --- /dev/null +++ b/modules/size.js @@ -0,0 +1,8 @@ +import isArrayLike from './_isArrayLike.js'; +import keys from './keys.js'; + +// Return the number of elements in a collection. +export default function size(obj) { + if (obj == null) return 0; + return isArrayLike(obj) ? obj.length : keys(obj).length; +} diff --git a/modules/some.js b/modules/some.js new file mode 100644 index 000000000..ac09c078d --- /dev/null +++ b/modules/some.js @@ -0,0 +1,15 @@ +import cb from './_cb.js'; +import isArrayLike from './_isArrayLike.js'; +import keys from './keys.js'; + +// Determine if at least one element in the object passes a truth test. +export default function some(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; +} diff --git a/modules/sortBy.js b/modules/sortBy.js new file mode 100644 index 000000000..bca494bff --- /dev/null +++ b/modules/sortBy.js @@ -0,0 +1,24 @@ +import cb from './_cb.js'; +import pluck from './pluck.js'; +import map from './map.js'; + +// Sort the object's values by a criterion produced by an iteratee. +export default function sortBy(obj, iteratee, context) { + var index = 0; + iteratee = cb(iteratee, context); + return pluck(map(obj, function(value, key, list) { + return { + value: value, + index: index++, + criteria: iteratee(value, key, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); +} diff --git a/modules/sortedIndex.js b/modules/sortedIndex.js new file mode 100644 index 000000000..09ead4aae --- /dev/null +++ b/modules/sortedIndex.js @@ -0,0 +1,15 @@ +import cb from './_cb.js'; +import getLength from './_getLength.js'; + +// Use a comparator function to figure out the smallest index at which +// an object should be inserted so as to maintain order. Uses binary search. +export default function sortedIndex(array, obj, iteratee, context) { + iteratee = cb(iteratee, context, 1); + var value = iteratee(obj); + var low = 0, high = getLength(array); + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; + } + return low; +} diff --git a/modules/tap.js b/modules/tap.js new file mode 100644 index 000000000..475379164 --- /dev/null +++ b/modules/tap.js @@ -0,0 +1,7 @@ +// Invokes `interceptor` with the `obj` and then returns `obj`. +// The primary purpose of this method is to "tap into" a method chain, in +// order to perform operations on intermediate results within the chain. +export default function tap(obj, interceptor) { + interceptor(obj); + return obj; +} diff --git a/modules/template.js b/modules/template.js new file mode 100644 index 000000000..fb926e348 --- /dev/null +++ b/modules/template.js @@ -0,0 +1,86 @@ +import defaults from './defaults.js'; +import _ from './underscore.js'; +import './templateSettings.js'; + +// When customizing `_.templateSettings`, if you don't want to define an +// interpolation, evaluation or escaping regex, we need one that is +// guaranteed not to match. +var noMatch = /(.)^/; + +// Certain characters need to be escaped so that they can be put into a +// string literal. +var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\u2028': 'u2028', + '\u2029': 'u2029' +}; + +var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; + +function escapeChar(match) { + return '\\' + escapes[match]; +} + +// JavaScript micro-templating, similar to John Resig's implementation. +// Underscore templating handles arbitrary delimiters, preserves whitespace, +// and correctly escapes quotes within interpolated code. +// NB: `oldSettings` only exists for backwards compatibility. +export default function template(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; + settings = defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escapeRegExp, escapeChar); + index = offset + match.length; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } else if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } else if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + + // Adobe VMs need the match returned to produce the correct offset. + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + 'return __p;\n'; + + var render; + try { + render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; + + return template; +} diff --git a/modules/templateSettings.js b/modules/templateSettings.js new file mode 100644 index 000000000..4a02f76a4 --- /dev/null +++ b/modules/templateSettings.js @@ -0,0 +1,9 @@ +import _ from './underscore.js'; + +// By default, Underscore uses ERB-style template delimiters. Change the +// following template settings to use alternative delimiters. +export default _.templateSettings = { + evaluate: /<%([\s\S]+?)%>/g, + interpolate: /<%=([\s\S]+?)%>/g, + escape: /<%-([\s\S]+?)%>/g +}; diff --git a/modules/throttle.js b/modules/throttle.js new file mode 100644 index 000000000..7ab97408b --- /dev/null +++ b/modules/throttle.js @@ -0,0 +1,47 @@ +import now from './now.js'; + +// Returns a function, that, when invoked, will only be triggered at most once +// during a given window of time. Normally, the throttled function will run +// as much as it can, without ever going more than once per `wait` duration; +// but if you'd like to disable the execution on the leading edge, pass +// `{leading: false}`. To disable execution on the trailing edge, ditto. +export default function throttle(func, wait, options) { + var timeout, context, args, result; + var previous = 0; + if (!options) options = {}; + + var later = function() { + previous = options.leading === false ? 0 : now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + + var throttled = function() { + var _now = now(); + if (!previous && options.leading === false) previous = _now; + var remaining = wait - (_now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + previous = _now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + + throttled.cancel = function() { + clearTimeout(timeout); + previous = 0; + timeout = context = args = null; + }; + + return throttled; +} diff --git a/modules/times.js b/modules/times.js new file mode 100644 index 000000000..ab1960d50 --- /dev/null +++ b/modules/times.js @@ -0,0 +1,9 @@ +import optimizeCb from './_optimizeCb.js'; + +// Run a function **n** times. +export default function times(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = optimizeCb(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); + return accum; +} diff --git a/modules/toArray.js b/modules/toArray.js new file mode 100644 index 000000000..00730e61e --- /dev/null +++ b/modules/toArray.js @@ -0,0 +1,20 @@ +import isArray from './isArray.js'; +import { slice } from './_setup.js'; +import isString from './isString.js'; +import isArrayLike from './_isArrayLike.js'; +import map from './map.js'; +import identity from './identity.js'; +import values from './values.js'; + +// Safely create a real, live array from anything iterable. +var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; +export default function toArray(obj) { + if (!obj) return []; + if (isArray(obj)) return slice.call(obj); + if (isString(obj)) { + // Keep surrogate pair characters together. + return obj.match(reStrSymbol); + } + if (isArrayLike(obj)) return map(obj, identity); + return values(obj); +} diff --git a/modules/underscore-oop.js b/modules/underscore-oop.js new file mode 100644 index 000000000..8af94a41d --- /dev/null +++ b/modules/underscore-oop.js @@ -0,0 +1,44 @@ +import _ from './underscore.js'; +import each from './each.js'; +import { ArrayProto } from './_setup.js'; +import chainResult from './_chainResult.js'; + +// Add all mutator `Array` functions to the wrapper. +each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + if (obj != null) { + method.apply(obj, arguments); + if ((name === 'shift' || name === 'splice') && obj.length === 0) { + delete obj[0]; + } + } + return chainResult(this, obj); + }; +}); + +// Add all accessor `Array` functions to the wrapper. +each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + if (obj != null) obj = method.apply(obj, arguments); + return chainResult(this, obj); + }; +}); + +// Extracts the result from a wrapped and chained object. +_.prototype.value = function() { + return this._wrapped; +}; + +// Provide unwrapping proxies for some methods used in engine operations +// such as arithmetic and JSON stringification. +_.prototype.valueOf = _.prototype.toJSON = _.prototype.value; + +_.prototype.toString = function() { + return String(this._wrapped); +}; + +export default _; diff --git a/modules/underscore.js b/modules/underscore.js new file mode 100644 index 000000000..e3ba138b0 --- /dev/null +++ b/modules/underscore.js @@ -0,0 +1,12 @@ +import { VERSION } from './_setup.js'; + +// If Underscore is called as a function, it returns a wrapped object that can +// be used OO-style. This wrapper holds altered versions of all functions added +// through `_.mixin`. Wrapped objects may be chained. +export default function _(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; +} + +_.VERSION = VERSION; diff --git a/modules/unescape.js b/modules/unescape.js new file mode 100644 index 000000000..4edefcc80 --- /dev/null +++ b/modules/unescape.js @@ -0,0 +1,5 @@ +import createEscaper from './_createEscaper.js'; +import unescapeMap from './_unescapeMap.js'; + +// Function for unescaping strings from HTML interpolation. +export default createEscaper(unescapeMap); diff --git a/modules/union.js b/modules/union.js new file mode 100644 index 000000000..aa108be91 --- /dev/null +++ b/modules/union.js @@ -0,0 +1,9 @@ +import restArguments from './restArguments.js'; +import uniq from './uniq.js'; +import flatten from './_flatten.js'; + +// Produce an array that contains the union: each distinct element from all of +// the passed-in arrays. +export default restArguments(function(arrays) { + return uniq(flatten(arrays, true, true)); +}); diff --git a/modules/uniq.js b/modules/uniq.js new file mode 100644 index 000000000..ee4c8a31e --- /dev/null +++ b/modules/uniq.js @@ -0,0 +1,36 @@ +import isBoolean from './isBoolean.js'; +import cb from './_cb.js'; +import getLength from './_getLength.js'; +import contains from './contains.js'; + +// Produce a duplicate-free version of the array. If the array has already +// been sorted, you have the option of using a faster algorithm. +// The faster algorithm will not work with an iteratee if the iteratee +// is not a one-to-one function, so providing an iteratee will disable +// the faster algorithm. +export default function uniq(array, isSorted, iteratee, context) { + if (!isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; + } + if (iteratee != null) iteratee = cb(iteratee, context); + var result = []; + var seen = []; + for (var i = 0, length = getLength(array); i < length; i++) { + var value = array[i], + computed = iteratee ? iteratee(value, i, array) : value; + if (isSorted && !iteratee) { + if (!i || seen !== computed) result.push(value); + seen = computed; + } else if (iteratee) { + if (!contains(seen, computed)) { + seen.push(computed); + result.push(value); + } + } else if (!contains(result, value)) { + result.push(value); + } + } + return result; +} diff --git a/modules/uniqueId.js b/modules/uniqueId.js new file mode 100644 index 000000000..20f321a86 --- /dev/null +++ b/modules/uniqueId.js @@ -0,0 +1,7 @@ +// Generate a unique integer id (unique within the entire client session). +// Useful for temporary DOM ids. +var idCounter = 0; +export default function uniqueId(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; +} diff --git a/modules/unzip.js b/modules/unzip.js new file mode 100644 index 000000000..c657a6a56 --- /dev/null +++ b/modules/unzip.js @@ -0,0 +1,15 @@ +import max from './max.js'; +import getLength from './_getLength.js'; +import pluck from './pluck.js'; + +// Complement of zip. Unzip accepts an array of arrays and groups +// each array's elements on shared indices. +export default function unzip(array) { + var length = array && max(array, getLength).length || 0; + var result = Array(length); + + for (var index = 0; index < length; index++) { + result[index] = pluck(array, index); + } + return result; +} diff --git a/modules/values.js b/modules/values.js new file mode 100644 index 000000000..9591de3ed --- /dev/null +++ b/modules/values.js @@ -0,0 +1,12 @@ +import keys from './keys.js'; + +// Retrieve the values of an object's properties. +export default function values(obj) { + var _keys = keys(obj); + var length = _keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[_keys[i]]; + } + return values; +} diff --git a/modules/where.js b/modules/where.js new file mode 100644 index 000000000..645f8cb28 --- /dev/null +++ b/modules/where.js @@ -0,0 +1,8 @@ +import filter from './filter.js'; +import matcher from './matcher.js'; + +// Convenience version of a common use case of `_.filter`: selecting only +// objects containing specific `key:value` pairs. +export default function where(obj, attrs) { + return filter(obj, matcher(attrs)); +} diff --git a/modules/without.js b/modules/without.js new file mode 100644 index 000000000..7790e0fa4 --- /dev/null +++ b/modules/without.js @@ -0,0 +1,7 @@ +import restArguments from './restArguments.js'; +import difference from './difference.js'; + +// Return a version of the array that does not contain the specified value(s). +export default restArguments(function(array, otherArrays) { + return difference(array, otherArrays); +}); diff --git a/modules/wrap.js b/modules/wrap.js new file mode 100644 index 000000000..b2b3fd41c --- /dev/null +++ b/modules/wrap.js @@ -0,0 +1,8 @@ +import partial from './partial.js'; + +// Returns the first function passed as an argument to the second, +// allowing you to adjust arguments, run code before and after, and +// conditionally execute the original function. +export default function wrap(func, wrapper) { + return partial(wrapper, func); +} diff --git a/modules/zip.js b/modules/zip.js new file mode 100644 index 000000000..ae43cb370 --- /dev/null +++ b/modules/zip.js @@ -0,0 +1,6 @@ +import restArguments from './restArguments.js'; +import unzip from './unzip.js'; + +// Zip together multiple lists into a single array -- elements that share +// an index go together. +export default restArguments(unzip); diff --git a/package-lock.json b/package-lock.json index 79ce5ef74..86287cbc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "underscore", - "version": "1.9.2", + "version": "1.10.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -77,15 +77,15 @@ "dev": true }, "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "version": "0.0.44", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.44.tgz", + "integrity": "sha512-iaIVzr+w2ZJ5HkidlZ3EJM8VTZb2MJLCjw3V+505yVts0gRC4UMvjw0d1HPtGqI/HQC/KdsYtayfzl+AXY2R8g==", "dev": true }, "@types/node": { - "version": "13.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.5.tgz", - "integrity": "sha512-PfSBCTQhAQg6QBP4UhXgrZ/wQ3pjfwBr4sA7Aul+pC9XwGgm9ezrJF7OiC/I4Kf+7VPu/5ThKngAruqxyctZfA==", + "version": "13.13.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.5.tgz", + "integrity": "sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g==", "dev": true }, "@types/parse-json": { @@ -404,6 +404,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, "atob": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.0.tgz", @@ -656,6 +662,12 @@ "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", "dev": true }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -2165,6 +2177,19 @@ "minimatch": "2.x" }, "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "minimatch": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", @@ -2660,14 +2685,23 @@ "dev": true }, "fs-extra": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", - "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", + "integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + } } }, "fs.realpath": { @@ -3281,14 +3315,15 @@ } }, "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { + "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "2 || 3", + "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } @@ -3549,9 +3584,9 @@ } }, "highlight.js": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.12.0.tgz", - "integrity": "sha1-5tnb5Xy+/mB1HwKvM2GVhwyQwB4=", + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.0.2.tgz", + "integrity": "sha512-2gMT2MHU6/2OjAlnaOE2LFdr9dwviDN3Q2lSw7Ois3/5uTtahbgYTkr4EPoY828ps+2eQWiixPTF8+phU6Ofkg==", "dev": true }, "hoek": { @@ -4349,12 +4384,13 @@ "dev": true }, "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", + "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", "dev": true, "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "^4.1.6", + "universalify": "^1.0.0" } }, "jsonpointer": { @@ -4644,9 +4680,9 @@ } }, "marked": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", - "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", + "integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==", "dev": true }, "matcher-collection": { @@ -5825,13 +5861,14 @@ } }, "rollup": { - "version": "0.59.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.59.4.tgz", - "integrity": "sha512-ISiMqq/aJa+57QxX2MRcvLESHdJ7wSavmr6U1euMr+6UgFe6KM+3QANrYy8LQofwhTC1I7BcAdlLnDiaODs1BA==", + "version": "1.32.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.32.1.tgz", + "integrity": "sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A==", "dev": true, "requires": { - "@types/estree": "0.0.39", - "@types/node": "*" + "@types/estree": "*", + "@types/node": "*", + "acorn": "^7.1.0" } }, "run-async": { @@ -6307,6 +6344,24 @@ "urix": "^0.1.0" } }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "source-map-url": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", @@ -6607,6 +6662,31 @@ "xtend": "^4.0.0" } }, + "terser": { + "version": "4.6.13", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.13.tgz", + "integrity": "sha512-wMvqukYgVpQlymbnNbabVZbtM6PN63AzqexpwJL8tbh/mRT9LE5o+ruVduAGL7D6Fpjl+Q+06U5I9Ul82odAhw==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -6741,24 +6821,6 @@ "mime-types": "~2.1.18" } }, - "uglify-js": { - "version": "3.3.21", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.21.tgz", - "integrity": "sha512-uy82472lH8tshK3jS3c5IFb5MmNKd/5qyBd0ih8sM42L3jWvxnE339U9gZU1zufnLVs98Stib9twq8dLm2XYCA==", - "dev": true, - "requires": { - "commander": "~2.15.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "uglify-to-browserify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", @@ -6773,9 +6835,9 @@ "dev": true }, "underscore": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.0.tgz", - "integrity": "sha512-4IV1DSSxC1QK48j9ONFK1MoIAKKkbE8i7u55w2R6IqBqbT7A/iG7aZBCR2Bi8piF0Uz+i/MG1aeqLwl/5vqF+A==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", + "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==", "dev": true }, "underscore.string": { @@ -6824,9 +6886,9 @@ } }, "universalify": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", - "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", "dev": true }, "unpipe": { diff --git a/package.json b/package.json index 612d9b116..52557c624 100644 --- a/package.json +++ b/package.json @@ -19,9 +19,10 @@ "version": "1.10.2", "devDependencies": { "coveralls": "^2.11.2", - "docco": "*", + "docco": "^0.8.0", "eslint": "^6.8.0", "eslint-plugin-import": "^2.20.1", + "glob": "^7.1.6", "gzip-size-cli": "^1.0.0", "husky": "^4.2.3", "karma": "^0.13.13", @@ -31,8 +32,8 @@ "pretty-bytes-cli": "^1.0.0", "qunit": "^2.6.0", "qunit-cli": "~0.2.0", - "rollup": "^0.59.4", - "uglify-js": "3.3.21" + "rollup": "^1.32.1", + "terser": "^4.6.13" }, "scripts": { "test": "npm run lint && npm run test-node", @@ -44,10 +45,13 @@ "bundle": "rollup --config && eslint underscore.js", "bundle-treeshake": "cd test-treeshake && npx rollup@latest --config", "prepare-tests": "npm run bundle && npm run bundle-treeshake", - "minify": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m", - "build": "npm run bundle && npm run minify -- --source-map content=underscore.js.map --source-map-url \" \" -o underscore-min.js", - "doc": "cd docs && rollup -c && docco -o . underscore.js", - "weight": "npm run bundle && npm run minify | gzip-size | pretty-bytes", + "minify-umd": "terser underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m", + "minify-esm": "terser underscore-esm.js -c \"evaluate=false\" --comments \"/ .*/\" -m", + "build-umd": "npm run minify-umd -- --source-map content=underscore.js.map --source-map-url \" \" -o underscore-min.js", + "build-esm": "npm run minify-esm -- --source-map content=underscore-esm.js.map --source-map-url \" \" -o underscore-esm-min.js", + "build": "npm run bundle && npm run build-umd && npm run build-esm", + "doc": "docco underscore-esm.js && docco modules/*.js -c docco.css -t docs/linked-esm.jst", + "weight": "npm run bundle && npm run minify-umd | gzip-size | pretty-bytes", "prepublishOnly": "npm run build && npm run doc" }, "license": "MIT", @@ -56,12 +60,18 @@ "underscore.js.map", "underscore-min.js", "underscore-min.js.map", - "modules/" + "underscore-esm.js", + "underscore-esm.js.map", + "underscore-esm-min.js", + "underscore-esm-min.js.map", + "modules/", + "amd/", + "cjs/" ], "husky": { "hooks": { - "pre-commit": "npm run bundle && git add underscore.js underscore.js.map", - "post-commit": "git reset underscore.js underscore.js.map" + "pre-commit": "npm run bundle && git add underscore.js underscore.js.map underscore-esm.js underscore-esm.js.map", + "post-commit": "git reset underscore.js underscore.js.map underscore-esm.js underscore-esm.js.map" } } } diff --git a/rollup.config.js b/rollup.config.js index 32259845a..879ee9239 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,20 +1,63 @@ -module.exports = { - input: 'modules/index-default.js', - treeshake: false, - output: { - file: 'underscore.js', - exports: 'default', - format: 'umd', - name: '_', - amd: { - id: 'underscore', - }, - noConflict: true, - sourcemap: true, - sourcemapExcludeSources: true, - legacy: true, - strict: false, - externalLiveBindings: false, - freeze: false, - }, +import { readFileSync } from 'fs'; +import _ from './underscore-esm.js'; +import glob from 'glob'; + +var intro = readFileSync('modules/index.js', 'utf-8').split('\n').slice(3, 7).join('\n'); + +var outputBase = { + strict: false, + externalLiveBindings: false, + freeze: false, }; + +export default [ + // Monolithic ESM bundle for client use. + { + input: 'modules/index-all.js', + treeshake: false, + output: _.extend({ + file: 'underscore-esm.js', + intro, + format: 'esm', + sourcemap: true, + sourcemapExcludeSources: true, + }, outputBase), + }, + // Monolithic UMD bundle for client use. + { + input: 'modules/index-default.js', + treeshake: false, + output: _.extend({ + file: 'underscore.js', + exports: 'default', + intro, + format: 'umd', + name: '_', + amd: { + id: 'underscore', + }, + noConflict: true, + sourcemap: true, + sourcemapExcludeSources: true, + }, outputBase), + }, + // AMD and CJS versions of the individual modules for development, server use + // and custom bundles. + { + input: _.filter( + glob.sync('modules/**/*.js'), + function(path) { return path !== 'modules/index-all.js'; } + ), + preserveModules: true, + output: [ + _.extend({ + dir: 'amd', + format: 'amd', + }, outputBase), + _.extend({ + dir: 'cjs', + format: 'cjs', + }, outputBase), + ], + } +]; diff --git a/test-treeshake/map.js b/test-treeshake/map.js index 1b3713916..ff1219434 100644 --- a/test-treeshake/map.js +++ b/test-treeshake/map.js @@ -1 +1 @@ -export { map } from '../modules/index'; +export { default as map } from '../modules/map.js'; diff --git a/test-treeshake/template.js b/test-treeshake/template.js index 850e5a204..e5563922f 100644 --- a/test-treeshake/template.js +++ b/test-treeshake/template.js @@ -1 +1 @@ -export { template } from '../modules/index-all'; +export { template } from '../modules/index-all.js'; diff --git a/test/treeshake.js b/test/treeshake.js index 23a95ded0..deb7e26f0 100644 --- a/test/treeshake.js +++ b/test/treeshake.js @@ -37,10 +37,11 @@ var moduleLines = moduleData.split('\n').length, fixtureLines = fixtureData.split('\n').length; // _.template depends on the entire underscore object, so all of the - // source code should be included. Allowing for up to 4 lines of - // difference; this is the size of the noConflict logic, which is - // present in the official module but not in the fixture. - assert.ok(moduleLines - fixtureLines <= 4); + // source code should be included. Allowing for up to 9 lines of + // difference; this is the size of the noConflict logic plus the + // copyright intro, both of which are present in the official module but + // not in the fixture. + assert.ok(moduleLines - fixtureLines <= 9); done(); }); }); diff --git a/underscore-esm.js b/underscore-esm.js new file mode 100644 index 000000000..9ce99ea53 --- /dev/null +++ b/underscore-esm.js @@ -0,0 +1,1924 @@ +// Underscore.js 1.10.2 +// https://underscorejs.org +// (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. + +// Current version. +var VERSION = '1.10.2'; + +// Establish the root object, `window` (`self`) in the browser, `global` +// on the server, or `this` in some virtual machines. We use `self` +// instead of `window` for `WebWorker` support. +var root = typeof self == 'object' && self.self === self && self || + typeof global == 'object' && global.global === global && global || + Function('return this')() || + {}; + +// 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, + slice = ArrayProto.slice, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + +// Modern feature detection. +var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined'; + +// All **ECMAScript 5+** native function implementations that we hope to use +// are declared here. +var nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeCreate = Object.create, + nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; + +// Create references to these builtin functions because we override them. +var _isNaN = isNaN, + _isFinite = isFinite; + +// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. +var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); +var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', + 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; + +// The largest integer that can be represented exactly. +var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; + +// Some functions take a variable number of arguments, or a few expected +// arguments at the beginning and then a variable number of values to operate +// on. This helper accumulates all remaining arguments past the function’s +// argument length (or an explicit `startIndex`), into an array that becomes +// the last argument. Similar to ES6’s "rest parameter". +function restArguments(func, startIndex) { + startIndex = startIndex == null ? func.length - 1 : +startIndex; + return function() { + var length = Math.max(arguments.length - startIndex, 0), + rest = Array(length), + index = 0; + for (; index < length; index++) { + rest[index] = arguments[index + startIndex]; + } + switch (startIndex) { + case 0: return func.call(this, rest); + case 1: return func.call(this, arguments[0], rest); + case 2: return func.call(this, arguments[0], arguments[1], rest); + } + var args = Array(startIndex + 1); + for (index = 0; index < startIndex; index++) { + args[index] = arguments[index]; + } + args[startIndex] = rest; + return func.apply(this, args); + }; +} + +// Is a given variable an object? +function isObject(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; +} + +// Is a given value equal to null? +function isNull(obj) { + return obj === null; +} + +// Is a given variable undefined? +function isUndefined(obj) { + return obj === void 0; +} + +// Is a given value a boolean? +function isBoolean(obj) { + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; +} + +// Is a given value a DOM element? +function isElement(obj) { + return !!(obj && obj.nodeType === 1); +} + +// Internal function for creating a `toString`-based type tester. +function tagTester(name) { + return function(obj) { + return toString.call(obj) === '[object ' + name + ']'; + }; +} + +var isString = tagTester('String'); + +var isNumber = tagTester('Number'); + +var isDate = tagTester('Date'); + +var isRegExp = tagTester('RegExp'); + +var isError = tagTester('Error'); + +var isSymbol = tagTester('Symbol'); + +var isMap = tagTester('Map'); + +var isWeakMap = tagTester('WeakMap'); + +var isSet = tagTester('Set'); + +var isWeakSet = tagTester('WeakSet'); + +var isArrayBuffer = tagTester('ArrayBuffer'); + +var isDataView = tagTester('DataView'); + +// Is a given value an array? +// Delegates to ECMA5's native `Array.isArray`. +var isArray = nativeIsArray || tagTester('Array'); + +var isFunction = tagTester('Function'); + +// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old +// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). +var nodelist = root.document && root.document.childNodes; +if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { + isFunction = function(obj) { + return typeof obj == 'function' || false; + }; +} + +var isFunction$1 = isFunction; + +// Internal function to check whether `key` is an own property name of `obj`. +function has(obj, key) { + return obj != null && hasOwnProperty.call(obj, key); +} + +var isArguments = tagTester('Arguments'); + +// Define a fallback version of the method in browsers (ahem, IE < 9), where +// there isn't any inspectable "Arguments" type. +(function() { + if (!isArguments(arguments)) { + isArguments = function(obj) { + return has(obj, 'callee'); + }; + } +}()); + +var isArguments$1 = isArguments; + +// Is a given object a finite number? +function isFinite$1(obj) { + return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); +} + +// Is the given value `NaN`? +function isNaN$1(obj) { + return isNumber(obj) && _isNaN(obj); +} + +// Predicate-generating function. Often useful outside of Underscore. +function constant(value) { + return function() { + return value; + }; +} + +// Common internal logic for `isArrayLike` and `isBufferLike`. +function createSizePropertyCheck(getSizeProperty) { + return function(collection) { + var sizeProperty = getSizeProperty(collection); + return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; + } +} + +// Internal helper to generate a function to obtain property `key` from `obj`. +function shallowProperty(key) { + return function(obj) { + return obj == null ? void 0 : obj[key]; + }; +} + +// Internal helper to obtain the `byteLength` property of an object. +var getByteLength = shallowProperty('byteLength'); + +// Internal helper to determine whether we should spend extensive checks against +// `ArrayBuffer` et al. +var isBufferLike = createSizePropertyCheck(getByteLength); + +// Is a given value a typed array? +var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; +function isTypedArray(obj) { + // `ArrayBuffer.isView` is the most future-proof, so use it when available. + // Otherwise, fall back on the above regular expression. + return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) : + isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); +} + +var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); + +// Internal helper to obtain the `length` property of an object. +var getLength = shallowProperty('length'); + +// Internal helper for collection methods to determine whether a collection +// should be iterated as an array or as an object. +// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength +// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 +var isArrayLike = createSizePropertyCheck(getLength); + +// Internal helper to create a simple lookup structure. +// `collectNonEnumProps` used to depend on `_.contains`, but this led to +// circular imports. `emulatedSet` is a one-off solution that only works for +// arrays of strings. +function emulatedSet(keys) { + var hash = {}; + for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; + return { + contains: function(key) { return hash[key]; }, + push: function(key) { + hash[key] = true; + return keys.push(key); + } + }; +} + +// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't +// be iterated by `for key in ...` and thus missed. Extends `keys` in place if +// needed. +function collectNonEnumProps(obj, keys) { + keys = emulatedSet(keys); + var nonEnumIdx = nonEnumerableProps.length; + var constructor = obj.constructor; + var proto = isFunction$1(constructor) && constructor.prototype || ObjProto; + + // Constructor is a special case. + var prop = 'constructor'; + if (has(obj, prop) && !keys.contains(prop)) keys.push(prop); + + while (nonEnumIdx--) { + prop = nonEnumerableProps[nonEnumIdx]; + if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { + keys.push(prop); + } + } +} + +// Retrieve the names of an object's own properties. +// Delegates to **ECMAScript 5**'s native `Object.keys`. +function keys(obj) { + if (!isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (has(obj, key)) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; +} + +// Is a given array, string, or object empty? +// An "empty" object has no enumerable own-properties. +function isEmpty(obj) { + if (obj == null) return true; + // Skip the more expensive `toString`-based type checks if `obj` has no + // `.length`. + if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments$1(obj))) return obj.length === 0; + return keys(obj).length === 0; +} + +// Returns whether an object has a given set of `key:value` pairs. +function isMatch(object, attrs) { + var _keys = keys(attrs), length = _keys.length; + if (object == null) return !length; + var obj = Object(object); + for (var i = 0; i < length; i++) { + var key = _keys[i]; + if (attrs[key] !== obj[key] || !(key in obj)) return false; + } + return true; +} + +// If Underscore is called as a function, it returns a wrapped object that can +// be used OO-style. This wrapper holds altered versions of all functions added +// through `_.mixin`. Wrapped objects may be chained. +function _(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; +} + +_.VERSION = VERSION; + +// Internal recursive comparison function for `_.isEqual`. +function eq(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // `null` or `undefined` only equal to itself (strict comparison). + if (a == null || b == null) return false; + // `NaN`s are equivalent, but non-reflexive. + if (a !== a) return b !== b; + // Exhaust primitive checks + var type = typeof a; + if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; + return deepEq(a, b, aStack, bStack); +} + +// Internal recursive comparison function for `_.isEqual`. +function deepEq(a, b, aStack, bStack) { + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + switch (className) { + // These types are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN. + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // 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); + case '[object ArrayBuffer]': + // Coerce to `DataView` so we can fall through to the next case. + return deepEq(new DataView(a), new DataView(b), aStack, bStack); + case '[object DataView]': + var byteLength = getByteLength(a); + if (byteLength !== getByteLength(b)) { + return false; + } + while (byteLength--) { + if (a.getUint8(byteLength) !== b.getUint8(byteLength)) { + return false; + } + } + return true; + } + + if (isTypedArray$1(a)) { + // Coerce typed arrays to `DataView`. + return deepEq(new DataView(a.buffer), new DataView(b.buffer), aStack, bStack); + } + + var areArrays = className === '[object Array]'; + if (!areArrays) { + if (typeof a != 'object' || typeof b != 'object') return false; + + // Objects with different constructors are not equivalent, but `Object`s or `Array`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && + isFunction$1(bCtor) && bCtor instanceof bCtor) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + } + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + + // Initializing stack of traversed objects. + // It's done here since we only need them for objects and arrays comparison. + aStack = aStack || []; + bStack = bStack || []; + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } + + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + + // Recursively compare objects and arrays. + if (areArrays) { + // Compare array lengths to determine if a deep comparison is necessary. + length = a.length; + if (length !== b.length) return false; + // Deep compare the contents, ignoring non-numeric properties. + while (length--) { + if (!eq(a[length], b[length], aStack, bStack)) return false; + } + } else { + // Deep compare objects. + var _keys = keys(a), key; + length = _keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + if (keys(b).length !== length) return false; + while (length--) { + // Deep compare each member + key = _keys[length]; + if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return true; +} + +// Perform a deep comparison to check if two objects are equal. +function isEqual(a, b) { + return eq(a, b); +} + +// Retrieve all the enumerable property names of an object. +function allKeys(obj) { + if (!isObject(obj)) return []; + var keys = []; + for (var key in obj) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; +} + +// Retrieve the values of an object's properties. +function values(obj) { + var _keys = keys(obj); + var length = _keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[_keys[i]]; + } + return values; +} + +// Convert an object into a list of `[key, value]` pairs. +// The opposite of `_.object` with one argument. +function pairs(obj) { + var _keys = keys(obj); + var length = _keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [_keys[i], obj[_keys[i]]]; + } + return pairs; +} + +// Invert the keys and values of an object. The values must be serializable. +function invert(obj) { + var result = {}; + var _keys = keys(obj); + for (var i = 0, length = _keys.length; i < length; i++) { + result[obj[_keys[i]]] = _keys[i]; + } + return result; +} + +// Return a sorted list of the function names available on the object. +function functions(obj) { + var names = []; + for (var key in obj) { + if (isFunction$1(obj[key])) names.push(key); + } + return names.sort(); +} + +// An internal function for creating assigner functions. +function createAssigner(keysFunc, defaults) { + return function(obj) { + var length = arguments.length; + if (defaults) obj = Object(obj); + if (length < 2 || obj == null) return obj; + for (var index = 1; index < length; index++) { + var source = arguments[index], + keys = keysFunc(source), + l = keys.length; + for (var i = 0; i < l; i++) { + var key = keys[i]; + if (!defaults || obj[key] === void 0) obj[key] = source[key]; + } + } + return obj; + }; +} + +// Extend a given object with all the properties in passed-in object(s). +var extend = createAssigner(allKeys); + +// Assigns a given object with all the own properties in the passed-in +// object(s). +// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) +var extendOwn = createAssigner(keys); + +// Fill in a given object with default properties. +var defaults = createAssigner(allKeys, true); + +// Create a naked function reference for surrogate-prototype-swapping. +function ctor() { + return function(){}; +} + +// An internal function for creating a new object that inherits from another. +function baseCreate(prototype) { + if (!isObject(prototype)) return {}; + if (nativeCreate) return nativeCreate(prototype); + var Ctor = ctor(); + Ctor.prototype = prototype; + var result = new Ctor; + Ctor.prototype = null; + return result; +} + +// Creates an object that inherits from the given prototype object. +// If additional properties are provided then they will be added to the +// created object. +function create(prototype, props) { + var result = baseCreate(prototype); + if (props) extendOwn(result, props); + return result; +} + +// Create a (shallow-cloned) duplicate of an object. +function clone(obj) { + if (!isObject(obj)) return obj; + return isArray(obj) ? obj.slice() : extend({}, obj); +} + +// Invokes `interceptor` with the `obj` and then returns `obj`. +// The primary purpose of this method is to "tap into" a method chain, in +// order to perform operations on intermediate results within the chain. +function tap(obj, interceptor) { + interceptor(obj); + return obj; +} + +// Shortcut function for checking if an object has a given property directly on +// itself (in other words, not on a prototype). Unlike the internal `has` +// function, this public version can also traverse nested properties. +function has$1(obj, path) { + if (!isArray(path)) { + return has(obj, path); + } + var length = path.length; + for (var i = 0; i < length; i++) { + var key = path[i]; + if (obj == null || !hasOwnProperty.call(obj, key)) { + return false; + } + obj = obj[key]; + } + return !!length; +} + +// Keep the identity function around for default iteratees. +function identity(value) { + return value; +} + +// Returns a predicate for checking whether an object has a given set of +// `key:value` pairs. +function matcher(attrs) { + attrs = extendOwn({}, attrs); + return function(obj) { + return isMatch(obj, attrs); + }; +} + +// Internal function to obtain a nested property in `obj` along `path`. +function deepGet(obj, path) { + var length = path.length; + for (var i = 0; i < length; i++) { + if (obj == null) return void 0; + obj = obj[path[i]]; + } + return length ? obj : void 0; +} + +// Creates a function that, when passed an object, will traverse that object’s +// properties down the given `path`, specified as an array of keys or indices. +function property(path) { + if (!isArray(path)) { + return shallowProperty(path); + } + return function(obj) { + return deepGet(obj, path); + }; +} + +// Internal function that returns an efficient (for current engines) version +// of the passed-in callback, to be repeatedly applied in other Underscore +// functions. +function optimizeCb(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + // The 2-argument case is omitted because we’re not using it. + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; +} + +// An internal function to generate callbacks that can be applied to each +// element in a collection, returning the desired result — either `_.identity`, +// an arbitrary callback, a property matcher, or a property accessor. +function baseIteratee(value, context, argCount) { + if (value == null) return identity; + if (isFunction$1(value)) return optimizeCb(value, context, argCount); + if (isObject(value) && !isArray(value)) return matcher(value); + return property(value); +} + +// External wrapper for our callback generator. Users may customize +// `_.iteratee` if they want additional predicate/iteratee shorthand styles. +// This abstraction hides the internal-only `argCount` argument. +function iteratee(value, context) { + return baseIteratee(value, context, Infinity); +} +_.iteratee = iteratee; + +// The function we call internally to generate a callback. It invokes +// `_.iteratee` if overridden, otherwise `baseIteratee`. +function cb(value, context, argCount) { + if (_.iteratee !== iteratee) return _.iteratee(value, context); + return baseIteratee(value, context, argCount); +} + +// Returns the results of applying the `iteratee` to each element of `obj`. +// In contrast to `_.map` it returns an object. +function mapObject(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var _keys = keys(obj), + length = _keys.length, + results = {}; + for (var index = 0; index < length; index++) { + var currentKey = _keys[index]; + results[currentKey] = iteratee(obj[currentKey], currentKey, obj); + } + return results; +} + +// Predicate-generating function. Often useful outside of Underscore. +function noop(){} + +// Generates a function for a given object that returns a given property. +function propertyOf(obj) { + if (obj == null) { + return function(){}; + } + return function(path) { + return !isArray(path) ? obj[path] : deepGet(obj, path); + }; +} + +// Run a function **n** times. +function times(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = optimizeCb(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); + return accum; +} + +// Return a random integer between `min` and `max` (inclusive). +function random(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); +} + +// A (possibly faster) way to get the current timestamp as an integer. +var now = Date.now || function() { + return new Date().getTime(); +}; + +// Internal helper to generate functions for escaping and unescaping strings +// to/from HTML interpolation. +function createEscaper(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped. + var source = '(?:' + keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; +} + +// Internal list of HTML entities for escaping. +var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' +}; + +// Function for escaping strings to HTML interpolation. +var _escape = createEscaper(escapeMap); + +// Internal list of HTML entities for unescaping. +var unescapeMap = invert(escapeMap); + +// Function for unescaping strings from HTML interpolation. +var _unescape = createEscaper(unescapeMap); + +// By default, Underscore uses ERB-style template delimiters. Change the +// following template settings to use alternative delimiters. +var templateSettings = _.templateSettings = { + evaluate: /<%([\s\S]+?)%>/g, + interpolate: /<%=([\s\S]+?)%>/g, + escape: /<%-([\s\S]+?)%>/g +}; + +// When customizing `_.templateSettings`, if you don't want to define an +// interpolation, evaluation or escaping regex, we need one that is +// guaranteed not to match. +var noMatch = /(.)^/; + +// Certain characters need to be escaped so that they can be put into a +// string literal. +var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\u2028': 'u2028', + '\u2029': 'u2029' +}; + +var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; + +function escapeChar(match) { + return '\\' + escapes[match]; +} + +// JavaScript micro-templating, similar to John Resig's implementation. +// Underscore templating handles arbitrary delimiters, preserves whitespace, +// and correctly escapes quotes within interpolated code. +// NB: `oldSettings` only exists for backwards compatibility. +function template(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; + settings = defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escapeRegExp, escapeChar); + index = offset + match.length; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } else if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } else if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + + // Adobe VMs need the match returned to produce the correct offset. + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + 'return __p;\n'; + + var render; + try { + render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; + + return template; +} + +// Traverses the children of `obj` along `path`. If a child is a function, it +// is invoked with its parent as context. Returns the value of the final +// child, or `fallback` if any child is undefined. +function result(obj, path, fallback) { + if (!isArray(path)) path = [path]; + var length = path.length; + if (!length) { + return isFunction$1(fallback) ? fallback.call(obj) : fallback; + } + for (var i = 0; i < length; i++) { + var prop = obj == null ? void 0 : obj[path[i]]; + if (prop === void 0) { + prop = fallback; + i = length; // Ensure we don't continue iterating. + } + obj = isFunction$1(prop) ? prop.call(obj) : prop; + } + return obj; +} + +// Generate a unique integer id (unique within the entire client session). +// Useful for temporary DOM ids. +var idCounter = 0; +function uniqueId(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; +} + +// Start chaining a wrapped Underscore object. +function chain(obj) { + var instance = _(obj); + instance._chain = true; + return instance; +} + +// Internal function to execute `sourceFunc` bound to `context` with optional +// `args`. Determines whether to execute a function as a constructor or as a +// normal function. +function executeBound(sourceFunc, boundFunc, context, callingContext, args) { + if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); + var self = baseCreate(sourceFunc.prototype); + var result = sourceFunc.apply(self, args); + if (isObject(result)) return result; + return self; +} + +// Partially apply a function by creating a version that has had some of its +// arguments pre-filled, without changing its dynamic `this` context. `_` acts +// as a placeholder by default, allowing any combination of arguments to be +// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. +var partial = restArguments(function(func, boundArgs) { + var placeholder = partial.placeholder; + var bound = function() { + var position = 0, length = boundArgs.length; + var args = Array(length); + for (var i = 0; i < length; i++) { + args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; + } + while (position < arguments.length) args.push(arguments[position++]); + return executeBound(func, bound, this, this, args); + }; + return bound; +}); + +partial.placeholder = _; + +// Create a function bound to a given object (assigning `this`, and arguments, +// optionally). +var bind = restArguments(function(func, context, args) { + if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); + var bound = restArguments(function(callArgs) { + return executeBound(func, bound, context, this, args.concat(callArgs)); + }); + return bound; +}); + +// Internal implementation of a recursive `flatten` function. +function flatten(input, shallow, strict, output) { + output = output || []; + var idx = output.length; + for (var i = 0, length = getLength(input); i < length; i++) { + var value = input[i]; + if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { + // Flatten current level of array or arguments object. + if (shallow) { + var j = 0, len = value.length; + while (j < len) output[idx++] = value[j++]; + } else { + flatten(value, shallow, strict, output); + idx = output.length; + } + } else if (!strict) { + output[idx++] = value; + } + } + return output; +} + +// Bind a number of an object's methods to that object. Remaining arguments +// are the method names to be bound. Useful for ensuring that all callbacks +// defined on an object belong to it. +var bindAll = restArguments(function(obj, keys) { + keys = flatten(keys, false, false); + var index = keys.length; + if (index < 1) throw new Error('bindAll must be passed function names'); + while (index--) { + var key = keys[index]; + obj[key] = bind(obj[key], obj); + } + return obj; +}); + +// Memoize an expensive function by storing its results. +function memoize(func, hasher) { + var memoize = function(key) { + var cache = memoize.cache; + var address = '' + (hasher ? hasher.apply(this, arguments) : key); + if (!has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; + }; + memoize.cache = {}; + return memoize; +} + +// Delays a function for the given number of milliseconds, and then calls +// it with the arguments supplied. +var delay = restArguments(function(func, wait, args) { + return setTimeout(function() { + return func.apply(null, args); + }, wait); +}); + +// Defers a function, scheduling it to run after the current call stack has +// cleared. +var defer = partial(delay, _, 1); + +// Returns a function, that, when invoked, will only be triggered at most once +// during a given window of time. Normally, the throttled function will run +// as much as it can, without ever going more than once per `wait` duration; +// but if you'd like to disable the execution on the leading edge, pass +// `{leading: false}`. To disable execution on the trailing edge, ditto. +function throttle(func, wait, options) { + var timeout, context, args, result; + var previous = 0; + if (!options) options = {}; + + var later = function() { + previous = options.leading === false ? 0 : now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + + var throttled = function() { + var _now = now(); + if (!previous && options.leading === false) previous = _now; + var remaining = wait - (_now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + previous = _now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + + throttled.cancel = function() { + clearTimeout(timeout); + previous = 0; + timeout = context = args = null; + }; + + return throttled; +} + +// Returns a function, that, as long as it continues to be invoked, will not +// be triggered. The function will be triggered after it stops being called for +// N milliseconds. If `immediate` is passed, trigger the function on the +// leading edge, instead of the trailing. +function debounce(func, wait, immediate) { + var timeout, result; + + var later = function(context, args) { + timeout = null; + if (args) result = func.apply(context, args); + }; + + var debounced = restArguments(function(args) { + if (timeout) clearTimeout(timeout); + if (immediate) { + var callNow = !timeout; + timeout = setTimeout(later, wait); + if (callNow) result = func.apply(this, args); + } else { + timeout = delay(later, wait, this, args); + } + + return result; + }); + + debounced.cancel = function() { + clearTimeout(timeout); + timeout = null; + }; + + return debounced; +} + +// Returns the first function passed as an argument to the second, +// allowing you to adjust arguments, run code before and after, and +// conditionally execute the original function. +function wrap(func, wrapper) { + return partial(wrapper, func); +} + +// Returns a negated version of the passed-in predicate. +function negate(predicate) { + return function() { + return !predicate.apply(this, arguments); + }; +} + +// Returns a function that is the composition of a list of functions, each +// consuming the return value of the function that follows. +function compose() { + var args = arguments; + var start = args.length - 1; + return function() { + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; + }; +} + +// Returns a function that will only be executed on and after the Nth call. +function after(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; +} + +// Returns a function that will only be executed up to (but not including) the +// Nth call. +function before(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } + if (times <= 1) func = null; + return memo; + }; +} + +// Returns a function that will be executed at most one time, no matter how +// often you call it. Useful for lazy initialization. +var once = partial(before, 2); + +// Returns the first key on an object that passes a truth test. +function findKey(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = keys(obj), key; + for (var i = 0, length = _keys.length; i < length; i++) { + key = _keys[i]; + if (predicate(obj[key], key, obj)) return key; + } +} + +// Internal function to generate `_.findIndex` and `_.findLastIndex`. +function createPredicateIndexFinder(dir) { + return function(array, predicate, context) { + predicate = cb(predicate, context); + var length = getLength(array); + var index = dir > 0 ? 0 : length - 1; + for (; index >= 0 && index < length; index += dir) { + if (predicate(array[index], index, array)) return index; + } + return -1; + }; +} + +// Returns the first index on an array-like that passes a truth test. +var findIndex = createPredicateIndexFinder(1); + +// Returns the last index on an array-like that passes a truth test. +var findLastIndex = createPredicateIndexFinder(-1); + +// Use a comparator function to figure out the smallest index at which +// an object should be inserted so as to maintain order. Uses binary search. +function sortedIndex(array, obj, iteratee, context) { + iteratee = cb(iteratee, context, 1); + var value = iteratee(obj); + var low = 0, high = getLength(array); + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; + } + return low; +} + +// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. +function createIndexFinder(dir, predicateFind, sortedIndex) { + return function(array, item, idx) { + var i = 0, length = getLength(array); + if (typeof idx == 'number') { + if (dir > 0) { + i = idx >= 0 ? idx : Math.max(idx + length, i); + } else { + length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; + } + } else if (sortedIndex && idx && length) { + idx = sortedIndex(array, item); + return array[idx] === item ? idx : -1; + } + if (item !== item) { + idx = predicateFind(slice.call(array, i, length), isNaN$1); + return idx >= 0 ? idx + i : -1; + } + for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { + if (array[idx] === item) return idx; + } + return -1; + }; +} + +// Return the position of the first occurrence of an item in an array, +// or -1 if the item is not included in the array. +// If the array is large and already in sort order, pass `true` +// for **isSorted** to use binary search. +var indexOf = createIndexFinder(1, findIndex, sortedIndex); + +// Return the position of the last occurrence of an item in an array, +// or -1 if the item is not included in the array. +var lastIndexOf = createIndexFinder(-1, findLastIndex); + +// Return the first value which passes a truth test. +function find(obj, predicate, context) { + var keyFinder = isArrayLike(obj) ? findIndex : findKey; + var key = keyFinder(obj, predicate, context); + if (key !== void 0 && key !== -1) return obj[key]; +} + +// Convenience version of a common use case of `_.find`: getting the first +// object containing specific `key:value` pairs. +function findWhere(obj, attrs) { + return find(obj, matcher(attrs)); +} + +// The cornerstone for collection functions, an `each` +// implementation, aka `forEach`. +// Handles raw objects in addition to array-likes. Treats all +// sparse array-likes as if they were dense. +function each(obj, iteratee, context) { + iteratee = optimizeCb(iteratee, context); + var i, length; + if (isArrayLike(obj)) { + for (i = 0, length = obj.length; i < length; i++) { + iteratee(obj[i], i, obj); + } + } else { + var _keys = keys(obj); + for (i = 0, length = _keys.length; i < length; i++) { + iteratee(obj[_keys[i]], _keys[i], obj); + } + } + return obj; +} + +// Return the results of applying the iteratee to each element. +function map(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length, + results = Array(length); + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } + return results; +} + +// Internal helper to create a reducing function, iterating left or right. +function createReduce(dir) { + // Wrap code that reassigns argument variables in a separate function than + // the one that accesses `arguments.length` to avoid a perf hit. (#1991) + var reducer = function(obj, iteratee, memo, initial) { + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length, + index = dir > 0 ? 0 : length - 1; + if (!initial) { + memo = obj[_keys ? _keys[index] : index]; + index += dir; + } + for (; index >= 0 && index < length; index += dir) { + var currentKey = _keys ? _keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + }; + + return function(obj, iteratee, memo, context) { + var initial = arguments.length >= 3; + return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); + }; +} + +// **Reduce** builds up a single result from a list of values, aka `inject`, +// or `foldl`. +var reduce = createReduce(1); + +// The right-associative version of reduce, also known as `foldr`. +var reduceRight = createReduce(-1); + +// Return all the elements that pass a truth test. +function filter(obj, predicate, context) { + var results = []; + predicate = cb(predicate, context); + each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); + }); + return results; +} + +// Return all the elements for which a truth test fails. +function reject(obj, predicate, context) { + return filter(obj, negate(cb(predicate)), context); +} + +// Determine whether all of the elements pass a truth test. +function every(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; +} + +// Determine if at least one element in the object passes a truth test. +function some(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; +} + +// Determine if the array or object contains a given item (using `===`). +function contains(obj, item, fromIndex, guard) { + if (!isArrayLike(obj)) obj = values(obj); + if (typeof fromIndex != 'number' || guard) fromIndex = 0; + return indexOf(obj, item, fromIndex) >= 0; +} + +// Invoke a method (with arguments) on every item in a collection. +var invoke = restArguments(function(obj, path, args) { + var contextPath, func; + if (isFunction$1(path)) { + func = path; + } else if (isArray(path)) { + contextPath = path.slice(0, -1); + path = path[path.length - 1]; + } + return map(obj, function(context) { + var method = func; + if (!method) { + if (contextPath && contextPath.length) { + context = deepGet(context, contextPath); + } + if (context == null) return void 0; + method = context[path]; + } + return method == null ? method : method.apply(context, args); + }); +}); + +// Convenience version of a common use case of `_.map`: fetching a property. +function pluck(obj, key) { + return map(obj, property(key)); +} + +// Convenience version of a common use case of `_.filter`: selecting only +// objects containing specific `key:value` pairs. +function where(obj, attrs) { + return filter(obj, matcher(attrs)); +} + +// Return the maximum element (or element-based computation). +function max(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + obj = isArrayLike(obj) ? obj : values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value != null && value > result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + each(obj, function(v, index, list) { + computed = iteratee(v, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = v; + lastComputed = computed; + } + }); + } + return result; +} + +// Return the minimum element (or element-based computation). +function min(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + obj = isArrayLike(obj) ? obj : values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value != null && value < result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + each(obj, function(v, index, list) { + computed = iteratee(v, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = v; + lastComputed = computed; + } + }); + } + return result; +} + +// Sample **n** random values from a collection using the modern version of the +// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). +// If **n** is not specified, returns a single random element. +// The internal `guard` argument allows it to work with `_.map`. +function sample(obj, n, guard) { + if (n == null || guard) { + if (!isArrayLike(obj)) obj = values(obj); + return obj[random(obj.length - 1)]; + } + var sample = isArrayLike(obj) ? clone(obj) : values(obj); + var length = getLength(sample); + n = Math.max(Math.min(n, length), 0); + var last = length - 1; + for (var index = 0; index < n; index++) { + var rand = random(index, last); + var temp = sample[index]; + sample[index] = sample[rand]; + sample[rand] = temp; + } + return sample.slice(0, n); +} + +// Shuffle a collection. +function shuffle(obj) { + return sample(obj, Infinity); +} + +// Sort the object's values by a criterion produced by an iteratee. +function sortBy(obj, iteratee, context) { + var index = 0; + iteratee = cb(iteratee, context); + return pluck(map(obj, function(value, key, list) { + return { + value: value, + index: index++, + criteria: iteratee(value, key, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); +} + +// An internal function used for aggregate "group by" operations. +function group(behavior, partition) { + return function(obj, iteratee, context) { + var result = partition ? [[], []] : {}; + iteratee = cb(iteratee, context); + each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; +} + +// Groups the object's values by a criterion. Pass either a string attribute +// to group by, or a function that returns the criterion. +var groupBy = group(function(result, value, key) { + if (has(result, key)) result[key].push(value); else result[key] = [value]; +}); + +// Indexes the object's values by a criterion, similar to `_.groupBy`, but for +// when you know that your index values will be unique. +var indexBy = group(function(result, value, key) { + result[key] = value; +}); + +// Counts instances of an object that group by a certain criterion. Pass +// either a string attribute to count by, or a function that returns the +// criterion. +var countBy = group(function(result, value, key) { + if (has(result, key)) result[key]++; else result[key] = 1; +}); + +// Split a collection into two arrays: one whose elements all pass the given +// truth test, and one whose elements all do not pass the truth test. +var partition = group(function(result, value, pass) { + result[pass ? 0 : 1].push(value); +}, true); + +// Safely create a real, live array from anything iterable. +var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; +function toArray(obj) { + if (!obj) return []; + if (isArray(obj)) return slice.call(obj); + if (isString(obj)) { + // Keep surrogate pair characters together. + return obj.match(reStrSymbol); + } + if (isArrayLike(obj)) return map(obj, identity); + return values(obj); +} + +// Return the number of elements in a collection. +function size(obj) { + if (obj == null) return 0; + return isArrayLike(obj) ? obj.length : keys(obj).length; +} + +// Internal `_.pick` helper function to determine whether `key` is an enumerable +// property name of `obj`. +function keyInObj(value, key, obj) { + return key in obj; +} + +// Return a copy of the object only containing the whitelisted properties. +var pick = restArguments(function(obj, keys) { + var result = {}, iteratee = keys[0]; + if (obj == null) return result; + if (isFunction$1(iteratee)) { + if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); + keys = allKeys(obj); + } else { + iteratee = keyInObj; + keys = flatten(keys, false, false); + obj = Object(obj); + } + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + return result; +}); + +// Return a copy of the object without the blacklisted properties. +var omit = restArguments(function(obj, keys) { + var iteratee = keys[0], context; + if (isFunction$1(iteratee)) { + iteratee = negate(iteratee); + if (keys.length > 1) context = keys[1]; + } else { + keys = map(flatten(keys, false, false), String); + iteratee = function(value, key) { + return !contains(keys, key); + }; + } + return pick(obj, iteratee, context); +}); + +// Returns everything but the last entry of the array. Especially useful on +// the arguments object. Passing **n** will return all the values in +// the array, excluding the last N. +function initial(array, n, guard) { + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); +} + +// Get the first element of an array. Passing **n** will return the first N +// values in the array. The **guard** check allows it to work with `_.map`. +function first(array, n, guard) { + if (array == null || array.length < 1) return n == null || guard ? void 0 : []; + if (n == null || guard) return array[0]; + return initial(array, array.length - n); +} + +// Returns everything but the first entry of the `array`. Especially useful on +// the `arguments` object. Passing an **n** will return the rest N values in the +// `array`. +function rest(array, n, guard) { + return slice.call(array, n == null || guard ? 1 : n); +} + +// Get the last element of an array. Passing **n** will return the last N +// values in the array. +function last(array, n, guard) { + if (array == null || array.length < 1) return n == null || guard ? void 0 : []; + if (n == null || guard) return array[array.length - 1]; + return rest(array, Math.max(0, array.length - n)); +} + +// Trim out all falsy values from an array. +function compact(array) { + return filter(array, Boolean); +} + +// Flatten out an array, either recursively (by default), or just one level. +function flatten$1(array, shallow) { + return flatten(array, shallow, false); +} + +// Take the difference between one array and a number of other arrays. +// Only the elements present in just the first array will remain. +var difference = restArguments(function(array, rest) { + rest = flatten(rest, true, true); + return filter(array, function(value){ + return !contains(rest, value); + }); +}); + +// Return a version of the array that does not contain the specified value(s). +var without = restArguments(function(array, otherArrays) { + return difference(array, otherArrays); +}); + +// Produce a duplicate-free version of the array. If the array has already +// been sorted, you have the option of using a faster algorithm. +// The faster algorithm will not work with an iteratee if the iteratee +// is not a one-to-one function, so providing an iteratee will disable +// the faster algorithm. +function uniq(array, isSorted, iteratee, context) { + if (!isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; + } + if (iteratee != null) iteratee = cb(iteratee, context); + var result = []; + var seen = []; + for (var i = 0, length = getLength(array); i < length; i++) { + var value = array[i], + computed = iteratee ? iteratee(value, i, array) : value; + if (isSorted && !iteratee) { + if (!i || seen !== computed) result.push(value); + seen = computed; + } else if (iteratee) { + if (!contains(seen, computed)) { + seen.push(computed); + result.push(value); + } + } else if (!contains(result, value)) { + result.push(value); + } + } + return result; +} + +// Produce an array that contains the union: each distinct element from all of +// the passed-in arrays. +var union = restArguments(function(arrays) { + return uniq(flatten(arrays, true, true)); +}); + +// Produce an array that contains every item shared between all the +// passed-in arrays. +function intersection(array) { + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = getLength(array); i < length; i++) { + var item = array[i]; + if (contains(result, item)) continue; + var j; + for (j = 1; j < argsLength; j++) { + if (!contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; +} + +// Complement of zip. Unzip accepts an array of arrays and groups +// each array's elements on shared indices. +function unzip(array) { + var length = array && max(array, getLength).length || 0; + var result = Array(length); + + for (var index = 0; index < length; index++) { + result[index] = pluck(array, index); + } + return result; +} + +// Zip together multiple lists into a single array -- elements that share +// an index go together. +var zip = restArguments(unzip); + +// Converts lists into objects. Pass either a single array of `[key, value]` +// pairs, or two parallel arrays of the same length -- one of keys, and one of +// the corresponding values. Passing by pairs is the reverse of `_.pairs`. +function object(list, values) { + var result = {}; + for (var i = 0, length = getLength(list); i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; +} + +// Generate an integer Array containing an arithmetic progression. A port of +// the native Python `range()` function. See +// [the Python documentation](https://docs.python.org/library/functions.html#range). +function range(start, stop, step) { + if (stop == null) { + stop = start || 0; + start = 0; + } + if (!step) { + step = stop < start ? -1 : 1; + } + + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); + + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; + } + + return range; +} + +// Chunk a single array into multiple arrays, each containing `count` or fewer +// items. +function chunk(array, count) { + if (count == null || count < 1) return []; + var result = []; + var i = 0, length = array.length; + while (i < length) { + result.push(slice.call(array, i, i += count)); + } + return result; +} + +// Helper function to continue chaining intermediate results. +function chainResult(instance, obj) { + return instance._chain ? _(obj).chain() : obj; +} + +// Add your own custom functions to the Underscore object. +function mixin(obj) { + each(functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return chainResult(this, func.apply(_, args)); + }; + }); + return _; +} + +// Add all mutator `Array` functions to the wrapper. +each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + if (obj != null) { + method.apply(obj, arguments); + if ((name === 'shift' || name === 'splice') && obj.length === 0) { + delete obj[0]; + } + } + return chainResult(this, obj); + }; +}); + +// Add all accessor `Array` functions to the wrapper. +each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + if (obj != null) obj = method.apply(obj, arguments); + return chainResult(this, obj); + }; +}); + +// Extracts the result from a wrapped and chained object. +_.prototype.value = function() { + return this._wrapped; +}; + +// Provide unwrapping proxies for some methods used in engine operations +// such as arithmetic and JSON stringification. +_.prototype.valueOf = _.prototype.toJSON = _.prototype.value; + +_.prototype.toString = function() { + return String(this._wrapped); +}; + +// Named Exports + +var allExports = { + __proto__: null, + VERSION: VERSION, + restArguments: restArguments, + isObject: isObject, + isNull: isNull, + isUndefined: isUndefined, + isBoolean: isBoolean, + isElement: isElement, + isString: isString, + isNumber: isNumber, + isDate: isDate, + isRegExp: isRegExp, + isError: isError, + isSymbol: isSymbol, + isMap: isMap, + isWeakMap: isWeakMap, + isSet: isSet, + isWeakSet: isWeakSet, + isArrayBuffer: isArrayBuffer, + isDataView: isDataView, + isArray: isArray, + isFunction: isFunction$1, + isArguments: isArguments$1, + isFinite: isFinite$1, + isNaN: isNaN$1, + isTypedArray: isTypedArray$1, + isEmpty: isEmpty, + isMatch: isMatch, + isEqual: isEqual, + keys: keys, + allKeys: allKeys, + values: values, + pairs: pairs, + invert: invert, + functions: functions, + methods: functions, + extend: extend, + extendOwn: extendOwn, + assign: extendOwn, + defaults: defaults, + create: create, + clone: clone, + tap: tap, + has: has$1, + mapObject: mapObject, + identity: identity, + constant: constant, + noop: noop, + property: property, + propertyOf: propertyOf, + matcher: matcher, + matches: matcher, + times: times, + random: random, + now: now, + escape: _escape, + unescape: _unescape, + templateSettings: templateSettings, + template: template, + result: result, + uniqueId: uniqueId, + chain: chain, + iteratee: iteratee, + partial: partial, + bind: bind, + bindAll: bindAll, + memoize: memoize, + delay: delay, + defer: defer, + throttle: throttle, + debounce: debounce, + wrap: wrap, + negate: negate, + compose: compose, + after: after, + before: before, + once: once, + findKey: findKey, + findIndex: findIndex, + findLastIndex: findLastIndex, + sortedIndex: sortedIndex, + indexOf: indexOf, + lastIndexOf: lastIndexOf, + find: find, + detect: find, + findWhere: findWhere, + each: each, + forEach: each, + map: map, + collect: map, + reduce: reduce, + foldl: reduce, + inject: reduce, + reduceRight: reduceRight, + foldr: reduceRight, + filter: filter, + select: filter, + reject: reject, + every: every, + all: every, + some: some, + any: some, + contains: contains, + includes: contains, + include: contains, + invoke: invoke, + pluck: pluck, + where: where, + max: max, + min: min, + shuffle: shuffle, + sample: sample, + sortBy: sortBy, + groupBy: groupBy, + indexBy: indexBy, + countBy: countBy, + partition: partition, + toArray: toArray, + size: size, + pick: pick, + omit: omit, + first: first, + head: first, + take: first, + initial: initial, + last: last, + rest: rest, + tail: rest, + drop: rest, + compact: compact, + flatten: flatten$1, + without: without, + uniq: uniq, + unique: uniq, + union: union, + intersection: intersection, + difference: difference, + unzip: unzip, + zip: zip, + object: object, + range: range, + chunk: chunk, + mixin: mixin, + 'default': _ +}; + +// Default Export + +// Add all of the Underscore functions to the wrapper object. +var _$1 = mixin(allExports); +// Legacy Node.js API. +_$1._ = _$1; + +// ESM Exports + +export default _$1; +export { VERSION, after, every as all, allKeys, some as any, extendOwn as assign, before, bind, bindAll, chain, chunk, clone, map as collect, compact, compose, constant, contains, countBy, create, debounce, defaults, defer, delay, find as detect, difference, rest as drop, each, _escape as escape, every, extend, extendOwn, filter, find, findIndex, findKey, findLastIndex, findWhere, first, flatten$1 as flatten, reduce as foldl, reduceRight as foldr, each as forEach, functions, groupBy, has$1 as has, first as head, identity, contains as include, contains as includes, indexBy, indexOf, initial, reduce as inject, intersection, invert, invoke, isArguments$1 as isArguments, isArray, isArrayBuffer, isBoolean, isDataView, isDate, isElement, isEmpty, isEqual, isError, isFinite$1 as isFinite, isFunction$1 as isFunction, isMap, isMatch, isNaN$1 as isNaN, isNull, isNumber, isObject, isRegExp, isSet, isString, isSymbol, isTypedArray$1 as isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, keys, last, lastIndexOf, map, mapObject, matcher, matcher as matches, max, memoize, functions as methods, min, mixin, negate, noop, now, object, omit, once, pairs, partial, partition, pick, pluck, property, propertyOf, random, range, reduce, reduceRight, reject, rest, restArguments, result, sample, filter as select, shuffle, size, some, sortBy, sortedIndex, rest as tail, first as take, tap, template, templateSettings, throttle, times, toArray, _unescape as unescape, union, uniq, uniq as unique, uniqueId, unzip, values, where, without, wrap, zip }; +//# sourceMappingURL=underscore-esm.js.map diff --git a/underscore-esm.js.map b/underscore-esm.js.map new file mode 100644 index 000000000..e74ada9f0 --- /dev/null +++ b/underscore-esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"underscore-esm.js","sources":["modules/_setup.js","modules/restArguments.js","modules/isObject.js","modules/isNull.js","modules/isUndefined.js","modules/isBoolean.js","modules/isElement.js","modules/_tagTester.js","modules/isString.js","modules/isNumber.js","modules/isDate.js","modules/isRegExp.js","modules/isError.js","modules/isSymbol.js","modules/isMap.js","modules/isWeakMap.js","modules/isSet.js","modules/isWeakSet.js","modules/isArrayBuffer.js","modules/isDataView.js","modules/isArray.js","modules/isFunction.js","modules/_has.js","modules/isArguments.js","modules/isFinite.js","modules/isNaN.js","modules/constant.js","modules/_createSizePropertyCheck.js","modules/_shallowProperty.js","modules/_getByteLength.js","modules/_isBufferLike.js","modules/isTypedArray.js","modules/_getLength.js","modules/_isArrayLike.js","modules/_collectNonEnumProps.js","modules/keys.js","modules/isEmpty.js","modules/isMatch.js","modules/underscore.js","modules/isEqual.js","modules/allKeys.js","modules/values.js","modules/pairs.js","modules/invert.js","modules/functions.js","modules/_createAssigner.js","modules/extend.js","modules/extendOwn.js","modules/defaults.js","modules/_baseCreate.js","modules/create.js","modules/clone.js","modules/tap.js","modules/has.js","modules/identity.js","modules/matcher.js","modules/_deepGet.js","modules/property.js","modules/_optimizeCb.js","modules/_baseIteratee.js","modules/iteratee.js","modules/_cb.js","modules/mapObject.js","modules/noop.js","modules/propertyOf.js","modules/times.js","modules/random.js","modules/now.js","modules/_createEscaper.js","modules/_escapeMap.js","modules/escape.js","modules/_unescapeMap.js","modules/unescape.js","modules/templateSettings.js","modules/template.js","modules/result.js","modules/uniqueId.js","modules/chain.js","modules/_executeBound.js","modules/partial.js","modules/bind.js","modules/_flatten.js","modules/bindAll.js","modules/memoize.js","modules/delay.js","modules/defer.js","modules/throttle.js","modules/debounce.js","modules/wrap.js","modules/negate.js","modules/compose.js","modules/after.js","modules/before.js","modules/once.js","modules/findKey.js","modules/_createPredicateIndexFinder.js","modules/findIndex.js","modules/findLastIndex.js","modules/sortedIndex.js","modules/_createIndexFinder.js","modules/indexOf.js","modules/lastIndexOf.js","modules/find.js","modules/findWhere.js","modules/each.js","modules/map.js","modules/_createReduce.js","modules/reduce.js","modules/reduceRight.js","modules/filter.js","modules/reject.js","modules/every.js","modules/some.js","modules/contains.js","modules/invoke.js","modules/pluck.js","modules/where.js","modules/max.js","modules/min.js","modules/sample.js","modules/shuffle.js","modules/sortBy.js","modules/_group.js","modules/groupBy.js","modules/indexBy.js","modules/countBy.js","modules/partition.js","modules/toArray.js","modules/size.js","modules/_keyInObj.js","modules/pick.js","modules/omit.js","modules/initial.js","modules/first.js","modules/rest.js","modules/last.js","modules/compact.js","modules/flatten.js","modules/difference.js","modules/without.js","modules/uniq.js","modules/union.js","modules/intersection.js","modules/unzip.js","modules/zip.js","modules/object.js","modules/range.js","modules/chunk.js","modules/_chainResult.js","modules/mixin.js","modules/underscore-oop.js","modules/index.js","modules/index-default.js","modules/index-all.js"],"sourcesContent":null,"names":["isFinite","isNaN","isFunction","isArguments","isTypedArray","has","_has","flatten","_flatten","_"],"mappings":";;;;;AAAA;AACU,IAAC,OAAO,GAAG,SAAS;AAC9B;AACA;AACA;AACA;AACO,IAAI,IAAI,GAAG,OAAO,IAAI,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI;AACvE,UAAU,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,IAAI,MAAM;AACzE,UAAU,QAAQ,CAAC,aAAa,CAAC,EAAE;AACnC,UAAU,EAAE,CAAC;AACb;AACA;AACO,IAAI,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAC9D,IAAI,WAAW,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;AACjF;AACA;AACO,IAAI,IAAI,GAAG,UAAU,CAAC,IAAI;AACjC,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK;AAC5B,IAAI,QAAQ,GAAG,QAAQ,CAAC,QAAQ;AAChC,IAAI,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;AAC7C;AACA;AACO,IAAI,mBAAmB,GAAG,OAAO,WAAW,KAAK,WAAW,CAAC;AACpE;AACA;AACA;AACO,IAAI,aAAa,GAAG,KAAK,CAAC,OAAO;AACxC,IAAI,UAAU,GAAG,MAAM,CAAC,IAAI;AAC5B,IAAI,YAAY,GAAG,MAAM,CAAC,MAAM;AACh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;;;;;;ACAhB;AACA,AAmBA;AACA;AACA,IAAIC,GAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AAC1B;AACAA,GAAC,CAAC,CAAC,GAAGA,GAAC,CAAC;;ACxBR,cAAc;;;;;"} \ No newline at end of file diff --git a/underscore.js b/underscore.js index 2cbc6e113..b091a0a62 100644 --- a/underscore.js +++ b/underscore.js @@ -1,21 +1,19 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define('underscore', factory) : - (function() { - var current = global._; - var exports = factory(); - global._ = exports; - exports.noConflict = function() { global._ = current; return exports; }; - })(); + (global = global || self, (function () { + var current = global._; + var exports = global._ = factory(); + exports.noConflict = function () { global._ = current; return exports; }; + }())); }(this, (function () { - // Underscore.js 1.10.2 // https://underscorejs.org // (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. - // Baseline setup - // -------------- + // Current version. + var VERSION = '1.10.2'; // Establish the root object, `window` (`self`) in the browser, `global` // on the server, or `this` in some virtual machines. We use `self` @@ -46,69 +44,16 @@ nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; // Create references to these builtin functions because we override them. - var _isNaN = root.isNaN, - _isFinite = root.isFinite; - - // Naked function reference for surrogate-prototype-swapping. - var Ctor = function(){}; - - // The Underscore object. All exported functions below are added to it in the - // modules/index-all.js using the mixin function. - function _(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - } - - // Current version. - var VERSION = _.VERSION = '1.10.2'; - - // Internal function that returns an efficient (for current engines) version - // of the passed-in callback, to be repeatedly applied in other Underscore - // functions. - function optimizeCb(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - // The 2-argument case is omitted because we’re not using it. - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; - } - - // An internal function to generate callbacks that can be applied to each - // element in a collection, returning the desired result — either `identity`, - // an arbitrary callback, a property matcher, or a property accessor. - function baseIteratee(value, context, argCount) { - if (value == null) return identity; - if (isFunction(value)) return optimizeCb(value, context, argCount); - if (isObject(value) && !isArray(value)) return matcher(value); - return property(value); - } + var _isNaN = isNaN, + _isFinite = isFinite; - // External wrapper for our callback generator. Users may customize - // `_.iteratee` if they want additional predicate/iteratee shorthand styles. - // This abstraction hides the internal-only argCount argument. - _.iteratee = iteratee; - function iteratee(value, context) { - return baseIteratee(value, context, Infinity); - } + // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. + var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); + var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', + 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - // The function we actually call internally. It invokes _.iteratee if - // overridden, otherwise baseIteratee. - function cb(value, context, argCount) { - if (_.iteratee !== iteratee) return _.iteratee(value, context); - return baseIteratee(value, context, argCount); - } + // The largest integer that can be represented exactly. + var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; // Some functions take a variable number of arguments, or a few expected // arguments at the beginning and then a variable number of values to operate @@ -138,37 +83,117 @@ }; } - // An internal function for creating a new object that inherits from another. - function baseCreate(prototype) { - if (!isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; + // Is a given variable an object? + function isObject(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; } - function shallowProperty(key) { + // Is a given value equal to null? + function isNull(obj) { + return obj === null; + } + + // Is a given variable undefined? + function isUndefined(obj) { + return obj === void 0; + } + + // Is a given value a boolean? + function isBoolean(obj) { + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; + } + + // Is a given value a DOM element? + function isElement(obj) { + return !!(obj && obj.nodeType === 1); + } + + // Internal function for creating a `toString`-based type tester. + function tagTester(name) { return function(obj) { - return obj == null ? void 0 : obj[key]; + return toString.call(obj) === '[object ' + name + ']'; }; } - function _has(obj, path) { - return obj != null && hasOwnProperty.call(obj, path); + var isString = tagTester('String'); + + var isNumber = tagTester('Number'); + + var isDate = tagTester('Date'); + + var isRegExp = tagTester('RegExp'); + + var isError = tagTester('Error'); + + var isSymbol = tagTester('Symbol'); + + var isMap = tagTester('Map'); + + var isWeakMap = tagTester('WeakMap'); + + var isSet = tagTester('Set'); + + var isWeakSet = tagTester('WeakSet'); + + var isArrayBuffer = tagTester('ArrayBuffer'); + + var isDataView = tagTester('DataView'); + + // Is a given value an array? + // Delegates to ECMA5's native `Array.isArray`. + var isArray = nativeIsArray || tagTester('Array'); + + var isFunction = tagTester('Function'); + + // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old + // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). + var nodelist = root.document && root.document.childNodes; + if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { + isFunction = function(obj) { + return typeof obj == 'function' || false; + }; } - function deepGet(obj, path) { - var length = path.length; - for (var i = 0; i < length; i++) { - if (obj == null) return void 0; - obj = obj[path[i]]; + var isFunction$1 = isFunction; + + // Internal function to check whether `key` is an own property name of `obj`. + function has(obj, key) { + return obj != null && hasOwnProperty.call(obj, key); + } + + var isArguments = tagTester('Arguments'); + + // Define a fallback version of the method in browsers (ahem, IE < 9), where + // there isn't any inspectable "Arguments" type. + (function() { + if (!isArguments(arguments)) { + isArguments = function(obj) { + return has(obj, 'callee'); + }; } - return length ? obj : void 0; + }()); + + var isArguments$1 = isArguments; + + // Is a given object a finite number? + function isFinite$1(obj) { + return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); } - // Common logic for isArrayLike and isBufferLike. - var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; + // Is the given value `NaN`? + function isNaN$1(obj) { + return isNumber(obj) && _isNaN(obj); + } + + // Predicate-generating function. Often useful outside of Underscore. + function constant(value) { + return function() { + return value; + }; + } + + // Common internal logic for `isArrayLike` and `isBufferLike`. function createSizePropertyCheck(getSizeProperty) { return function(collection) { var sizeProperty = getSizeProperty(collection); @@ -176,666 +201,774 @@ } } - // Helper for collection methods to determine whether a collection - // should be iterated as an array or as an object. - // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength - // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 - var getLength = shallowProperty('length'); - var isArrayLike = createSizePropertyCheck(getLength); + // Internal helper to generate a function to obtain property `key` from `obj`. + function shallowProperty(key) { + return function(obj) { + return obj == null ? void 0 : obj[key]; + }; + } - // Likewise to determine whether we should spend extensive checks against - // `ArrayBuffer` et al. + // Internal helper to obtain the `byteLength` property of an object. var getByteLength = shallowProperty('byteLength'); - var isBufferLike = createSizePropertyCheck(getByteLength); - // Collection Functions - // -------------------- + // Internal helper to determine whether we should spend extensive checks against + // `ArrayBuffer` et al. + var isBufferLike = createSizePropertyCheck(getByteLength); - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles raw objects in addition to array-likes. Treats all - // sparse array-likes as if they were dense. - function each(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var _keys = keys(obj); - for (i = 0, length = _keys.length; i < length; i++) { - iteratee(obj[_keys[i]], _keys[i], obj); - } - } - return obj; + // Is a given value a typed array? + var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; + function isTypedArray(obj) { + // `ArrayBuffer.isView` is the most future-proof, so use it when available. + // Otherwise, fall back on the above regular expression. + return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) : + isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); } - // Return the results of applying the iteratee to each element. - function map(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - } + var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); - // Create a reducing function iterating left or right. - function createReduce(dir) { - // Wrap code that reassigns argument variables in a separate function than - // the one that accesses `arguments.length` to avoid a perf hit. (#1991) - var reducer = function(obj, iteratee, memo, initial) { - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - index = dir > 0 ? 0 : length - 1; - if (!initial) { - memo = obj[_keys ? _keys[index] : index]; - index += dir; - } - for (; index >= 0 && index < length; index += dir) { - var currentKey = _keys ? _keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; + // Internal helper to obtain the `length` property of an object. + var getLength = shallowProperty('length'); - return function(obj, iteratee, memo, context) { - var initial = arguments.length >= 3; - return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); + // Internal helper for collection methods to determine whether a collection + // should be iterated as an array or as an object. + // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 + var isArrayLike = createSizePropertyCheck(getLength); + + // Internal helper to create a simple lookup structure. + // `collectNonEnumProps` used to depend on `_.contains`, but this led to + // circular imports. `emulatedSet` is a one-off solution that only works for + // arrays of strings. + function emulatedSet(keys) { + var hash = {}; + for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; + return { + contains: function(key) { return hash[key]; }, + push: function(key) { + hash[key] = true; + return keys.push(key); + } }; } - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. - var reduce = createReduce(1); + // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't + // be iterated by `for key in ...` and thus missed. Extends `keys` in place if + // needed. + function collectNonEnumProps(obj, keys) { + keys = emulatedSet(keys); + var nonEnumIdx = nonEnumerableProps.length; + var constructor = obj.constructor; + var proto = isFunction$1(constructor) && constructor.prototype || ObjProto; - // The right-associative version of reduce, also known as `foldr`. - var reduceRight = createReduce(-1); + // Constructor is a special case. + var prop = 'constructor'; + if (has(obj, prop) && !keys.contains(prop)) keys.push(prop); - // Return the first value which passes a truth test. - function find(obj, predicate, context) { - var keyFinder = isArrayLike(obj) ? findIndex : findKey; - var key = keyFinder(obj, predicate, context); - if (key !== void 0 && key !== -1) return obj[key]; + while (nonEnumIdx--) { + prop = nonEnumerableProps[nonEnumIdx]; + if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { + keys.push(prop); + } + } } - // Return all the elements that pass a truth test. - function filter(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; + // Retrieve the names of an object's own properties. + // Delegates to **ECMAScript 5**'s native `Object.keys`. + function keys(obj) { + if (!isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (has(obj, key)) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; } - // Return all the elements for which a truth test fails. - function reject(obj, predicate, context) { - return filter(obj, negate(cb(predicate)), context); + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + function isEmpty(obj) { + if (obj == null) return true; + // Skip the more expensive `toString`-based type checks if `obj` has no + // `.length`. + if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments$1(obj))) return obj.length === 0; + return keys(obj).length === 0; } - // Determine whether all of the elements match a truth test. - function every(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; + // Returns whether an object has a given set of `key:value` pairs. + function isMatch(object, attrs) { + var _keys = keys(attrs), length = _keys.length; + if (object == null) return !length; + var obj = Object(object); + for (var i = 0; i < length; i++) { + var key = _keys[i]; + if (attrs[key] !== obj[key] || !(key in obj)) return false; } return true; } - // Determine if at least one element in the object matches a truth test. - function some(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; + // If Underscore is called as a function, it returns a wrapped object that can + // be used OO-style. This wrapper holds altered versions of all functions added + // through `_.mixin`. Wrapped objects may be chained. + function _(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; } - // Determine if the array or object contains a given item (using `===`). - function contains(obj, item, fromIndex, guard) { - if (!isArrayLike(obj)) obj = values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return indexOf(obj, item, fromIndex) >= 0; + _.VERSION = VERSION; + + // Internal recursive comparison function for `_.isEqual`. + function eq(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // `null` or `undefined` only equal to itself (strict comparison). + if (a == null || b == null) return false; + // `NaN`s are equivalent, but non-reflexive. + if (a !== a) return b !== b; + // Exhaust primitive checks + var type = typeof a; + if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; + return deepEq(a, b, aStack, bStack); } - // Invoke a method (with arguments) on every item in a collection. - var invoke = restArguments(function(obj, path, args) { - var contextPath, func; - if (isFunction(path)) { - func = path; - } else if (isArray(path)) { - contextPath = path.slice(0, -1); - path = path[path.length - 1]; - } - return map(obj, function(context) { - var method = func; - if (!method) { - if (contextPath && contextPath.length) { - context = deepGet(context, contextPath); + // Internal recursive comparison function for `_.isEqual`. + function deepEq(a, b, aStack, bStack) { + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + switch (className) { + // These types are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN. + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // 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); + case '[object ArrayBuffer]': + // Coerce to `DataView` so we can fall through to the next case. + return deepEq(new DataView(a), new DataView(b), aStack, bStack); + case '[object DataView]': + var byteLength = getByteLength(a); + if (byteLength !== getByteLength(b)) { + return false; } - if (context == null) return void 0; - method = context[path]; - } - return method == null ? method : method.apply(context, args); - }); - }); - - // Convenience version of a common use case of `map`: fetching a property. - function pluck(obj, key) { - return map(obj, property(key)); - } + while (byteLength--) { + if (a.getUint8(byteLength) !== b.getUint8(byteLength)) { + return false; + } + } + return true; + } - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - function where(obj, attrs) { - return filter(obj, matcher(attrs)); - } + if (isTypedArray$1(a)) { + // Coerce typed arrays to `DataView`. + return deepEq(new DataView(a.buffer), new DataView(b.buffer), aStack, bStack); + } - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - function findWhere(obj, attrs) { - return find(obj, matcher(attrs)); - } + var areArrays = className === '[object Array]'; + if (!areArrays) { + if (typeof a != 'object' || typeof b != 'object') return false; - // Return the maximum element (or element-based computation). - function max(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value > result) { - result = value; - } + // Objects with different constructors are not equivalent, but `Object`s or `Array`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && + isFunction$1(bCtor) && bCtor instanceof bCtor) + && ('constructor' in a && 'constructor' in b)) { + return false; } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed > lastComputed || computed === -Infinity && result === -Infinity) { - result = v; - lastComputed = computed; - } - }); } - return result; - } + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - // Return the minimum element (or element-based computation). - function min(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { - obj = isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value < result) { - result = value; - } + // Initializing stack of traversed objects. + // It's done here since we only need them for objects and arrays comparison. + aStack = aStack || []; + bStack = bStack || []; + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } + + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + + // Recursively compare objects and arrays. + if (areArrays) { + // Compare array lengths to determine if a deep comparison is necessary. + length = a.length; + if (length !== b.length) return false; + // Deep compare the contents, ignoring non-numeric properties. + while (length--) { + if (!eq(a[length], b[length], aStack, bStack)) return false; } } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed < lastComputed || computed === Infinity && result === Infinity) { - result = v; - lastComputed = computed; - } - }); + // Deep compare objects. + var _keys = keys(a), key; + length = _keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + if (keys(b).length !== length) return false; + while (length--) { + // Deep compare each member + key = _keys[length]; + if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; + } } - return result; + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return true; } - // Shuffle a collection. - function shuffle(obj) { - return sample(obj, Infinity); + // Perform a deep comparison to check if two objects are equal. + function isEqual(a, b) { + return eq(a, b); } - // Sample **n** random values from a collection using the modern version of the - // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `map`. - function sample(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = values(obj); - return obj[random(obj.length - 1)]; - } - var sample = isArrayLike(obj) ? clone(obj) : values(obj); - var length = getLength(sample); - n = Math.max(Math.min(n, length), 0); - var last = length - 1; - for (var index = 0; index < n; index++) { - var rand = random(index, last); - var temp = sample[index]; - sample[index] = sample[rand]; - sample[rand] = temp; - } - return sample.slice(0, n); + // Retrieve all the enumerable property names of an object. + function allKeys(obj) { + if (!isObject(obj)) return []; + var keys = []; + for (var key in obj) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; } - // Sort the object's values by a criterion produced by an iteratee. - function sortBy(obj, iteratee, context) { - var index = 0; - iteratee = cb(iteratee, context); - return pluck(map(obj, function(value, key, list) { - return { - value: value, - index: index++, - criteria: iteratee(value, key, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); + // Retrieve the values of an object's properties. + function values(obj) { + var _keys = keys(obj); + var length = _keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[_keys[i]]; + } + return values; } - // An internal function used for aggregate "group by" operations. - function group(behavior, partition) { - return function(obj, iteratee, context) { - var result = partition ? [[], []] : {}; - iteratee = cb(iteratee, context); - each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; + // Convert an object into a list of `[key, value]` pairs. + // The opposite of `_.object` with one argument. + function pairs(obj) { + var _keys = keys(obj); + var length = _keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [_keys[i], obj[_keys[i]]]; + } + return pairs; } - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - var groupBy = group(function(result, value, key) { - if (_has(result, key)) result[key].push(value); else result[key] = [value]; - }); - - // Indexes the object's values by a criterion, similar to `groupBy`, but for - // when you know that your index values will be unique. - var indexBy = group(function(result, value, key) { - result[key] = value; - }); - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - var countBy = group(function(result, value, key) { - if (_has(result, key)) result[key]++; else result[key] = 1; - }); + // Invert the keys and values of an object. The values must be serializable. + function invert(obj) { + var result = {}; + var _keys = keys(obj); + for (var i = 0, length = _keys.length; i < length; i++) { + result[obj[_keys[i]]] = _keys[i]; + } + return result; + } - var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; - // Safely create a real, live array from anything iterable. - function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together - return obj.match(reStrSymbol); + // Return a sorted list of the function names available on the object. + function functions(obj) { + var names = []; + for (var key in obj) { + if (isFunction$1(obj[key])) names.push(key); } - if (isArrayLike(obj)) return map(obj, identity); - return values(obj); + return names.sort(); } - // Return the number of elements in an object. - function size(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : keys(obj).length; + // An internal function for creating assigner functions. + function createAssigner(keysFunc, defaults) { + return function(obj) { + var length = arguments.length; + if (defaults) obj = Object(obj); + if (length < 2 || obj == null) return obj; + for (var index = 1; index < length; index++) { + var source = arguments[index], + keys = keysFunc(source), + l = keys.length; + for (var i = 0; i < l; i++) { + var key = keys[i]; + if (!defaults || obj[key] === void 0) obj[key] = source[key]; + } + } + return obj; + }; } - // Split a collection into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - var partition = group(function(result, value, pass) { - result[pass ? 0 : 1].push(value); - }, true); + // Extend a given object with all the properties in passed-in object(s). + var extend = createAssigner(allKeys); - // Array Functions - // --------------- + // Assigns a given object with all the own properties in the passed-in + // object(s). + // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + var extendOwn = createAssigner(keys); - // Get the first element of an array. Passing **n** will return the first N - // values in the array. The **guard** check allows it to work with `map`. - function first(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[0]; - return initial(array, array.length - n); + // Fill in a given object with default properties. + var defaults = createAssigner(allKeys, true); + + // Create a naked function reference for surrogate-prototype-swapping. + function ctor() { + return function(){}; } - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. - function initial(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); + // An internal function for creating a new object that inherits from another. + function baseCreate(prototype) { + if (!isObject(prototype)) return {}; + if (nativeCreate) return nativeCreate(prototype); + var Ctor = ctor(); + Ctor.prototype = prototype; + var result = new Ctor; + Ctor.prototype = null; + return result; } - // Get the last element of an array. Passing **n** will return the last N - // values in the array. - function last(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[array.length - 1]; - return rest(array, Math.max(0, array.length - n)); + // Creates an object that inherits from the given prototype object. + // If additional properties are provided then they will be added to the + // created object. + function create(prototype, props) { + var result = baseCreate(prototype); + if (props) extendOwn(result, props); + return result; } - // Returns everything but the first entry of the array. Especially useful on - // the arguments object. Passing an **n** will return the rest N values in the - // array. - function rest(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); + // Create a (shallow-cloned) duplicate of an object. + function clone(obj) { + if (!isObject(obj)) return obj; + return isArray(obj) ? obj.slice() : extend({}, obj); } - // Trim out all falsy values from an array. - function compact(array) { - return filter(array, Boolean); + // Invokes `interceptor` with the `obj` and then returns `obj`. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + function tap(obj, interceptor) { + interceptor(obj); + return obj; } - // Internal implementation of a recursive `flatten` function. - function _flatten(input, shallow, strict, output) { - output = output || []; - var idx = output.length; - for (var i = 0, length = getLength(input); i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (isArray(value) || isArguments(value))) { - // Flatten current level of array or arguments object. - if (shallow) { - var j = 0, len = value.length; - while (j < len) output[idx++] = value[j++]; - } else { - _flatten(value, shallow, strict, output); - idx = output.length; - } - } else if (!strict) { - output[idx++] = value; + // Shortcut function for checking if an object has a given property directly on + // itself (in other words, not on a prototype). Unlike the internal `has` + // function, this public version can also traverse nested properties. + function has$1(obj, path) { + if (!isArray(path)) { + return has(obj, path); + } + var length = path.length; + for (var i = 0; i < length; i++) { + var key = path[i]; + if (obj == null || !hasOwnProperty.call(obj, key)) { + return false; } + obj = obj[key]; } - return output; + return !!length; } - // Flatten out an array, either recursively (by default), or just one level. - function flatten(array, shallow) { - return _flatten(array, shallow, false); + // Keep the identity function around for default iteratees. + function identity(value) { + return value; } - // Return a version of the array that does not contain the specified value(s). - var without = restArguments(function(array, otherArrays) { - return difference(array, otherArrays); - }); - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // The faster algorithm will not work with an iteratee if the iteratee - // is not a one-to-one function, so providing an iteratee will disable - // the faster algorithm. - function uniq(array, isSorted, iteratee, context) { - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted && !iteratee) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!contains(result, value)) { - result.push(value); - } - } - return result; + // Returns a predicate for checking whether an object has a given set of + // `key:value` pairs. + function matcher(attrs) { + attrs = extendOwn({}, attrs); + return function(obj) { + return isMatch(obj, attrs); + }; } - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - var union = restArguments(function(arrays) { - return uniq(_flatten(arrays, true, true)); - }); - - // Produce an array that contains every item shared between all the - // passed-in arrays. - function intersection(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = getLength(array); i < length; i++) { - var item = array[i]; - if (contains(result, item)) continue; - var j; - for (j = 1; j < argsLength; j++) { - if (!contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); + // Internal function to obtain a nested property in `obj` along `path`. + function deepGet(obj, path) { + var length = path.length; + for (var i = 0; i < length; i++) { + if (obj == null) return void 0; + obj = obj[path[i]]; } - return result; + return length ? obj : void 0; } - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - var difference = restArguments(function(array, rest) { - rest = _flatten(rest, true, true); - return filter(array, function(value){ - return !contains(rest, value); - }); - }); - - // Complement of zip. Unzip accepts an array of arrays and groups - // each array's elements on shared indices. - function unzip(array) { - var length = array && max(array, getLength).length || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = pluck(array, index); + // Creates a function that, when passed an object, will traverse that object’s + // properties down the given `path`, specified as an array of keys or indices. + function property(path) { + if (!isArray(path)) { + return shallowProperty(path); } - return result; + return function(obj) { + return deepGet(obj, path); + }; } - // Zip together multiple lists into a single array -- elements that share - // an index go together. - var zip = restArguments(unzip); - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. Passing by pairs is the reverse of pairs. - function object(list, values) { - var result = {}; - for (var i = 0, length = getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + function optimizeCb(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + // The 2-argument case is omitted because we’re not using it. + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; } - return result; - } - - // Generator function to create the findIndex and findLastIndex functions. - function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; + return function() { + return func.apply(context, arguments); }; } - // Returns the first index on an array-like that passes a predicate test. - var findIndex = createPredicateIndexFinder(1); - var findLastIndex = createPredicateIndexFinder(-1); - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - function sortedIndex(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; + // An internal function to generate callbacks that can be applied to each + // element in a collection, returning the desired result — either `_.identity`, + // an arbitrary callback, a property matcher, or a property accessor. + function baseIteratee(value, context, argCount) { + if (value == null) return identity; + if (isFunction$1(value)) return optimizeCb(value, context, argCount); + if (isObject(value) && !isArray(value)) return matcher(value); + return property(value); } - // Generator function to create the indexOf and lastIndexOf functions. - function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(slice.call(array, i, length), isNaN); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; + // External wrapper for our callback generator. Users may customize + // `_.iteratee` if they want additional predicate/iteratee shorthand styles. + // This abstraction hides the internal-only `argCount` argument. + function iteratee(value, context) { + return baseIteratee(value, context, Infinity); } + _.iteratee = iteratee; - // Return the position of the first occurrence of an item in an array, - // or -1 if the item is not included in the array. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - var indexOf = createIndexFinder(1, findIndex, sortedIndex); - var lastIndexOf = createIndexFinder(-1, findLastIndex); + // The function we call internally to generate a callback. It invokes + // `_.iteratee` if overridden, otherwise `baseIteratee`. + function cb(value, context, argCount) { + if (_.iteratee !== iteratee) return _.iteratee(value, context); + return baseIteratee(value, context, argCount); + } - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](https://docs.python.org/library/functions.html#range). - function range(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - if (!step) { - step = stop < start ? -1 : 1; + // Returns the results of applying the `iteratee` to each element of `obj`. + // In contrast to `_.map` it returns an object. + function mapObject(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var _keys = keys(obj), + length = _keys.length, + results = {}; + for (var index = 0; index < length; index++) { + var currentKey = _keys[index]; + results[currentKey] = iteratee(obj[currentKey], currentKey, obj); } + return results; + } - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); + // Predicate-generating function. Often useful outside of Underscore. + function noop(){} - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; + // Generates a function for a given object that returns a given property. + function propertyOf(obj) { + if (obj == null) { + return function(){}; } + return function(path) { + return !isArray(path) ? obj[path] : deepGet(obj, path); + }; + } - return range; + // Run a function **n** times. + function times(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = optimizeCb(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); + return accum; } - // Chunk a single array into multiple arrays, each containing `count` or fewer - // items. - function chunk(array, count) { - if (count == null || count < 1) return []; - var result = []; - var i = 0, length = array.length; - while (i < length) { - result.push(slice.call(array, i, i += count)); + // Return a random integer between `min` and `max` (inclusive). + function random(min, max) { + if (max == null) { + max = min; + min = 0; } - return result; + return min + Math.floor(Math.random() * (max - min + 1)); } - // Function (ahem) Functions - // ------------------ + // A (possibly faster) way to get the current timestamp as an integer. + var now = Date.now || function() { + return new Date().getTime(); + }; - // Determines whether to execute a function as a constructor - // or a normal function with the provided arguments. - function executeBound(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (isObject(result)) return result; - return self; + // Internal helper to generate functions for escaping and unescaping strings + // to/from HTML interpolation. + function createEscaper(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped. + var source = '(?:' + keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; } - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - var bind = restArguments(function(func, context, args) { - if (!isFunction(func)) throw new TypeError('Bind must be called on a function'); - var bound = restArguments(function(callArgs) { - return executeBound(func, bound, context, this, args.concat(callArgs)); - }); - return bound; - }); + // Internal list of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. _ acts - // as a placeholder by default, allowing any combination of arguments to be - // pre-filled. Set `partial.placeholder` for a custom placeholder argument. - var partial = restArguments(function(func, boundArgs) { - var placeholder = partial.placeholder; - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; - }); + // Function for escaping strings to HTML interpolation. + var _escape = createEscaper(escapeMap); - partial.placeholder = _; + // Internal list of HTML entities for unescaping. + var unescapeMap = invert(escapeMap); - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - var bindAll = restArguments(function(obj, _keys) { - _keys = _flatten(_keys, false, false); - var index = _keys.length; - if (index < 1) throw new Error('bindAll must be passed function names'); - while (index--) { - var key = _keys[index]; - obj[key] = bind(obj[key], obj); - } - return obj; - }); + // Function for unescaping strings from HTML interpolation. + var _unescape = createEscaper(unescapeMap); - // Memoize an expensive function by storing its results. - function memoize(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!_has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; - } + // By default, Underscore uses ERB-style template delimiters. Change the + // following template settings to use alternative delimiters. + var templateSettings = _.templateSettings = { + evaluate: /<%([\s\S]+?)%>/g, + interpolate: /<%=([\s\S]+?)%>/g, + escape: /<%-([\s\S]+?)%>/g + }; - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - var delay = restArguments(function(func, wait, args) { + // When customizing `_.templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; + + function escapeChar(match) { + return '\\' + escapes[match]; + } + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + // NB: `oldSettings` only exists for backwards compatibility. + function template(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; + settings = defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escapeRegExp, escapeChar); + index = offset + match.length; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } else if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } else if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + + // Adobe VMs need the match returned to produce the correct offset. + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + 'return __p;\n'; + + var render; + try { + render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; + + return template; + } + + // Traverses the children of `obj` along `path`. If a child is a function, it + // is invoked with its parent as context. Returns the value of the final + // child, or `fallback` if any child is undefined. + function result(obj, path, fallback) { + if (!isArray(path)) path = [path]; + var length = path.length; + if (!length) { + return isFunction$1(fallback) ? fallback.call(obj) : fallback; + } + for (var i = 0; i < length; i++) { + var prop = obj == null ? void 0 : obj[path[i]]; + if (prop === void 0) { + prop = fallback; + i = length; // Ensure we don't continue iterating. + } + obj = isFunction$1(prop) ? prop.call(obj) : prop; + } + return obj; + } + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + function uniqueId(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + } + + // Start chaining a wrapped Underscore object. + function chain(obj) { + var instance = _(obj); + instance._chain = true; + return instance; + } + + // Internal function to execute `sourceFunc` bound to `context` with optional + // `args`. Determines whether to execute a function as a constructor or as a + // normal function. + function executeBound(sourceFunc, boundFunc, context, callingContext, args) { + if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); + var self = baseCreate(sourceFunc.prototype); + var result = sourceFunc.apply(self, args); + if (isObject(result)) return result; + return self; + } + + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. `_` acts + // as a placeholder by default, allowing any combination of arguments to be + // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. + var partial = restArguments(function(func, boundArgs) { + var placeholder = partial.placeholder; + var bound = function() { + var position = 0, length = boundArgs.length; + var args = Array(length); + for (var i = 0; i < length; i++) { + args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; + } + while (position < arguments.length) args.push(arguments[position++]); + return executeBound(func, bound, this, this, args); + }; + return bound; + }); + + partial.placeholder = _; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). + var bind = restArguments(function(func, context, args) { + if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); + var bound = restArguments(function(callArgs) { + return executeBound(func, bound, context, this, args.concat(callArgs)); + }); + return bound; + }); + + // Internal implementation of a recursive `flatten` function. + function flatten(input, shallow, strict, output) { + output = output || []; + var idx = output.length; + for (var i = 0, length = getLength(input); i < length; i++) { + var value = input[i]; + if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { + // Flatten current level of array or arguments object. + if (shallow) { + var j = 0, len = value.length; + while (j < len) output[idx++] = value[j++]; + } else { + flatten(value, shallow, strict, output); + idx = output.length; + } + } else if (!strict) { + output[idx++] = value; + } + } + return output; + } + + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. + var bindAll = restArguments(function(obj, keys) { + keys = flatten(keys, false, false); + var index = keys.length; + if (index < 1) throw new Error('bindAll must be passed function names'); + while (index--) { + var key = keys[index]; + obj[key] = bind(obj[key], obj); + } + return obj; + }); + + // Memoize an expensive function by storing its results. + function memoize(func, hasher) { + var memoize = function(key) { + var cache = memoize.cache; + var address = '' + (hasher ? hasher.apply(this, arguments) : key); + if (!has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; + }; + memoize.cache = {}; + return memoize; + } + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + var delay = restArguments(function(func, wait, args) { return setTimeout(function() { return func.apply(null, args); }, wait); @@ -892,7 +1025,7 @@ } // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for + // be triggered. The function will be triggered after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. function debounce(func, wait, immediate) { @@ -960,7 +1093,8 @@ }; } - // Returns a function that will only be executed up to (but not including) the Nth call. + // Returns a function that will only be executed up to (but not including) the + // Nth call. function before(times, func) { var memo; return function() { @@ -976,699 +1110,609 @@ // often you call it. Useful for lazy initialization. var once = partial(before, 2); - // Object Functions - // ---------------- - - // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. - var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); - var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - - function collectNonEnumProps(obj, _keys) { - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = isFunction(constructor) && constructor.prototype || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (_has(obj, prop) && !contains(_keys, prop)) _keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !contains(_keys, prop)) { - _keys.push(prop); - } + // Returns the first key on an object that passes a truth test. + function findKey(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = keys(obj), key; + for (var i = 0, length = _keys.length; i < length; i++) { + key = _keys[i]; + if (predicate(obj[key], key, obj)) return key; } } - // Retrieve the names of an object's own properties. - // Delegates to **ECMAScript 5**'s native `Object.keys`. - function keys(obj) { - if (!isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var _keys = []; - for (var key in obj) if (_has(obj, key)) _keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, _keys); - return _keys; + // Internal function to generate `_.findIndex` and `_.findLastIndex`. + function createPredicateIndexFinder(dir) { + return function(array, predicate, context) { + predicate = cb(predicate, context); + var length = getLength(array); + var index = dir > 0 ? 0 : length - 1; + for (; index >= 0 && index < length; index += dir) { + if (predicate(array[index], index, array)) return index; + } + return -1; + }; } - // Retrieve all the property names of an object. - function allKeys(obj) { - if (!isObject(obj)) return []; - var _keys = []; - for (var key in obj) _keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, _keys); - return _keys; - } + // Returns the first index on an array-like that passes a truth test. + var findIndex = createPredicateIndexFinder(1); - // Retrieve the values of an object's properties. - function values(obj) { - var _keys = keys(obj); - var length = _keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[_keys[i]]; + // Returns the last index on an array-like that passes a truth test. + var findLastIndex = createPredicateIndexFinder(-1); + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + function sortedIndex(array, obj, iteratee, context) { + iteratee = cb(iteratee, context, 1); + var value = iteratee(obj); + var low = 0, high = getLength(array); + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; } - return values; + return low; } - // Returns the results of applying the iteratee to each element of the object. - // In contrast to map it returns an object. - function mapObject(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = keys(obj), - length = _keys.length, - results = {}; - for (var index = 0; index < length; index++) { - var currentKey = _keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; + // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. + function createIndexFinder(dir, predicateFind, sortedIndex) { + return function(array, item, idx) { + var i = 0, length = getLength(array); + if (typeof idx == 'number') { + if (dir > 0) { + i = idx >= 0 ? idx : Math.max(idx + length, i); + } else { + length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; + } + } else if (sortedIndex && idx && length) { + idx = sortedIndex(array, item); + return array[idx] === item ? idx : -1; + } + if (item !== item) { + idx = predicateFind(slice.call(array, i, length), isNaN$1); + return idx >= 0 ? idx + i : -1; + } + for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { + if (array[idx] === item) return idx; + } + return -1; + }; } - // Convert an object into a list of `[key, value]` pairs. - // The opposite of object. - function pairs(obj) { - var _keys = keys(obj); - var length = _keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [_keys[i], obj[_keys[i]]]; - } - return pairs; + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + var indexOf = createIndexFinder(1, findIndex, sortedIndex); + + // Return the position of the last occurrence of an item in an array, + // or -1 if the item is not included in the array. + var lastIndexOf = createIndexFinder(-1, findLastIndex); + + // Return the first value which passes a truth test. + function find(obj, predicate, context) { + var keyFinder = isArrayLike(obj) ? findIndex : findKey; + var key = keyFinder(obj, predicate, context); + if (key !== void 0 && key !== -1) return obj[key]; } - // Invert the keys and values of an object. The values must be serializable. - function invert(obj) { - var result = {}; - var _keys = keys(obj); - for (var i = 0, length = _keys.length; i < length; i++) { - result[obj[_keys[i]]] = _keys[i]; + // Convenience version of a common use case of `_.find`: getting the first + // object containing specific `key:value` pairs. + function findWhere(obj, attrs) { + return find(obj, matcher(attrs)); + } + + // The cornerstone for collection functions, an `each` + // implementation, aka `forEach`. + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + function each(obj, iteratee, context) { + iteratee = optimizeCb(iteratee, context); + var i, length; + if (isArrayLike(obj)) { + for (i = 0, length = obj.length; i < length; i++) { + iteratee(obj[i], i, obj); + } + } else { + var _keys = keys(obj); + for (i = 0, length = _keys.length; i < length; i++) { + iteratee(obj[_keys[i]], _keys[i], obj); + } } - return result; + return obj; } - // Return a sorted list of the function names available on the object. - function functions(obj) { - var names = []; - for (var key in obj) { - if (isFunction(obj[key])) names.push(key); + // Return the results of applying the iteratee to each element. + function map(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length, + results = Array(length); + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); } - return names.sort(); + return results; } - // An internal function for creating assigner functions. - function createAssigner(keysFunc, defaults) { - return function(obj) { - var length = arguments.length; - if (defaults) obj = Object(obj); - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - _keys = keysFunc(source), - l = _keys.length; - for (var i = 0; i < l; i++) { - var key = _keys[i]; - if (!defaults || obj[key] === void 0) obj[key] = source[key]; - } + // Internal helper to create a reducing function, iterating left or right. + function createReduce(dir) { + // Wrap code that reassigns argument variables in a separate function than + // the one that accesses `arguments.length` to avoid a perf hit. (#1991) + var reducer = function(obj, iteratee, memo, initial) { + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length, + index = dir > 0 ? 0 : length - 1; + if (!initial) { + memo = obj[_keys ? _keys[index] : index]; + index += dir; } - return obj; + for (; index >= 0 && index < length; index += dir) { + var currentKey = _keys ? _keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + }; + + return function(obj, iteratee, memo, context) { + var initial = arguments.length >= 3; + return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); }; } - // Extend a given object with all the properties in passed-in object(s). - var extend = createAssigner(allKeys); + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. + var reduce = createReduce(1); - // Assigns a given object with all the own properties in the passed-in object(s). - // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) - var extendOwn = createAssigner(keys); + // The right-associative version of reduce, also known as `foldr`. + var reduceRight = createReduce(-1); - // Returns the first key on an object that passes a predicate test. - function findKey(obj, predicate, context) { + // Return all the elements that pass a truth test. + function filter(obj, predicate, context) { + var results = []; predicate = cb(predicate, context); - var _keys = keys(obj), key; - for (var i = 0, length = _keys.length; i < length; i++) { - key = _keys[i]; - if (predicate(obj[key], key, obj)) return key; - } + each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); + }); + return results; } - // Internal pick helper function to determine if `obj` has key `key`. - function keyInObj(value, key, obj) { - return key in obj; + // Return all the elements for which a truth test fails. + function reject(obj, predicate, context) { + return filter(obj, negate(cb(predicate)), context); } - // Return a copy of the object only containing the whitelisted properties. - var pick = restArguments(function(obj, _keys) { - var result = {}, iteratee = _keys[0]; - if (obj == null) return result; - if (isFunction(iteratee)) { - if (_keys.length > 1) iteratee = optimizeCb(iteratee, _keys[1]); - _keys = allKeys(obj); - } else { - iteratee = keyInObj; - _keys = _flatten(_keys, false, false); - obj = Object(obj); - } - for (var i = 0, length = _keys.length; i < length; i++) { - var key = _keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; - }); - - // Return a copy of the object without the blacklisted properties. - var omit = restArguments(function(obj, _keys) { - var iteratee = _keys[0], context; - if (isFunction(iteratee)) { - iteratee = negate(iteratee); - if (_keys.length > 1) context = _keys[1]; - } else { - _keys = map(_flatten(_keys, false, false), String); - iteratee = function(value, key) { - return !contains(_keys, key); - }; + // Determine whether all of the elements pass a truth test. + function every(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; } - return pick(obj, iteratee, context); - }); - - // Fill in a given object with default properties. - var defaults = createAssigner(allKeys, true); - - // Creates an object that inherits from the given prototype object. - // If additional properties are provided then they will be added to the - // created object. - function create(prototype, props) { - var result = baseCreate(prototype); - if (props) extendOwn(result, props); - return result; + return true; } - // Create a (shallow-cloned) duplicate of an object. - function clone(obj) { - if (!isObject(obj)) return obj; - return isArray(obj) ? obj.slice() : extend({}, obj); + // Determine if at least one element in the object passes a truth test. + function some(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; } - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - function tap(obj, interceptor) { - interceptor(obj); - return obj; + // Determine if the array or object contains a given item (using `===`). + function contains(obj, item, fromIndex, guard) { + if (!isArrayLike(obj)) obj = values(obj); + if (typeof fromIndex != 'number' || guard) fromIndex = 0; + return indexOf(obj, item, fromIndex) >= 0; } - // Returns whether an object has a given set of `key:value` pairs. - function isMatch(object, attrs) { - var _keys = keys(attrs), length = _keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = _keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; + // Invoke a method (with arguments) on every item in a collection. + var invoke = restArguments(function(obj, path, args) { + var contextPath, func; + if (isFunction$1(path)) { + func = path; + } else if (isArray(path)) { + contextPath = path.slice(0, -1); + path = path[path.length - 1]; } - return true; + return map(obj, function(context) { + var method = func; + if (!method) { + if (contextPath && contextPath.length) { + context = deepGet(context, contextPath); + } + if (context == null) return void 0; + method = context[path]; + } + return method == null ? method : method.apply(context, args); + }); + }); + + // Convenience version of a common use case of `_.map`: fetching a property. + function pluck(obj, key) { + return map(obj, property(key)); } + // Convenience version of a common use case of `_.filter`: selecting only + // objects containing specific `key:value` pairs. + function where(obj, attrs) { + return filter(obj, matcher(attrs)); + } - // Internal recursive comparison function for `isEqual`. - function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // `null` or `undefined` only equal to itself (strict comparison). - if (a == null || b == null) return false; - // `NaN`s are equivalent, but non-reflexive. - if (a !== a) return b !== b; - // Exhaust primitive checks - var type = typeof a; - if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; - return deepEq(a, b, aStack, bStack); - } - - // Internal recursive comparison function for `isEqual`. - function deepEq(a, b, aStack, bStack) { - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - - switch (className) { - // These types are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN. - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // 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); - case '[object ArrayBuffer]': - // Coerce to `DataView` so we can fall through to the next case. - return deepEq(new DataView(a), new DataView(b), aStack, bStack); - case '[object DataView]': - var byteLength = getByteLength(a); - if (byteLength !== getByteLength(b)) { - return false; - } - while (byteLength--) { - if (a.getUint8(byteLength) !== b.getUint8(byteLength)) { - return false; - } + // Return the maximum element (or element-based computation). + function max(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + obj = isArrayLike(obj) ? obj : values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value != null && value > result) { + result = value; } - return true; - } - - if (isTypedArray(a)) { - // Coerce typed arrays to `DataView`. - return deepEq(new DataView(a.buffer), new DataView(b.buffer), aStack, bStack); - } - - var areArrays = className === '[object Array]'; - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && - isFunction(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; } + } else { + iteratee = cb(iteratee, context); + each(obj, function(v, index, list) { + computed = iteratee(v, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = v; + lastComputed = computed; + } + }); } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); + return result; + } - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; + // Return the minimum element (or element-based computation). + function min(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + obj = isArrayLike(obj) ? obj : values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value != null && value < result) { + result = value; + } } } else { - // Deep compare objects. - var _keys = keys(a), key; - length = _keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = _keys[length]; - if (!(_has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } + iteratee = cb(iteratee, context); + each(obj, function(v, index, list) { + computed = iteratee(v, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = v; + lastComputed = computed; + } + }); } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; + return result; } - // Perform a deep comparison to check if two objects are equal. - function isEqual(a, b) { - return eq(a, b); + // Sample **n** random values from a collection using the modern version of the + // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `_.map`. + function sample(obj, n, guard) { + if (n == null || guard) { + if (!isArrayLike(obj)) obj = values(obj); + return obj[random(obj.length - 1)]; + } + var sample = isArrayLike(obj) ? clone(obj) : values(obj); + var length = getLength(sample); + n = Math.max(Math.min(n, length), 0); + var last = length - 1; + for (var index = 0; index < n; index++) { + var rand = random(index, last); + var temp = sample[index]; + sample[index] = sample[rand]; + sample[rand] = temp; + } + return sample.slice(0, n); } - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - function isEmpty(obj) { - if (obj == null) return true; - // Skip the more expensive `toString`-based type checks if `obj` has no - // `.length`. - if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments(obj))) return obj.length === 0; - return keys(obj).length === 0; + // Shuffle a collection. + function shuffle(obj) { + return sample(obj, Infinity); } - // Is a given value a DOM element? - function isElement(obj) { - return !!(obj && obj.nodeType === 1); + // Sort the object's values by a criterion produced by an iteratee. + function sortBy(obj, iteratee, context) { + var index = 0; + iteratee = cb(iteratee, context); + return pluck(map(obj, function(value, key, list) { + return { + value: value, + index: index++, + criteria: iteratee(value, key, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); } - // Internal function for creating a toString-based type tester. - function tagTester(name) { - return function(obj) { - return toString.call(obj) === '[object ' + name + ']'; + // An internal function used for aggregate "group by" operations. + function group(behavior, partition) { + return function(obj, iteratee, context) { + var result = partition ? [[], []] : {}; + iteratee = cb(iteratee, context); + each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; }; } - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - var isArray = nativeIsArray || tagTester('Array'); - - // Is a given variable an object? - function isObject(obj) { - var type = typeof obj; - return type === 'function' || type === 'object' && !!obj; - } - - // Add some isType methods. - var isArguments = tagTester('Arguments'); - var isFunction = tagTester('Function'); - var isString = tagTester('String'); - var isNumber = tagTester('Number'); - var isDate = tagTester('Date'); - var isRegExp = tagTester('RegExp'); - var isError = tagTester('Error'); - var isSymbol = tagTester('Symbol'); - var isMap = tagTester('Map'); - var isWeakMap = tagTester('WeakMap'); - var isSet = tagTester('Set'); - var isWeakSet = tagTester('WeakSet'); - var isArrayBuffer = tagTester('ArrayBuffer'); - var isDataView = tagTester('DataView'); - - // Define a fallback version of the method in browsers (ahem, IE < 9), where - // there isn't any inspectable "Arguments" type. - (function() { - if (!isArguments(arguments)) { - isArguments = function(obj) { - return _has(obj, 'callee'); - }; - } - }()); + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + var groupBy = group(function(result, value, key) { + if (has(result, key)) result[key].push(value); else result[key] = [value]; + }); - // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, - // IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). - var nodelist = root.document && root.document.childNodes; - if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { - isFunction = function(obj) { - return typeof obj == 'function' || false; - }; - } + // Indexes the object's values by a criterion, similar to `_.groupBy`, but for + // when you know that your index values will be unique. + var indexBy = group(function(result, value, key) { + result[key] = value; + }); - // Is a given object a finite number? - function isFinite(obj) { - return !isSymbol(obj) && _isFinite(obj) && !_isNaN(parseFloat(obj)); - } + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + var countBy = group(function(result, value, key) { + if (has(result, key)) result[key]++; else result[key] = 1; + }); - // Is the given value `NaN`? - function isNaN(obj) { - return isNumber(obj) && _isNaN(obj); - } + // Split a collection into two arrays: one whose elements all pass the given + // truth test, and one whose elements all do not pass the truth test. + var partition = group(function(result, value, pass) { + result[pass ? 0 : 1].push(value); + }, true); - // Is a given value a boolean? - function isBoolean(obj) { - return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; + // Safely create a real, live array from anything iterable. + var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; + function toArray(obj) { + if (!obj) return []; + if (isArray(obj)) return slice.call(obj); + if (isString(obj)) { + // Keep surrogate pair characters together. + return obj.match(reStrSymbol); + } + if (isArrayLike(obj)) return map(obj, identity); + return values(obj); } - // Is a given value equal to null? - function isNull(obj) { - return obj === null; + // Return the number of elements in a collection. + function size(obj) { + if (obj == null) return 0; + return isArrayLike(obj) ? obj.length : keys(obj).length; } - // Is a given variable undefined? - function isUndefined(obj) { - return obj === void 0; + // Internal `_.pick` helper function to determine whether `key` is an enumerable + // property name of `obj`. + function keyInObj(value, key, obj) { + return key in obj; } - // Is a given value a typed array? - var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; - var isTypedArray = supportsArrayBuffer ? function(obj) { - // `ArrayBuffer.isView` is the most future-proof, so use it when available. - // Otherwise, fall back on the above regular expression. - return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) : isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); - } : constant(false); - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - function has(obj, path) { - if (!isArray(path)) { - return _has(obj, path); + // Return a copy of the object only containing the whitelisted properties. + var pick = restArguments(function(obj, keys) { + var result = {}, iteratee = keys[0]; + if (obj == null) return result; + if (isFunction$1(iteratee)) { + if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); + keys = allKeys(obj); + } else { + iteratee = keyInObj; + keys = flatten(keys, false, false); + obj = Object(obj); } - var length = path.length; - for (var i = 0; i < length; i++) { - var key = path[i]; - if (obj == null || !hasOwnProperty.call(obj, key)) { - return false; - } - obj = obj[key]; + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; } - return !!length; - } - - // Utility Functions - // ----------------- + return result; + }); - // Keep the identity function around for default iteratees. - function identity(value) { - return value; - } + // Return a copy of the object without the blacklisted properties. + var omit = restArguments(function(obj, keys) { + var iteratee = keys[0], context; + if (isFunction$1(iteratee)) { + iteratee = negate(iteratee); + if (keys.length > 1) context = keys[1]; + } else { + keys = map(flatten(keys, false, false), String); + iteratee = function(value, key) { + return !contains(keys, key); + }; + } + return pick(obj, iteratee, context); + }); - // Predicate-generating functions. Often useful outside of Underscore. - function constant(value) { - return function() { - return value; - }; + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. + function initial(array, n, guard) { + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); } - function noop(){} - - // Creates a function that, when passed an object, will traverse that object’s - // properties down the given `path`, specified as an array of keys or indexes. - function property(path) { - if (!isArray(path)) { - return shallowProperty(path); - } - return function(obj) { - return deepGet(obj, path); - }; + // Get the first element of an array. Passing **n** will return the first N + // values in the array. The **guard** check allows it to work with `_.map`. + function first(array, n, guard) { + if (array == null || array.length < 1) return n == null || guard ? void 0 : []; + if (n == null || guard) return array[0]; + return initial(array, array.length - n); } - // Generates a function for a given object that returns a given property. - function propertyOf(obj) { - if (obj == null) { - return function(){}; - } - return function(path) { - return !isArray(path) ? obj[path] : deepGet(obj, path); - }; + // Returns everything but the first entry of the `array`. Especially useful on + // the `arguments` object. Passing an **n** will return the rest N values in the + // `array`. + function rest(array, n, guard) { + return slice.call(array, n == null || guard ? 1 : n); } - // Returns a predicate for checking whether an object has a given set of - // `key:value` pairs. - function matcher(attrs) { - attrs = extendOwn({}, attrs); - return function(obj) { - return isMatch(obj, attrs); - }; + // Get the last element of an array. Passing **n** will return the last N + // values in the array. + function last(array, n, guard) { + if (array == null || array.length < 1) return n == null || guard ? void 0 : []; + if (n == null || guard) return array[array.length - 1]; + return rest(array, Math.max(0, array.length - n)); } - // Run a function **n** times. - function times(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; + // Trim out all falsy values from an array. + function compact(array) { + return filter(array, Boolean); } - // Return a random integer between min and max (inclusive). - function random(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); + // Flatten out an array, either recursively (by default), or just one level. + function flatten$1(array, shallow) { + return flatten(array, shallow, false); } - // A (possibly faster) way to get the current timestamp as an integer. - var now = Date.now || function() { - return new Date().getTime(); - }; - - // List of HTML entities for escaping. - var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - var unescapeMap = invert(escapeMap); + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + var difference = restArguments(function(array, rest) { + rest = flatten(rest, true, true); + return filter(array, function(value){ + return !contains(rest, value); + }); + }); - // Functions for escaping and unescaping strings to/from HTML interpolation. - function createEscaper(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; - } - var escape = createEscaper(escapeMap); - var unescape = createEscaper(unescapeMap); + // Return a version of the array that does not contain the specified value(s). + var without = restArguments(function(array, otherArrays) { + return difference(array, otherArrays); + }); - // Traverses the children of `obj` along `path`. If a child is a function, it - // is invoked with its parent as context. Returns the value of the final - // child, or `fallback` if any child is undefined. - function result(obj, path, fallback) { - if (!isArray(path)) path = [path]; - var length = path.length; - if (!length) { - return isFunction(fallback) ? fallback.call(obj) : fallback; + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // The faster algorithm will not work with an iteratee if the iteratee + // is not a one-to-one function, so providing an iteratee will disable + // the faster algorithm. + function uniq(array, isSorted, iteratee, context) { + if (!isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; } - for (var i = 0; i < length; i++) { - var prop = obj == null ? void 0 : obj[path[i]]; - if (prop === void 0) { - prop = fallback; - i = length; // Ensure we don't continue iterating. + if (iteratee != null) iteratee = cb(iteratee, context); + var result = []; + var seen = []; + for (var i = 0, length = getLength(array); i < length; i++) { + var value = array[i], + computed = iteratee ? iteratee(value, i, array) : value; + if (isSorted && !iteratee) { + if (!i || seen !== computed) result.push(value); + seen = computed; + } else if (iteratee) { + if (!contains(seen, computed)) { + seen.push(computed); + result.push(value); + } + } else if (!contains(result, value)) { + result.push(value); } - obj = isFunction(prop) ? prop.call(obj) : prop; } - return obj; - } - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - function uniqueId(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; + return result; } - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - var templateSettings = _.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; - - var escapeChar = function(match) { - return '\\' + escapes[match]; - }; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - // NB: `oldSettings` only exists for backwards compatibility. - function template(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escapeRegExp, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + var union = restArguments(function(arrays) { + return uniq(flatten(arrays, true, true)); + }); + + // Produce an array that contains every item shared between all the + // passed-in arrays. + function intersection(array) { + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = getLength(array); i < length; i++) { + var item = array[i]; + if (contains(result, item)) continue; + var j; + for (j = 1; j < argsLength; j++) { + if (!contains(arguments[j], item)) break; } + if (j === argsLength) result.push(item); + } + return result; + } - // Adobe VMs need the match returned to produce the correct offset. - return match; - }); - source += "';\n"; + // Complement of zip. Unzip accepts an array of arrays and groups + // each array's elements on shared indices. + function unzip(array) { + var length = array && max(array, getLength).length || 0; + var result = Array(length); - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + for (var index = 0; index < length; index++) { + result[index] = pluck(array, index); + } + return result; + } - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; + // Zip together multiple lists into a single array -- elements that share + // an index go together. + var zip = restArguments(unzip); - var render; - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. Passing by pairs is the reverse of `_.pairs`. + function object(list, values) { + var result = {}; + for (var i = 0, length = getLength(list); i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } } + return result; + } - var template = function(data) { - return render.call(this, data, _); - }; + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](https://docs.python.org/library/functions.html#range). + function range(start, stop, step) { + if (stop == null) { + stop = start || 0; + start = 0; + } + if (!step) { + step = stop < start ? -1 : 1; + } - // Provide the compiled source as a convenience for precompilation. - var argument = settings.variable || 'obj'; - template.source = 'function(' + argument + '){\n' + source + '}'; + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); - return template; - } + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; + } - // Add a "chain" function. Start chaining a wrapped Underscore object. - function chain(obj) { - var instance = _(obj); - instance._chain = true; - return instance; + return range; } - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. + // Chunk a single array into multiple arrays, each containing `count` or fewer + // items. + function chunk(array, count) { + if (count == null || count < 1) return []; + var result = []; + var i = 0, length = array.length; + while (i < length) { + result.push(slice.call(array, i, i += count)); + } + return result; + } // Helper function to continue chaining intermediate results. function chainResult(instance, obj) { @@ -1688,7 +1732,7 @@ return _; } - // Add all mutator Array functions to the wrapper. + // Add all mutator `Array` functions to the wrapper. each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { @@ -1703,7 +1747,7 @@ }; }); - // Add all accessor Array functions to the wrapper. + // Add all accessor `Array` functions to the wrapper. each(['concat', 'join', 'slice'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { @@ -1718,7 +1762,7 @@ return this._wrapped; }; - // Provide unwrapping proxy for some methods used in engine operations + // Provide unwrapping proxies for some methods used in engine operations // such as arithmetic and JSON stringification. _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; @@ -1726,11 +1770,95 @@ return String(this._wrapped); }; - var allExports = ({ - 'default': _, + // Named Exports + + var allExports = { + __proto__: null, VERSION: VERSION, - iteratee: iteratee, restArguments: restArguments, + isObject: isObject, + isNull: isNull, + isUndefined: isUndefined, + isBoolean: isBoolean, + isElement: isElement, + isString: isString, + isNumber: isNumber, + isDate: isDate, + isRegExp: isRegExp, + isError: isError, + isSymbol: isSymbol, + isMap: isMap, + isWeakMap: isWeakMap, + isSet: isSet, + isWeakSet: isWeakSet, + isArrayBuffer: isArrayBuffer, + isDataView: isDataView, + isArray: isArray, + isFunction: isFunction$1, + isArguments: isArguments$1, + isFinite: isFinite$1, + isNaN: isNaN$1, + isTypedArray: isTypedArray$1, + isEmpty: isEmpty, + isMatch: isMatch, + isEqual: isEqual, + keys: keys, + allKeys: allKeys, + values: values, + pairs: pairs, + invert: invert, + functions: functions, + methods: functions, + extend: extend, + extendOwn: extendOwn, + assign: extendOwn, + defaults: defaults, + create: create, + clone: clone, + tap: tap, + has: has$1, + mapObject: mapObject, + identity: identity, + constant: constant, + noop: noop, + property: property, + propertyOf: propertyOf, + matcher: matcher, + matches: matcher, + times: times, + random: random, + now: now, + escape: _escape, + unescape: _unescape, + templateSettings: templateSettings, + template: template, + result: result, + uniqueId: uniqueId, + chain: chain, + iteratee: iteratee, + partial: partial, + bind: bind, + bindAll: bindAll, + memoize: memoize, + delay: delay, + defer: defer, + throttle: throttle, + debounce: debounce, + wrap: wrap, + negate: negate, + compose: compose, + after: after, + before: before, + once: once, + findKey: findKey, + findIndex: findIndex, + findLastIndex: findLastIndex, + sortedIndex: sortedIndex, + indexOf: indexOf, + lastIndexOf: lastIndexOf, + find: find, + detect: find, + findWhere: findWhere, each: each, forEach: each, map: map, @@ -1740,8 +1868,6 @@ inject: reduce, reduceRight: reduceRight, foldr: reduceRight, - find: find, - detect: find, filter: filter, select: filter, reject: reject, @@ -1755,7 +1881,6 @@ invoke: invoke, pluck: pluck, where: where, - findWhere: findWhere, max: max, min: min, shuffle: shuffle, @@ -1764,9 +1889,11 @@ groupBy: groupBy, indexBy: indexBy, countBy: countBy, + partition: partition, toArray: toArray, size: size, - partition: partition, + pick: pick, + omit: omit, first: first, head: first, take: first, @@ -1776,7 +1903,7 @@ tail: rest, drop: rest, compact: compact, - flatten: flatten, + flatten: flatten$1, without: without, uniq: uniq, unique: uniq, @@ -1786,95 +1913,17 @@ unzip: unzip, zip: zip, object: object, - findIndex: findIndex, - findLastIndex: findLastIndex, - sortedIndex: sortedIndex, - indexOf: indexOf, - lastIndexOf: lastIndexOf, range: range, chunk: chunk, - bind: bind, - partial: partial, - bindAll: bindAll, - memoize: memoize, - delay: delay, - defer: defer, - throttle: throttle, - debounce: debounce, - wrap: wrap, - negate: negate, - compose: compose, - after: after, - before: before, - once: once, - keys: keys, - allKeys: allKeys, - values: values, - mapObject: mapObject, - pairs: pairs, - invert: invert, - functions: functions, - methods: functions, - extend: extend, - extendOwn: extendOwn, - assign: extendOwn, - findKey: findKey, - pick: pick, - omit: omit, - defaults: defaults, - create: create, - clone: clone, - tap: tap, - isMatch: isMatch, - isEqual: isEqual, - isEmpty: isEmpty, - isElement: isElement, - isArray: isArray, - isObject: isObject, - isArguments: isArguments, - isFunction: isFunction, - isString: isString, - isNumber: isNumber, - isDate: isDate, - isRegExp: isRegExp, - isError: isError, - isSymbol: isSymbol, - isMap: isMap, - isWeakMap: isWeakMap, - isSet: isSet, - isWeakSet: isWeakSet, - isArrayBuffer: isArrayBuffer, - isDataView: isDataView, - isFinite: isFinite, - isNaN: isNaN, - isBoolean: isBoolean, - isNull: isNull, - isUndefined: isUndefined, - isTypedArray: isTypedArray, - has: has, - identity: identity, - constant: constant, - noop: noop, - property: property, - propertyOf: propertyOf, - matcher: matcher, - matches: matcher, - times: times, - random: random, - now: now, - escape: escape, - unescape: unescape, - result: result, - uniqueId: uniqueId, - templateSettings: templateSettings, - template: template, - chain: chain, - mixin: mixin - }); + mixin: mixin, + 'default': _ + }; + + // Default Export // Add all of the Underscore functions to the wrapper object. var _$1 = mixin(allExports); - // Legacy Node.js API + // Legacy Node.js API. _$1._ = _$1; return _$1; diff --git a/underscore.js.map b/underscore.js.map index 0d48ef83c..87289311d 100644 --- a/underscore.js.map +++ b/underscore.js.map @@ -1 +1 @@ -{"version":3,"file":"underscore.js","sources":["modules/index.js","modules/index-default.js"],"sourcesContent":["// Underscore.js 1.10.2\n// https://underscorejs.org\n// (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n// Underscore may be freely distributed under the MIT license.\n\n// Baseline setup\n// --------------\n\n// Establish the root object, `window` (`self`) in the browser, `global`\n// on the server, or `this` in some virtual machines. We use `self`\n// instead of `window` for `WebWorker` support.\nvar root = typeof self == 'object' && self.self === self && self ||\n typeof global == 'object' && global.global === global && global ||\n Function('return this')() ||\n {};\n\n// Save bytes in the minified (but not gzipped) version:\nvar ArrayProto = Array.prototype, ObjProto = Object.prototype;\nvar SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;\n\n// Create quick reference variables for speed access to core prototypes.\nvar push = ArrayProto.push,\n slice = ArrayProto.slice,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n// Modern feature detection.\nvar supportsArrayBuffer = typeof ArrayBuffer !== 'undefined';\n\n// All **ECMAScript 5+** native function implementations that we hope to use\n// are declared here.\nvar nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeCreate = Object.create,\n nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;\n\n// Create references to these builtin functions because we override them.\nvar _isNaN = root.isNaN,\n _isFinite = root.isFinite;\n\n// Naked function reference for surrogate-prototype-swapping.\nvar Ctor = function(){};\n\n// The Underscore object. All exported functions below are added to it in the\n// modules/index-all.js using the mixin function.\nexport default function _(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n}\n\n// Current version.\nexport var VERSION = _.VERSION = '1.10.2';\n\n// Internal function that returns an efficient (for current engines) version\n// of the passed-in callback, to be repeatedly applied in other Underscore\n// functions.\nfunction optimizeCb(func, context, argCount) {\n if (context === void 0) return func;\n switch (argCount == null ? 3 : argCount) {\n case 1: return function(value) {\n return func.call(context, value);\n };\n // The 2-argument case is omitted because we’re not using it.\n case 3: return function(value, index, collection) {\n return func.call(context, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(context, accumulator, value, index, collection);\n };\n }\n return function() {\n return func.apply(context, arguments);\n };\n}\n\n// An internal function to generate callbacks that can be applied to each\n// element in a collection, returning the desired result — either `identity`,\n// an arbitrary callback, a property matcher, or a property accessor.\nfunction baseIteratee(value, context, argCount) {\n if (value == null) return identity;\n if (isFunction(value)) return optimizeCb(value, context, argCount);\n if (isObject(value) && !isArray(value)) return matcher(value);\n return property(value);\n}\n\n// External wrapper for our callback generator. Users may customize\n// `_.iteratee` if they want additional predicate/iteratee shorthand styles.\n// This abstraction hides the internal-only argCount argument.\n_.iteratee = iteratee;\nexport function iteratee(value, context) {\n return baseIteratee(value, context, Infinity);\n}\n\n// The function we actually call internally. It invokes _.iteratee if\n// overridden, otherwise baseIteratee.\nfunction cb(value, context, argCount) {\n if (_.iteratee !== iteratee) return _.iteratee(value, context);\n return baseIteratee(value, context, argCount);\n}\n\n// Some functions take a variable number of arguments, or a few expected\n// arguments at the beginning and then a variable number of values to operate\n// on. This helper accumulates all remaining arguments past the function’s\n// argument length (or an explicit `startIndex`), into an array that becomes\n// the last argument. Similar to ES6’s \"rest parameter\".\nexport function restArguments(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0),\n rest = Array(length),\n index = 0;\n for (; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n case 2: return func.call(this, arguments[0], arguments[1], rest);\n }\n var args = Array(startIndex + 1);\n for (index = 0; index < startIndex; index++) {\n args[index] = arguments[index];\n }\n args[startIndex] = rest;\n return func.apply(this, args);\n };\n}\n\n// An internal function for creating a new object that inherits from another.\nfunction baseCreate(prototype) {\n if (!isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}\n\nfunction shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n}\n\nfunction _has(obj, path) {\n return obj != null && hasOwnProperty.call(obj, path);\n}\n\nfunction deepGet(obj, path) {\n var length = path.length;\n for (var i = 0; i < length; i++) {\n if (obj == null) return void 0;\n obj = obj[path[i]];\n }\n return length ? obj : void 0;\n}\n\n// Common logic for isArrayLike and isBufferLike.\nvar MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\nfunction createSizePropertyCheck(getSizeProperty) {\n return function(collection) {\n var sizeProperty = getSizeProperty(collection);\n return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;\n }\n}\n\n// Helper for collection methods to determine whether a collection\n// should be iterated as an array or as an object.\n// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\nvar getLength = shallowProperty('length');\nvar isArrayLike = createSizePropertyCheck(getLength);\n\n// Likewise to determine whether we should spend extensive checks against\n// `ArrayBuffer` et al.\nvar getByteLength = shallowProperty('byteLength');\nvar isBufferLike = createSizePropertyCheck(getByteLength);\n\n// Collection Functions\n// --------------------\n\n// The cornerstone, an `each` implementation, aka `forEach`.\n// Handles raw objects in addition to array-likes. Treats all\n// sparse array-likes as if they were dense.\nexport function each(obj, iteratee, context) {\n iteratee = optimizeCb(iteratee, context);\n var i, length;\n if (isArrayLike(obj)) {\n for (i = 0, length = obj.length; i < length; i++) {\n iteratee(obj[i], i, obj);\n }\n } else {\n var _keys = keys(obj);\n for (i = 0, length = _keys.length; i < length; i++) {\n iteratee(obj[_keys[i]], _keys[i], obj);\n }\n }\n return obj;\n}\nexport { each as forEach };\n\n// Return the results of applying the iteratee to each element.\nexport function map(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n results = Array(length);\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n results[index] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\nexport { map as collect };\n\n// Create a reducing function iterating left or right.\nfunction createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n}\n\n// **Reduce** builds up a single result from a list of values, aka `inject`,\n// or `foldl`.\nexport var reduce = createReduce(1);\nexport { reduce as foldl, reduce as inject };\n\n// The right-associative version of reduce, also known as `foldr`.\nexport var reduceRight = createReduce(-1);\nexport { reduceRight as foldr };\n\n// Return the first value which passes a truth test.\nexport function find(obj, predicate, context) {\n var keyFinder = isArrayLike(obj) ? findIndex : findKey;\n var key = keyFinder(obj, predicate, context);\n if (key !== void 0 && key !== -1) return obj[key];\n}\nexport { find as detect };\n\n// Return all the elements that pass a truth test.\nexport function filter(obj, predicate, context) {\n var results = [];\n predicate = cb(predicate, context);\n each(obj, function(value, index, list) {\n if (predicate(value, index, list)) results.push(value);\n });\n return results;\n}\nexport { filter as select };\n\n// Return all the elements for which a truth test fails.\nexport function reject(obj, predicate, context) {\n return filter(obj, negate(cb(predicate)), context);\n}\n\n// Determine whether all of the elements match a truth test.\nexport function every(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (!predicate(obj[currentKey], currentKey, obj)) return false;\n }\n return true;\n}\nexport { every as all };\n\n// Determine if at least one element in the object matches a truth test.\nexport function some(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (predicate(obj[currentKey], currentKey, obj)) return true;\n }\n return false;\n}\nexport { some as any };\n\n// Determine if the array or object contains a given item (using `===`).\nexport function contains(obj, item, fromIndex, guard) {\n if (!isArrayLike(obj)) obj = values(obj);\n if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n return indexOf(obj, item, fromIndex) >= 0;\n}\nexport { contains as includes, contains as include };\n\n// Invoke a method (with arguments) on every item in a collection.\nexport var invoke = restArguments(function(obj, path, args) {\n var contextPath, func;\n if (isFunction(path)) {\n func = path;\n } else if (isArray(path)) {\n contextPath = path.slice(0, -1);\n path = path[path.length - 1];\n }\n return map(obj, function(context) {\n var method = func;\n if (!method) {\n if (contextPath && contextPath.length) {\n context = deepGet(context, contextPath);\n }\n if (context == null) return void 0;\n method = context[path];\n }\n return method == null ? method : method.apply(context, args);\n });\n});\n\n// Convenience version of a common use case of `map`: fetching a property.\nexport function pluck(obj, key) {\n return map(obj, property(key));\n}\n\n// Convenience version of a common use case of `filter`: selecting only objects\n// containing specific `key:value` pairs.\nexport function where(obj, attrs) {\n return filter(obj, matcher(attrs));\n}\n\n// Convenience version of a common use case of `find`: getting the first object\n// containing specific `key:value` pairs.\nexport function findWhere(obj, attrs) {\n return find(obj, matcher(attrs));\n}\n\n// Return the maximum element (or element-based computation).\nexport function max(obj, iteratee, context) {\n var result = -Infinity, lastComputed = -Infinity,\n value, computed;\n if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n obj = isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value > result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n\n// Return the minimum element (or element-based computation).\nexport function min(obj, iteratee, context) {\n var result = Infinity, lastComputed = Infinity,\n value, computed;\n if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n obj = isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value < result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed < lastComputed || computed === Infinity && result === Infinity) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n\n// Shuffle a collection.\nexport function shuffle(obj) {\n return sample(obj, Infinity);\n}\n\n// Sample **n** random values from a collection using the modern version of the\n// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n// If **n** is not specified, returns a single random element.\n// The internal `guard` argument allows it to work with `map`.\nexport function sample(obj, n, guard) {\n if (n == null || guard) {\n if (!isArrayLike(obj)) obj = values(obj);\n return obj[random(obj.length - 1)];\n }\n var sample = isArrayLike(obj) ? clone(obj) : values(obj);\n var length = getLength(sample);\n n = Math.max(Math.min(n, length), 0);\n var last = length - 1;\n for (var index = 0; index < n; index++) {\n var rand = random(index, last);\n var temp = sample[index];\n sample[index] = sample[rand];\n sample[rand] = temp;\n }\n return sample.slice(0, n);\n}\n\n// Sort the object's values by a criterion produced by an iteratee.\nexport function sortBy(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return pluck(map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n}\n\n// An internal function used for aggregate \"group by\" operations.\nfunction group(behavior, partition) {\n return function(obj, iteratee, context) {\n var result = partition ? [[], []] : {};\n iteratee = cb(iteratee, context);\n each(obj, function(value, index) {\n var key = iteratee(value, index, obj);\n behavior(result, value, key);\n });\n return result;\n };\n}\n\n// Groups the object's values by a criterion. Pass either a string attribute\n// to group by, or a function that returns the criterion.\nexport var groupBy = group(function(result, value, key) {\n if (_has(result, key)) result[key].push(value); else result[key] = [value];\n});\n\n// Indexes the object's values by a criterion, similar to `groupBy`, but for\n// when you know that your index values will be unique.\nexport var indexBy = group(function(result, value, key) {\n result[key] = value;\n});\n\n// Counts instances of an object that group by a certain criterion. Pass\n// either a string attribute to count by, or a function that returns the\n// criterion.\nexport var countBy = group(function(result, value, key) {\n if (_has(result, key)) result[key]++; else result[key] = 1;\n});\n\nvar reStrSymbol = /[^\\ud800-\\udfff]|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff]/g;\n// Safely create a real, live array from anything iterable.\nexport function toArray(obj) {\n if (!obj) return [];\n if (isArray(obj)) return slice.call(obj);\n if (isString(obj)) {\n // Keep surrogate pair characters together\n return obj.match(reStrSymbol);\n }\n if (isArrayLike(obj)) return map(obj, identity);\n return values(obj);\n}\n\n// Return the number of elements in an object.\nexport function size(obj) {\n if (obj == null) return 0;\n return isArrayLike(obj) ? obj.length : keys(obj).length;\n}\n\n// Split a collection into two arrays: one whose elements all satisfy the given\n// predicate, and one whose elements all do not satisfy the predicate.\nexport var partition = group(function(result, value, pass) {\n result[pass ? 0 : 1].push(value);\n}, true);\n\n// Array Functions\n// ---------------\n\n// Get the first element of an array. Passing **n** will return the first N\n// values in the array. The **guard** check allows it to work with `map`.\nexport function first(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[0];\n return initial(array, array.length - n);\n}\nexport { first as head, first as take };\n\n// Returns everything but the last entry of the array. Especially useful on\n// the arguments object. Passing **n** will return all the values in\n// the array, excluding the last N.\nexport function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n}\n\n// Get the last element of an array. Passing **n** will return the last N\n// values in the array.\nexport function last(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[array.length - 1];\n return rest(array, Math.max(0, array.length - n));\n}\n\n// Returns everything but the first entry of the array. Especially useful on\n// the arguments object. Passing an **n** will return the rest N values in the\n// array.\nexport function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}\nexport { rest as tail, rest as drop };\n\n// Trim out all falsy values from an array.\nexport function compact(array) {\n return filter(array, Boolean);\n}\n\n// Internal implementation of a recursive `flatten` function.\nfunction _flatten(input, shallow, strict, output) {\n output = output || [];\n var idx = output.length;\n for (var i = 0, length = getLength(input); i < length; i++) {\n var value = input[i];\n if (isArrayLike(value) && (isArray(value) || isArguments(value))) {\n // Flatten current level of array or arguments object.\n if (shallow) {\n var j = 0, len = value.length;\n while (j < len) output[idx++] = value[j++];\n } else {\n _flatten(value, shallow, strict, output);\n idx = output.length;\n }\n } else if (!strict) {\n output[idx++] = value;\n }\n }\n return output;\n}\n\n// Flatten out an array, either recursively (by default), or just one level.\nexport function flatten(array, shallow) {\n return _flatten(array, shallow, false);\n}\n\n// Return a version of the array that does not contain the specified value(s).\nexport var without = restArguments(function(array, otherArrays) {\n return difference(array, otherArrays);\n});\n\n// Produce a duplicate-free version of the array. If the array has already\n// been sorted, you have the option of using a faster algorithm.\n// The faster algorithm will not work with an iteratee if the iteratee\n// is not a one-to-one function, so providing an iteratee will disable\n// the faster algorithm.\nexport function uniq(array, isSorted, iteratee, context) {\n if (!isBoolean(isSorted)) {\n context = iteratee;\n iteratee = isSorted;\n isSorted = false;\n }\n if (iteratee != null) iteratee = cb(iteratee, context);\n var result = [];\n var seen = [];\n for (var i = 0, length = getLength(array); i < length; i++) {\n var value = array[i],\n computed = iteratee ? iteratee(value, i, array) : value;\n if (isSorted && !iteratee) {\n if (!i || seen !== computed) result.push(value);\n seen = computed;\n } else if (iteratee) {\n if (!contains(seen, computed)) {\n seen.push(computed);\n result.push(value);\n }\n } else if (!contains(result, value)) {\n result.push(value);\n }\n }\n return result;\n}\nexport { uniq as unique };\n\n// Produce an array that contains the union: each distinct element from all of\n// the passed-in arrays.\nexport var union = restArguments(function(arrays) {\n return uniq(_flatten(arrays, true, true));\n});\n\n// Produce an array that contains every item shared between all the\n// passed-in arrays.\nexport function intersection(array) {\n var result = [];\n var argsLength = arguments.length;\n for (var i = 0, length = getLength(array); i < length; i++) {\n var item = array[i];\n if (contains(result, item)) continue;\n var j;\n for (j = 1; j < argsLength; j++) {\n if (!contains(arguments[j], item)) break;\n }\n if (j === argsLength) result.push(item);\n }\n return result;\n}\n\n// Take the difference between one array and a number of other arrays.\n// Only the elements present in just the first array will remain.\nexport var difference = restArguments(function(array, rest) {\n rest = _flatten(rest, true, true);\n return filter(array, function(value){\n return !contains(rest, value);\n });\n});\n\n// Complement of zip. Unzip accepts an array of arrays and groups\n// each array's elements on shared indices.\nexport function unzip(array) {\n var length = array && max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n}\n\n// Zip together multiple lists into a single array -- elements that share\n// an index go together.\nexport var zip = restArguments(unzip);\n\n// Converts lists into objects. Pass either a single array of `[key, value]`\n// pairs, or two parallel arrays of the same length -- one of keys, and one of\n// the corresponding values. Passing by pairs is the reverse of pairs.\nexport function object(list, values) {\n var result = {};\n for (var i = 0, length = getLength(list); i < length; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n}\n\n// Generator function to create the findIndex and findLastIndex functions.\nfunction createPredicateIndexFinder(dir) {\n return function(array, predicate, context) {\n predicate = cb(predicate, context);\n var length = getLength(array);\n var index = dir > 0 ? 0 : length - 1;\n for (; index >= 0 && index < length; index += dir) {\n if (predicate(array[index], index, array)) return index;\n }\n return -1;\n };\n}\n\n// Returns the first index on an array-like that passes a predicate test.\nexport var findIndex = createPredicateIndexFinder(1);\nexport var findLastIndex = createPredicateIndexFinder(-1);\n\n// Use a comparator function to figure out the smallest index at which\n// an object should be inserted so as to maintain order. Uses binary search.\nexport function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n}\n\n// Generator function to create the indexOf and lastIndexOf functions.\nfunction createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n}\n\n// Return the position of the first occurrence of an item in an array,\n// or -1 if the item is not included in the array.\n// If the array is large and already in sort order, pass `true`\n// for **isSorted** to use binary search.\nexport var indexOf = createIndexFinder(1, findIndex, sortedIndex);\nexport var lastIndexOf = createIndexFinder(-1, findLastIndex);\n\n// Generate an integer Array containing an arithmetic progression. A port of\n// the native Python `range()` function. See\n// [the Python documentation](https://docs.python.org/library/functions.html#range).\nexport function range(start, stop, step) {\n if (stop == null) {\n stop = start || 0;\n start = 0;\n }\n if (!step) {\n step = stop < start ? -1 : 1;\n }\n\n var length = Math.max(Math.ceil((stop - start) / step), 0);\n var range = Array(length);\n\n for (var idx = 0; idx < length; idx++, start += step) {\n range[idx] = start;\n }\n\n return range;\n}\n\n// Chunk a single array into multiple arrays, each containing `count` or fewer\n// items.\nexport function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n}\n\n// Function (ahem) Functions\n// ------------------\n\n// Determines whether to execute a function as a constructor\n// or a normal function with the provided arguments.\nfunction executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}\n\n// Create a function bound to a given object (assigning `this`, and arguments,\n// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if\n// available.\nexport var bind = restArguments(function(func, context, args) {\n if (!isFunction(func)) throw new TypeError('Bind must be called on a function');\n var bound = restArguments(function(callArgs) {\n return executeBound(func, bound, context, this, args.concat(callArgs));\n });\n return bound;\n});\n\n// Partially apply a function by creating a version that has had some of its\n// arguments pre-filled, without changing its dynamic `this` context. _ acts\n// as a placeholder by default, allowing any combination of arguments to be\n// pre-filled. Set `partial.placeholder` for a custom placeholder argument.\nexport var partial = restArguments(function(func, boundArgs) {\n var placeholder = partial.placeholder;\n var bound = function() {\n var position = 0, length = boundArgs.length;\n var args = Array(length);\n for (var i = 0; i < length; i++) {\n args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];\n }\n while (position < arguments.length) args.push(arguments[position++]);\n return executeBound(func, bound, this, this, args);\n };\n return bound;\n});\n\npartial.placeholder = _;\n\n// Bind a number of an object's methods to that object. Remaining arguments\n// are the method names to be bound. Useful for ensuring that all callbacks\n// defined on an object belong to it.\nexport var bindAll = restArguments(function(obj, _keys) {\n _keys = _flatten(_keys, false, false);\n var index = _keys.length;\n if (index < 1) throw new Error('bindAll must be passed function names');\n while (index--) {\n var key = _keys[index];\n obj[key] = bind(obj[key], obj);\n }\n return obj;\n});\n\n// Memoize an expensive function by storing its results.\nexport function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!_has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}\n\n// Delays a function for the given number of milliseconds, and then calls\n// it with the arguments supplied.\nexport var delay = restArguments(function(func, wait, args) {\n return setTimeout(function() {\n return func.apply(null, args);\n }, wait);\n});\n\n// Defers a function, scheduling it to run after the current call stack has\n// cleared.\nexport var defer = partial(delay, _, 1);\n\n// Returns a function, that, when invoked, will only be triggered at most once\n// during a given window of time. Normally, the throttled function will run\n// as much as it can, without ever going more than once per `wait` duration;\n// but if you'd like to disable the execution on the leading edge, pass\n// `{leading: false}`. To disable execution on the trailing edge, ditto.\nexport function throttle(func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options) options = {};\n\n var later = function() {\n previous = options.leading === false ? 0 : now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n\n var throttled = function() {\n var _now = now();\n if (!previous && options.leading === false) previous = _now;\n var remaining = wait - (_now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = _now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n\n throttled.cancel = function() {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n\n return throttled;\n}\n\n// Returns a function, that, as long as it continues to be invoked, will not\n// be triggered. The function will be called after it stops being called for\n// N milliseconds. If `immediate` is passed, trigger the function on the\n// leading edge, instead of the trailing.\nexport function debounce(func, wait, immediate) {\n var timeout, result;\n\n var later = function(context, args) {\n timeout = null;\n if (args) result = func.apply(context, args);\n };\n\n var debounced = restArguments(function(args) {\n if (timeout) clearTimeout(timeout);\n if (immediate) {\n var callNow = !timeout;\n timeout = setTimeout(later, wait);\n if (callNow) result = func.apply(this, args);\n } else {\n timeout = delay(later, wait, this, args);\n }\n\n return result;\n });\n\n debounced.cancel = function() {\n clearTimeout(timeout);\n timeout = null;\n };\n\n return debounced;\n}\n\n// Returns the first function passed as an argument to the second,\n// allowing you to adjust arguments, run code before and after, and\n// conditionally execute the original function.\nexport function wrap(func, wrapper) {\n return partial(wrapper, func);\n}\n\n// Returns a negated version of the passed-in predicate.\nexport function negate(predicate) {\n return function() {\n return !predicate.apply(this, arguments);\n };\n}\n\n// Returns a function that is the composition of a list of functions, each\n// consuming the return value of the function that follows.\nexport function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}\n\n// Returns a function that will only be executed on and after the Nth call.\nexport function after(times, func) {\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n}\n\n// Returns a function that will only be executed up to (but not including) the Nth call.\nexport function before(times, func) {\n var memo;\n return function() {\n if (--times > 0) {\n memo = func.apply(this, arguments);\n }\n if (times <= 1) func = null;\n return memo;\n };\n}\n\n// Returns a function that will be executed at most one time, no matter how\n// often you call it. Useful for lazy initialization.\nexport var once = partial(before, 2);\n\n// Object Functions\n// ----------------\n\n// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\nvar hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\nvar nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\nfunction collectNonEnumProps(obj, _keys) {\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (_has(obj, prop) && !contains(_keys, prop)) _keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !contains(_keys, prop)) {\n _keys.push(prop);\n }\n }\n}\n\n// Retrieve the names of an object's own properties.\n// Delegates to **ECMAScript 5**'s native `Object.keys`.\nexport function keys(obj) {\n if (!isObject(obj)) return [];\n if (nativeKeys) return nativeKeys(obj);\n var _keys = [];\n for (var key in obj) if (_has(obj, key)) _keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, _keys);\n return _keys;\n}\n\n// Retrieve all the property names of an object.\nexport function allKeys(obj) {\n if (!isObject(obj)) return [];\n var _keys = [];\n for (var key in obj) _keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, _keys);\n return _keys;\n}\n\n// Retrieve the values of an object's properties.\nexport function values(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var values = Array(length);\n for (var i = 0; i < length; i++) {\n values[i] = obj[_keys[i]];\n }\n return values;\n}\n\n// Returns the results of applying the iteratee to each element of the object.\n// In contrast to map it returns an object.\nexport function mapObject(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = keys(obj),\n length = _keys.length,\n results = {};\n for (var index = 0; index < length; index++) {\n var currentKey = _keys[index];\n results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n\n// Convert an object into a list of `[key, value]` pairs.\n// The opposite of object.\nexport function pairs(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var pairs = Array(length);\n for (var i = 0; i < length; i++) {\n pairs[i] = [_keys[i], obj[_keys[i]]];\n }\n return pairs;\n}\n\n// Invert the keys and values of an object. The values must be serializable.\nexport function invert(obj) {\n var result = {};\n var _keys = keys(obj);\n for (var i = 0, length = _keys.length; i < length; i++) {\n result[obj[_keys[i]]] = _keys[i];\n }\n return result;\n}\n\n// Return a sorted list of the function names available on the object.\nexport function functions(obj) {\n var names = [];\n for (var key in obj) {\n if (isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n}\nexport { functions as methods };\n\n// An internal function for creating assigner functions.\nfunction createAssigner(keysFunc, defaults) {\n return function(obj) {\n var length = arguments.length;\n if (defaults) obj = Object(obj);\n if (length < 2 || obj == null) return obj;\n for (var index = 1; index < length; index++) {\n var source = arguments[index],\n _keys = keysFunc(source),\n l = _keys.length;\n for (var i = 0; i < l; i++) {\n var key = _keys[i];\n if (!defaults || obj[key] === void 0) obj[key] = source[key];\n }\n }\n return obj;\n };\n}\n\n// Extend a given object with all the properties in passed-in object(s).\nexport var extend = createAssigner(allKeys);\n\n// Assigns a given object with all the own properties in the passed-in object(s).\n// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\nexport var extendOwn = createAssigner(keys);\nexport { extendOwn as assign };\n\n// Returns the first key on an object that passes a predicate test.\nexport function findKey(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = keys(obj), key;\n for (var i = 0, length = _keys.length; i < length; i++) {\n key = _keys[i];\n if (predicate(obj[key], key, obj)) return key;\n }\n}\n\n// Internal pick helper function to determine if `obj` has key `key`.\nfunction keyInObj(value, key, obj) {\n return key in obj;\n}\n\n// Return a copy of the object only containing the whitelisted properties.\nexport var pick = restArguments(function(obj, _keys) {\n var result = {}, iteratee = _keys[0];\n if (obj == null) return result;\n if (isFunction(iteratee)) {\n if (_keys.length > 1) iteratee = optimizeCb(iteratee, _keys[1]);\n _keys = allKeys(obj);\n } else {\n iteratee = keyInObj;\n _keys = _flatten(_keys, false, false);\n obj = Object(obj);\n }\n for (var i = 0, length = _keys.length; i < length; i++) {\n var key = _keys[i];\n var value = obj[key];\n if (iteratee(value, key, obj)) result[key] = value;\n }\n return result;\n});\n\n// Return a copy of the object without the blacklisted properties.\nexport var omit = restArguments(function(obj, _keys) {\n var iteratee = _keys[0], context;\n if (isFunction(iteratee)) {\n iteratee = negate(iteratee);\n if (_keys.length > 1) context = _keys[1];\n } else {\n _keys = map(_flatten(_keys, false, false), String);\n iteratee = function(value, key) {\n return !contains(_keys, key);\n };\n }\n return pick(obj, iteratee, context);\n});\n\n// Fill in a given object with default properties.\nexport var defaults = createAssigner(allKeys, true);\n\n// Creates an object that inherits from the given prototype object.\n// If additional properties are provided then they will be added to the\n// created object.\nexport function create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n}\n\n// Create a (shallow-cloned) duplicate of an object.\nexport function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n}\n\n// Invokes interceptor with the obj, and then returns obj.\n// The primary purpose of this method is to \"tap into\" a method chain, in\n// order to perform operations on intermediate results within the chain.\nexport function tap(obj, interceptor) {\n interceptor(obj);\n return obj;\n}\n\n// Returns whether an object has a given set of `key:value` pairs.\nexport function isMatch(object, attrs) {\n var _keys = keys(attrs), length = _keys.length;\n if (object == null) return !length;\n var obj = Object(object);\n for (var i = 0; i < length; i++) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) return false;\n }\n return true;\n}\n\n\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b;\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) return false;\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) return b !== b;\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;\n return deepEq(a, b, aStack, bStack);\n}\n\n// Internal recursive comparison function for `isEqual`.\nfunction deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n // Coerce to `DataView` so we can fall through to the next case.\n return deepEq(new DataView(a), new DataView(b), aStack, bStack);\n case '[object DataView]':\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) {\n return false;\n }\n while (byteLength--) {\n if (a.getUint8(byteLength) !== b.getUint8(byteLength)) {\n return false;\n }\n }\n return true;\n }\n\n if (isTypedArray(a)) {\n // Coerce typed arrays to `DataView`.\n return deepEq(new DataView(a.buffer), new DataView(b.buffer), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&\n isFunction(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(_has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\n\n// Perform a deep comparison to check if two objects are equal.\nexport function isEqual(a, b) {\n return eq(a, b);\n}\n\n// Is a given array, string, or object empty?\n// An \"empty\" object has no enumerable own-properties.\nexport function isEmpty(obj) {\n if (obj == null) return true;\n // Skip the more expensive `toString`-based type checks if `obj` has no\n // `.length`.\n if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments(obj))) return obj.length === 0;\n return keys(obj).length === 0;\n}\n\n// Is a given value a DOM element?\nexport function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n}\n\n// Internal function for creating a toString-based type tester.\nfunction tagTester(name) {\n return function(obj) {\n return toString.call(obj) === '[object ' + name + ']';\n };\n}\n\n// Is a given value an array?\n// Delegates to ECMA5's native Array.isArray\nexport var isArray = nativeIsArray || tagTester('Array');\n\n// Is a given variable an object?\nexport function isObject(obj) {\n var type = typeof obj;\n return type === 'function' || type === 'object' && !!obj;\n}\n\n// Add some isType methods.\nexport var isArguments = tagTester('Arguments');\nexport var isFunction = tagTester('Function');\nexport var isString = tagTester('String');\nexport var isNumber = tagTester('Number');\nexport var isDate = tagTester('Date');\nexport var isRegExp = tagTester('RegExp');\nexport var isError = tagTester('Error');\nexport var isSymbol = tagTester('Symbol');\nexport var isMap = tagTester('Map');\nexport var isWeakMap = tagTester('WeakMap');\nexport var isSet = tagTester('Set');\nexport var isWeakSet = tagTester('WeakSet');\nexport var isArrayBuffer = tagTester('ArrayBuffer');\nexport var isDataView = tagTester('DataView');\n\n// Define a fallback version of the method in browsers (ahem, IE < 9), where\n// there isn't any inspectable \"Arguments\" type.\n(function() {\n if (!isArguments(arguments)) {\n isArguments = function(obj) {\n return _has(obj, 'callee');\n };\n }\n}());\n\n// Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,\n// IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).\nvar nodelist = root.document && root.document.childNodes;\nif (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {\n isFunction = function(obj) {\n return typeof obj == 'function' || false;\n };\n}\n\n// Is a given object a finite number?\nexport function isFinite(obj) {\n return !isSymbol(obj) && _isFinite(obj) && !_isNaN(parseFloat(obj));\n}\n\n// Is the given value `NaN`?\nexport function isNaN(obj) {\n return isNumber(obj) && _isNaN(obj);\n}\n\n// Is a given value a boolean?\nexport function isBoolean(obj) {\n return obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n}\n\n// Is a given value equal to null?\nexport function isNull(obj) {\n return obj === null;\n}\n\n// Is a given variable undefined?\nexport function isUndefined(obj) {\n return obj === void 0;\n}\n\n// Is a given value a typed array?\nvar typedArrayPattern = /\\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\\]/;\nexport var isTypedArray = supportsArrayBuffer ? function(obj) {\n // `ArrayBuffer.isView` is the most future-proof, so use it when available.\n // Otherwise, fall back on the above regular expression.\n return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) : isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));\n} : constant(false);\n\n// Shortcut function for checking if an object has a given property directly\n// on itself (in other words, not on a prototype).\nexport function has(obj, path) {\n if (!isArray(path)) {\n return _has(obj, path);\n }\n var length = path.length;\n for (var i = 0; i < length; i++) {\n var key = path[i];\n if (obj == null || !hasOwnProperty.call(obj, key)) {\n return false;\n }\n obj = obj[key];\n }\n return !!length;\n}\n\n// Utility Functions\n// -----------------\n\n// Keep the identity function around for default iteratees.\nexport function identity(value) {\n return value;\n}\n\n// Predicate-generating functions. Often useful outside of Underscore.\nexport function constant(value) {\n return function() {\n return value;\n };\n}\n\nexport function noop(){}\n\n// Creates a function that, when passed an object, will traverse that object’s\n// properties down the given `path`, specified as an array of keys or indexes.\nexport function property(path) {\n if (!isArray(path)) {\n return shallowProperty(path);\n }\n return function(obj) {\n return deepGet(obj, path);\n };\n}\n\n// Generates a function for a given object that returns a given property.\nexport function propertyOf(obj) {\n if (obj == null) {\n return function(){};\n }\n return function(path) {\n return !isArray(path) ? obj[path] : deepGet(obj, path);\n };\n}\n\n// Returns a predicate for checking whether an object has a given set of\n// `key:value` pairs.\nexport function matcher(attrs) {\n attrs = extendOwn({}, attrs);\n return function(obj) {\n return isMatch(obj, attrs);\n };\n}\nexport { matcher as matches };\n\n// Run a function **n** times.\nexport function times(n, iteratee, context) {\n var accum = Array(Math.max(0, n));\n iteratee = optimizeCb(iteratee, context, 1);\n for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n return accum;\n}\n\n// Return a random integer between min and max (inclusive).\nexport function random(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n}\n\n// A (possibly faster) way to get the current timestamp as an integer.\nexport var now = Date.now || function() {\n return new Date().getTime();\n};\n\n// List of HTML entities for escaping.\nvar escapeMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\nvar unescapeMap = invert(escapeMap);\n\n// Functions for escaping and unescaping strings to/from HTML interpolation.\nfunction createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n}\nexport var escape = createEscaper(escapeMap);\nexport var unescape = createEscaper(unescapeMap);\n\n// Traverses the children of `obj` along `path`. If a child is a function, it\n// is invoked with its parent as context. Returns the value of the final\n// child, or `fallback` if any child is undefined.\nexport function result(obj, path, fallback) {\n if (!isArray(path)) path = [path];\n var length = path.length;\n if (!length) {\n return isFunction(fallback) ? fallback.call(obj) : fallback;\n }\n for (var i = 0; i < length; i++) {\n var prop = obj == null ? void 0 : obj[path[i]];\n if (prop === void 0) {\n prop = fallback;\n i = length; // Ensure we don't continue iterating.\n }\n obj = isFunction(prop) ? prop.call(obj) : prop;\n }\n return obj;\n}\n\n// Generate a unique integer id (unique within the entire client session).\n// Useful for temporary DOM ids.\nvar idCounter = 0;\nexport function uniqueId(prefix) {\n var id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n\n// By default, Underscore uses ERB-style template delimiters, change the\n// following template settings to use alternative delimiters.\nexport var templateSettings = _.templateSettings = {\n evaluate: /<%([\\s\\S]+?)%>/g,\n interpolate: /<%=([\\s\\S]+?)%>/g,\n escape: /<%-([\\s\\S]+?)%>/g\n};\n\n// When customizing `templateSettings`, if you don't want to define an\n// interpolation, evaluation or escaping regex, we need one that is\n// guaranteed not to match.\nvar noMatch = /(.)^/;\n\n// Certain characters need to be escaped so that they can be put into a\n// string literal.\nvar escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n};\n\nvar escapeRegExp = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\nvar escapeChar = function(match) {\n return '\\\\' + escapes[match];\n};\n\n// JavaScript micro-templating, similar to John Resig's implementation.\n// Underscore templating handles arbitrary delimiters, preserves whitespace,\n// and correctly escapes quotes within interpolated code.\n// NB: `oldSettings` only exists for backwards compatibility.\nexport function template(text, settings, oldSettings) {\n if (!settings && oldSettings) settings = oldSettings;\n settings = defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset).replace(escapeRegExp, escapeChar);\n index = offset + match.length;\n\n if (escape) {\n source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n } else if (interpolate) {\n source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n } else if (evaluate) {\n source += \"';\\n\" + evaluate + \"\\n__p+='\";\n }\n\n // Adobe VMs need the match returned to produce the correct offset.\n return match;\n });\n source += \"';\\n\";\n\n // If a variable is not specified, place data values in local scope.\n if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + 'return __p;\\n';\n\n var render;\n try {\n render = new Function(settings.variable || 'obj', '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled source as a convenience for precompilation.\n var argument = settings.variable || 'obj';\n template.source = 'function(' + argument + '){\\n' + source + '}';\n\n return template;\n}\n\n// Add a \"chain\" function. Start chaining a wrapped Underscore object.\nexport function chain(obj) {\n var instance = _(obj);\n instance._chain = true;\n return instance;\n}\n\n// OOP\n// ---------------\n// If Underscore is called as a function, it returns a wrapped object that\n// can be used OO-style. This wrapper holds altered versions of all the\n// underscore functions. Wrapped objects may be chained.\n\n// Helper function to continue chaining intermediate results.\nfunction chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n}\n\n// Add your own custom functions to the Underscore object.\nexport function mixin(obj) {\n each(functions(obj), function(name) {\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return chainResult(this, func.apply(_, args));\n };\n });\n return _;\n}\n\n// Add all mutator Array functions to the wrapper.\neach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) {\n method.apply(obj, arguments);\n if ((name === 'shift' || name === 'splice') && obj.length === 0) {\n delete obj[0];\n }\n }\n return chainResult(this, obj);\n };\n});\n\n// Add all accessor Array functions to the wrapper.\neach(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) obj = method.apply(obj, arguments);\n return chainResult(this, obj);\n };\n});\n\n// Extracts the result from a wrapped and chained object.\n_.prototype.value = function() {\n return this._wrapped;\n};\n\n// Provide unwrapping proxy for some methods used in engine operations\n// such as arithmetic and JSON stringification.\n_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n_.prototype.toString = function() {\n return String(this._wrapped);\n};\n","import * as allExports from './index.js';\nimport { mixin } from './index.js';\n\n// Add all of the Underscore functions to the wrapper object.\nvar _ = mixin(allExports);\n// Legacy Node.js API\n_._ = _;\n// Export the Underscore API.\nexport default _;\n"],"names":["_"],"mappings":";;;;;;;;;;;EAAA;EACA;EACA;EACA;;EAEA;EACA;;EAEA;EACA;EACA;EACA,IAAI,IAAI,GAAG,OAAO,IAAI,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI;EAChE,UAAU,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,IAAI,MAAM;EACzE,UAAU,QAAQ,CAAC,aAAa,CAAC,EAAE;EACnC,UAAU,EAAE,CAAC;;EAEb;EACA,IAAI,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;EAC9D,IAAI,WAAW,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;;EAE1E;EACA,IAAI,IAAI,GAAG,UAAU,CAAC,IAAI;EAC1B,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK;EAC5B,IAAI,QAAQ,GAAG,QAAQ,CAAC,QAAQ;EAChC,IAAI,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;;EAE7C;EACA,IAAI,mBAAmB,GAAG,OAAO,WAAW,KAAK,WAAW,CAAC;;EAE7D;EACA;EACA,IAAI,aAAa,GAAG,KAAK,CAAC,OAAO;EACjC,IAAI,UAAU,GAAG,MAAM,CAAC,IAAI;EAC5B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guments.js","modules/isObject.js","modules/isNull.js","modules/isUndefined.js","modules/isBoolean.js","modules/isElement.js","modules/_tagTester.js","modules/isString.js","modules/isNumber.js","modules/isDate.js","modules/isRegExp.js","modules/isError.js","modules/isSymbol.js","modules/isMap.js","modules/isWeakMap.js","modules/isSet.js","modules/isWeakSet.js","modules/isArrayBuffer.js","modules/isDataView.js","modules/isArray.js","modules/isFunction.js","modules/_has.js","modules/isArguments.js","modules/isFinite.js","modules/isNaN.js","modules/constant.js","modules/_createSizePropertyCheck.js","modules/_shallowProperty.js","modules/_getByteLength.js","modules/_isBufferLike.js","modules/isTypedArray.js","modules/_getLength.js","modules/_isArrayLike.js","modules/_collectNonEnumProps.js","modules/keys.js","modules/isEmpty.js","modules/isMatch.js","modules/underscore.js","modules/isEqual.js","modules/allKeys.js","modules/values.js","modules/pairs.js","modules/invert.js","modules/functions.js","modules/_createAssigner.js","modules/extend.js","modules/extendOwn.js","modules/defaults.js","modules/_baseCreate.js","modules/create.js","modules/clone.js","modules/tap.js","modules/has.js","modules/identity.js","modules/matcher.js","modules/_deepGet.js","modules/property.js","modules/_optimizeCb.js","modules/_baseIteratee.js","modules/iteratee.js","modules/_cb.js","modules/mapObject.js","modules/noop.js","modules/propertyOf.js","modules/times.js","modules/random.js","modules/now.js","modules/_createEscaper.js","modules/_escapeMap.js","modules/escape.js","modules/_unescapeMap.js","modules/unescape.js","modules/templateSettings.js","modules/template.js","modules/result.js","modules/uniqueId.js","modules/chain.js","modules/_executeBound.js","modules/partial.js","modules/bind.js","modules/_flatten.js","modules/bindAll.js","modules/memoize.js","modules/delay.js","modules/defer.js","modules/throttle.js","modules/debounce.js","modules/wrap.js","modules/negate.js","modules/compose.js","modules/after.js","modules/before.js","modules/once.js","modules/findKey.js","modules/_createPredicateIndexFinder.js","modules/findIndex.js","modules/findLastIndex.js","modules/sortedIndex.js","modules/_createIndexFinder.js","modules/indexOf.js","modules/lastIndexOf.js","modules/find.js","modules/findWhere.js","modules/each.js","modules/map.js","modules/_createReduce.js","modules/reduce.js","modules/reduceRight.js","modules/filter.js","modules/reject.js","modules/every.js","modules/some.js","modules/contains.js","modules/invoke.js","modules/pluck.js","modules/where.js","modules/max.js","modules/min.js","modules/sample.js","modules/shuffle.js","modules/sortBy.js","modules/_group.js","modules/groupBy.js","modules/indexBy.js","modules/countBy.js","modules/partition.js","modules/toArray.js","modules/size.js","modules/_keyInObj.js","modules/pick.js","modules/omit.js","modules/initial.js","modules/first.js","modules/rest.js","modules/last.js","modules/compact.js","modules/flatten.js","modules/difference.js","modules/without.js","modules/uniq.js","modules/union.js","modules/intersection.js","modules/unzip.js","modules/zip.js","modules/object.js","modules/range.js","modules/chunk.js","modules/_chainResult.js","modules/mixin.js","modules/underscore-oop.js","modules/index.js","modules/index-default.js"],"sourcesContent":null,"names":["isFinite","isNaN","isFunction","isArguments","isTypedArray","has","_has","flatten","_flatten","_"],"mappings":";;;;;;;;;;;;;;EAAA;EACO,IAAI,OAAO,GAAG,QAAQ,CAAC;AAC9B;EACA;EACA;EACA;EACO,IAAI,IAAI,GAAG,OAAO,IAAI,IAAI,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI;EACvE,UAAU,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,IAAI,MAAM;EACzE,UAAU,QAAQ,CAAC,aAAa,CAAC,EAAE;EACnC,UAAU,EAAE,CAAC;AACb;EACA;EACO,IAAI,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;EAC9D,IAAI,WAAW,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;AACjF;EACA;EACO,IAAI,IAAI,GAAG,UAAU,CAAC,IAAI;EACjC,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK;EAC5B,IAAI,QAAQ,GAAG,QAAQ,CAAC,QAAQ;EAChC,IAAI,cAAc,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