• Creates a lodash object which wraps value to enable implicit method chain sequences. Methods that operate on and return arrays, collections, and functions can be chained together. Methods that retrieve a single value or may return a primitive value will automatically end the chain sequence and return the unwrapped value. Otherwise, the value must be unwrapped with value().

    Explicit chain sequences, which must be unwrapped with value(), may be enabled using _.chain.

    The execution of chained methods is lazy, that is, it's deferred until value() is implicitly or explicitly called.

    Lazy evaluation allows several methods to support shortcut fusion. Shortcut fusion is an optimization to merge iteratee calls; this avoids the creation of intermediate arrays and can greatly reduce the number of iteratee executions. Sections of a chain sequence qualify for shortcut fusion if the section is applied to an array and iteratees accept only one argument. The heuristic for whether a section qualifies for shortcut fusion is subject to change.

    Chaining is supported in custom builds as long as the value() method is directly or indirectly included in the build.

    In addition to lodash methods, wrappers have Array and String methods. The wrapper Array methods are: concat, join, pop, push, shift, sort, splice, and unshift. The wrapper String methods are: replace and split.

    The wrapper methods that support shortcut fusion are: at, compact, drop, dropRight, dropWhile, filter, find, findLast, head, initial, last, map, reject, reverse, slice, tail, take, takeRight, takeRightWhile, takeWhile, and toArray

    The chainable wrapper methods are: after, ary, assign, assignIn, assignInWith, assignWith, at, before, bind, bindAll, bindKey, castArray, chain, chunk, commit, compact, concat, conforms, constant, countBy, create, curry, debounce, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, extend, extendWith, fill, filter, flatMap, flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, flow, flowRight, fromPairs, functions, functionsIn, groupBy, initial, intersection, intersectionBy, intersectionWith, invert, invertBy, invokeMap, iteratee, keyBy, keys, keysIn, map, mapKeys, mapValues, matches, matchesProperty, memoize, merge, mergeWith, method, methodOf, mixin, negate, nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, partial, partialRight, partition, pick, pickBy, plant, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, push, range, rangeRight, rearg, reject, remove, rest, reverse, sampleSize, set, setWith, shuffle, slice, sort, sortBy, sortedUniq, sortedUniqBy, splice, spread, tail, take, takeRight, takeRightWhile, takeWhile, tap, throttle, thru, toArray, toPairs, toPairsIn, toPath, toPlainObject, transform, unary, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unset, unshift, unzip, unzipWith, update, updateWith, values, valuesIn, without, wrap, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, and zipWith.

    The wrapper methods that are not chainable by default are: add, attempt, camelCase, capitalize, ceil, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, conformsTo, deburr, defaultTo, divide, each, eachRight, endsWith, eq, escape, escapeRegExp, every, find, findIndex, findKey, findLast, findLastIndex, findLastKey, first, floor, forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, get, gt, gte, has, hasIn, head, identity, includes, indexOf, inRange, invoke, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isUndefined, isTypedArray, isWeakMap, isWeakSet, join, kebabCase, last, lastIndexOf, lowerCase, lowerFirst, lt, lte, max, maxBy, mean, meanBy, min, minBy, multiply, noConflict, noop, now, nth, pad, padEnd, padStart, parseInt, pop, random, reduce, reduceRight, repeat, result, round, runInContext, sample, shift, size, snakeCase, some, sortedIndex, sortedIndexBy, sortedLastIndex, sortedLastIndexBy, startCase, startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, template, times, toFinite, toInteger, toJSON, toLength, toLower, toNumber, toSafeInteger, toString, toUpper, trim, trimEnd, trimStart, truncate, unescape, uniqueId, upperCase, upperFirst, value, and words.

    Type Parameters

    • TrapAny extends {
          __trapAny: any;
      }

    Parameters

    Returns Collection<any> & Function<any> & Object<any> & Primitive<any> & String

  • Type Parameters

    • T extends undefined | null

    Parameters

    • value: T

    Returns Primitive<T>

  • Parameters

    • value: undefined | null | string

    Returns String

  • Type Parameters

    • T extends ((...args) => any)

    Parameters

    • value: T

    Returns Function<T>

  • Type Parameters

    • T = any

    Parameters

    • value: undefined | null | List<T>

    Returns Collection<T>

  • Type Parameters

    • T extends object

    Parameters

    • value: undefined | null | T

    Returns Object<T>

  • Type Parameters

    • T

    Parameters

    • value: T

    Returns Primitive<T>

Array

Collection

Function

Lang

Math

Number

Object

Other

VERSION bind bindKey condense condenseDeep curry curryRight each eachDeep eachRight exists filterDeep findDeep findPathDeep findValueDeep first forEachDeep index keysDeep mapDeep mapKeysDeep mapValuesDeep memoize omitDeep partial partialRight pathMatches pathToString paths pickDeep reduceDeep someDeep templateSettings add after ary at attempt before bindAll camelCase capitalize castArray ceil chain chunk clone cloneDeep cloneDeepWith cloneWith compact conforms conformsTo constant countBy create debounce deburr defaultTo defaults defaultsDeep defer delay difference differenceBy divide drop dropRight dropRightWhile dropWhile endsWith entries entriesIn escape escapeRegExp every extend extendWith fill filter find findIndex findKey findLast findLastIndex findLastKey flatMap flatten flattenDeep flattenDepth floor flow flowRight forEach forEachRight forIn forInRight forOwn forOwnRight get groupBy gt gte head identity inRange includes initial intersection invert invertBy invoke invokeMap isArguments isArray isArrayBuffer isBoolean isBuffer isDate isElement isEmpty isError isFinite isFunction isMap isNaN isNative isNull isNumber isObject isPlainObject isRegExp isSet isString isTypedArray isUndefined isWeakMap isWeakSet join kebabCase keyBy keys keysIn last lastIndexOf lowerCase lowerFirst lt lte map mapKeys mapValues matches matchesProperty method methodOf mixin multiply negate noConflict noop now nth nthArg once over overArgs overEvery overSome pad padEnd padStart parseInt partition property propertyOf pull pullAt random range rearg reduce reduceRight reject remove repeat replace rest result round runInContext sample sampleSize set setWith shuffle size slice snakeCase some split spread startCase startsWith stubArray stubFalse stubObject stubString stubTrue tail take takeRight takeRightWhile takeWhile tap template throttle thru times toArray toLower toPairs toPairsIn toPlainObject toUpper transform trim trimEnd trimStart truncate unescape union unionBy uniqueId unset unzip unzipWith update upperCase upperFirst values valuesIn without words wrap xor zip zipObject zipObjectDeep zipWith

Util

Array

  • Creates a new array concatenating array with any additional arrays and/or values.

    Type Parameters

    • T

    Parameters

    • Optional Rest ...values: Many<T>[]

      The array values to concatenate.

    Returns T[]

    Returns the new concatenated array.

    Example

    var array = [1];
    var other = _.concat(array, 2, [3], [[4]]);

    console.log(other);
    // => [1, 2, 3, [4]]

    console.log(array);
    // => [1]
  • This method is like _.difference except that it accepts comparator which is invoked to compare elements of array to values. The order and references of result values are determined by the first array. The comparator is invoked with two arguments: (arrVal, othVal).

    Type Parameters

    • T1
    • T2

    Parameters

    • array: undefined | null | List<T1>
    • Optional values: List<T2>

      The arrays to inspect.

    • Optional comparator: Comparator2<T1, T2>

      The comparator invoked per element.

    Returns T1[]

    Returns the new array of filtered values.

    Example

    var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];

    _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
    // => [{ 'x': 2, 'y': 1 }]
  • Type Parameters

    • T1
    • T2
    • T3

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • comparator: Comparator2<T1, T2 | T3>

    Returns T1[]

    See

    _.differenceWith

  • Type Parameters

    • T1
    • T2
    • T3
    • T4

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • Rest ...values: (List<T4> | Comparator2<T1, T2 | T3 | T4>)[]

    Returns T1[]

    See

    _.differenceWith

  • Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>
    • Rest ...values: List<T>[]

    Returns T[]

    See

    _.differenceWith

  • The inverse of _.toPairs; this method returns an object composed from key-value pairs.

    Type Parameters

    • T

    Parameters

    • pairs: undefined | null | List<[PropertyName, T]>

      The key-value pairs.

    Returns Dictionary<T>

    Returns the new object.

    Example

    _.fromPairs([['fred', 30], ['barney', 40]]);
    // => { 'fred': 30, 'barney': 40 }
  • Parameters

    • pairs: undefined | null | List<any[]>

    Returns Dictionary<any>

    See

    _.fromPairs

  • Gets the index at which the first occurrence of value is found in array using SameValueZero for equality comparisons. If fromIndex is negative, it's used as the offset from the end of array.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to search.

    • value: T

      The value to search for.

    • Optional fromIndex: number

      The index to search from.

    Returns number

    Returns the index of the matched value, else -1.

    Example

    _.indexOf([1, 2, 1, 2], 2);
    // => 1

    // using `fromIndex`
    _.indexOf([1, 2, 1, 2], 2, 2);
    // => 3
  • This method is like _.intersection except that it accepts iteratee which is invoked for each element of each arrays to generate the criterion by which uniqueness is computed. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T1
    • T2

    Parameters

    • array: null | List<T1>
    • values: List<T2>
    • Optional iteratee: ValueIteratee<T1 | T2>

      The iteratee invoked per element.

    Returns T1[]

    Returns the new array of shared values.

    Example

    _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
    // => [2.1]

    // using the `_.property` iteratee shorthand
    _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
    // => [{ 'x': 1 }]
  • Type Parameters

    • T1
    • T2
    • T3

    Parameters

    • array: null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • iteratee: ValueIteratee<T1 | T2 | T3>

    Returns T1[]

    See

    _.intersectionBy

  • Type Parameters

    • T1
    • T2
    • T3
    • T4

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • Rest ...values: (List<T4> | ValueIteratee<T1 | T2 | T3 | T4>)[]

    Returns T1[]

    See

    _.intersectionBy

  • Type Parameters

    • T

    Parameters

    • Optional array: null | List<T>
    • Rest ...values: List<T>[]

    Returns T[]

    See

    _.intersectionBy

  • Type Parameters

    • T

    Parameters

    • Rest ...values: (List<T> | ValueIteratee<T>)[]

    Returns T[]

    See

    _.intersectionBy

  • Creates an array of unique array values not included in the other provided arrays using SameValueZero for equality comparisons.

    Type Parameters

    • T1
    • T2

    Parameters

    • array: undefined | null | List<T1>
    • Optional values: List<T2>

      The arrays to inspect.

    • Optional comparator: Comparator2<T1, T2>

      The comparator invoked per element.

    Returns T1[]

    Returns the new array of filtered values.

    Example

    var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
    var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];

    _.intersectionWith(objects, others, _.isEqual);
    // => [{ 'x': 1, 'y': 2 }]
  • Type Parameters

    • T1
    • T2
    • T3

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • comparator: Comparator2<T1, T2 | T3>

    Returns T1[]

    See

    _.intersectionWith

  • Type Parameters

    • T1
    • T2
    • T3
    • T4

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • Rest ...values: (List<T4> | Comparator2<T1, T2 | T3 | T4>)[]

    Returns T1[]

    See

    _.intersectionWith

  • Type Parameters

    • T

    Parameters

    • Optional array: null | List<T>
    • Rest ...values: (List<T> | Comparator2<T, never>)[]

    Returns T[]

    See

    _.intersectionWith

  • This method is like _.pull except that it accepts an array of values to remove.

    Note: Unlike _.difference, this method mutates array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • Optional values: List<T>

      The values to remove.

    Returns T[]

    Returns array.

    Example

    var array = [1, 2, 3, 1, 2, 3];

    _.pull(array, [2, 3]);
    console.log(array);
    // => [1, 1]
  • Type Parameters

    • T

    Parameters

    • array: List<T>
    • Optional values: List<T>

    Returns List<T>

    See

    _.pullAll

  • This method is like _.pullAll except that it accepts iteratee which is invoked for each element of array and values to to generate the criterion by which uniqueness is computed. The iteratee is invoked with one argument: (value).

    Note: Unlike _.differenceBy, this method mutates array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • Optional values: List<T>

      The values to remove.

    • Optional iteratee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns T[]

    Returns array.

    Example

    var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];

    _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
    console.log(array);
    // => [{ 'x': 2 }]
  • Type Parameters

    • T

    Parameters

    • array: List<T>
    • Optional values: List<T>
    • Optional iteratee: ValueIteratee<T>

    Returns List<T>

    See

    _.pullAllBy

  • Type Parameters

    • T1
    • T2

    Parameters

    • array: T1[]
    • values: List<T2>
    • iteratee: ValueIteratee<T1 | T2>

    Returns T1[]

    See

    _.pullAllBy

  • Type Parameters

    • T1
    • T2

    Parameters

    • array: List<T1>
    • values: List<T2>
    • iteratee: ValueIteratee<T1 | T2>

    Returns List<T1>

    See

    _.pullAllBy

  • This method is like _.pullAll except that it accepts comparator which is invoked to compare elements of array to values. The comparator is invoked with two arguments: (arrVal, othVal).

    Note: Unlike _.differenceWith, this method mutates array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • Optional values: List<T>

      The values to remove.

    • Optional comparator: Comparator<T>

    Returns T[]

    Returns array.

    Example

    var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];

    _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
    console.log(array);
    // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  • Type Parameters

    • T

    Parameters

    • array: List<T>
    • Optional values: List<T>
    • Optional comparator: Comparator<T>

    Returns List<T>

    See

    _.pullAllWith

  • Type Parameters

    • T1
    • T2

    Parameters

    • array: T1[]
    • values: List<T2>
    • comparator: Comparator2<T1, T2>

    Returns T1[]

    See

    _.pullAllWith

  • Type Parameters

    • T1
    • T2

    Parameters

    • array: List<T1>
    • values: List<T2>
    • comparator: Comparator2<T1, T2>

    Returns List<T1>

    See

    _.pullAllWith

  • Reverses array so that the first element becomes the last, the second element becomes the second to last, and so on.

    Note: This method mutates array and is based on Array#reverse.

    Type Parameters

    • TList extends List<any>

    Parameters

    Returns TList

    Returns array.

    Example

    var array = [1, 2, 3];

    _.reverse(array);
    // => [3, 2, 1]

    console.log(array);
    // => [3, 2, 1]
  • Uses a binary search to determine the lowest index at which value should be inserted into array in order to maintain its sort order.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The sorted array to inspect.

    • value: T

      The value to evaluate.

    Returns number

    Returns the index at which value should be inserted into array.

    Example

    _.sortedIndex([30, 50], 40);
    // => 1

    _.sortedIndex([4, 5], 4);
    // => 0
  • Uses a binary search to determine the lowest index at which value should be inserted into array in order to maintain its sort order.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The sorted array to inspect.

    • value: T

      The value to evaluate.

    Returns number

    Returns the index at which value should be inserted into array.

    Example

    _.sortedIndex([30, 50], 40);
    // => 1

    _.sortedIndex([4, 5], 4);
    // => 0
  • This method is like _.sortedIndex except that it accepts iteratee which is invoked for value and each element of array to compute their sort ranking. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The sorted array to inspect.

    • value: T

      The value to evaluate.

    • Optional iteratee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns number

    Returns the index at which value should be inserted into array.

    Example

    var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };

    _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
    // => 1

    // using the `_.property` iteratee shorthand
    _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
    // => 0
  • This method is like _.indexOf except that it performs a binary search on a sorted array.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to search.

    • value: T

      The value to search for.

    Returns number

    Returns the index of the matched value, else -1.

    Example

    _.sortedIndexOf([1, 1, 2, 2], 2);
    // => 2
  • This method is like _.sortedIndex except that it returns the highest index at which value should be inserted into array in order to maintain its sort order.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The sorted array to inspect.

    • value: T

      The value to evaluate.

    Returns number

    Returns the index at which value should be inserted into array.

    Example

    _.sortedLastIndex([4, 5], 4);
    // => 1
  • This method is like _.sortedLastIndex except that it accepts iteratee which is invoked for value and each element of array to compute their sort ranking. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The sorted array to inspect.

    • value: T

      The value to evaluate.

    • Optional iteratee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns number

    Returns the index at which value should be inserted into array.

    Example

    // using the `_.property` iteratee shorthand
    _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
    // => 1
  • This method is like _.lastIndexOf except that it performs a binary search on a sorted array.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to search.

    • value: T

      The value to search for.

    Returns number

    Returns the index of the matched value, else -1.

    Example

    _.sortedLastIndexOf([1, 1, 2, 2], 2);
    // => 3
  • This method is like _.uniq except that it's designed and optimized for sorted arrays.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    Returns T[]

    Returns the new duplicate free array.

    Example

    _.sortedUniq([1, 1, 2]);
    // => [1, 2]
  • This method is like _.uniqBy except that it's designed and optimized for sorted arrays.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    • Optional iteratee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns T[]

    Returns the new duplicate free array.

    Example

    _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
    // => [1.1, 2.3]
  • This method is like _.union except that it accepts comparator which is invoked to compare elements of arrays. The comparator is invoked with two arguments: (arrVal, othVal).

    Type Parameters

    • T

    Parameters

    • Optional arrays: null | List<T>

      The arrays to inspect.

    • Optional comparator: Comparator<T>

      The comparator invoked per element.

    Returns T[]

    Returns the new array of combined values.

    Example

    var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
    var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];

    _.unionWith(objects, others, _.isEqual);
    // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  • Type Parameters

    • T

    Parameters

    • arrays: undefined | null | List<T>
    • arrays2: undefined | null | List<T>
    • Optional comparator: Comparator<T>

    Returns T[]

    See

    _.unionWith

  • Type Parameters

    • T

    Parameters

    • arrays: undefined | null | List<T>
    • arrays2: undefined | null | List<T>
    • arrays3: undefined | null | List<T>
    • Rest ...comparator: (undefined | null | List<T> | Comparator<T>)[]

    Returns T[]

    See

    _.unionWith

  • Creates a duplicate-free version of an array, using SameValueZero for equality comparisons, in which only the first occurrence of each element is kept.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    Returns T[]

    Returns the new duplicate free array.

    Example

    _.uniq([2, 1, 2]);
    // => [2, 1]
  • This method is like _.uniq except that it accepts iteratee which is invoked for each element in array to generate the criterion by which uniqueness is computed. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    • Optional iteratee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns T[]

    Returns the new duplicate free array.

    Example

    _.uniqBy([2.1, 1.2, 2.3], Math.floor);
    // => [2.1, 1.2]

    // using the `_.property` iteratee shorthand
    _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
    // => [{ 'x': 1 }, { 'x': 2 }]
  • This method is like _.uniq except that it accepts comparator which is invoked to compare elements of array. The comparator is invoked with two arguments: (arrVal, othVal).

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    • Optional comparator: Comparator<T>

      The comparator invoked per element.

    Returns T[]

    Returns the new duplicate free array.

    Example

    var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 },  { 'x': 1, 'y': 2 }];

    _.uniqWith(objects, _.isEqual);
    // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  • This method is like _.xor except that it accepts iteratee which is invoked for each element of each arrays to generate the criterion by which uniqueness is computed. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • Optional arrays: null | List<T>

      The arrays to inspect.

    • Optional iteratee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns T[]

    Returns the new array of values.

    Example

    _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
    // => [1.2, 4.3]

    // using the `_.property` iteratee shorthand
    _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
    // => [{ 'x': 2 }]
  • Type Parameters

    • T

    Parameters

    • arrays: undefined | null | List<T>
    • arrays2: undefined | null | List<T>
    • Optional iteratee: ValueIteratee<T>

    Returns T[]

    See

    _.xorBy

  • Type Parameters

    • T

    Parameters

    • arrays: undefined | null | List<T>
    • arrays2: undefined | null | List<T>
    • arrays3: undefined | null | List<T>
    • Rest ...iteratee: (undefined | null | List<T> | ValueIteratee<T>)[]

    Returns T[]

    See

    _.xorBy

  • This method is like _.xor except that it accepts comparator which is invoked to compare elements of arrays. The comparator is invoked with two arguments: (arrVal, othVal).

    Type Parameters

    • T

    Parameters

    • Optional arrays: null | List<T>

      The arrays to inspect.

    • Optional comparator: Comparator<T>

      The comparator invoked per element.

    Returns T[]

    Returns the new array of values.

    Example

    var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
    var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];

    _.xorWith(objects, others, _.isEqual);
    // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  • Type Parameters

    • T

    Parameters

    • arrays: undefined | null | List<T>
    • arrays2: undefined | null | List<T>
    • Optional comparator: Comparator<T>

    Returns T[]

    See

    _.xorWith

  • Type Parameters

    • T

    Parameters

    • arrays: undefined | null | List<T>
    • arrays2: undefined | null | List<T>
    • arrays3: undefined | null | List<T>
    • Rest ...comparator: (undefined | null | List<T> | Comparator<T>)[]

    Returns T[]

    See

    _.xorWith

Collection

  • This method is like _.flatMap except that it recursively flattens the mapped results.

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | Dictionary<T | ListOfRecursiveArraysOrValues<T>> | NumericDictionary<T | ListOfRecursiveArraysOrValues<T>>

      The collection to iterate over.

    Returns T[]

    Returns the new flattened array.

    Since

    4.7.0

    Example

    function duplicate(n) {
    return [[[n, n]]];
    }

    _.flatMapDeep([1, 2], duplicate);
    // => [1, 1, 2, 2]
  • Type Parameters

    • T
    • TResult

    Parameters

    • collection: undefined | null | List<T>
    • iteratee: ListIterator<T, TResult | ListOfRecursiveArraysOrValues<TResult>>

    Returns TResult[]

    See

    _.flatMapDeep

  • Type Parameters

    • T extends object
    • TResult

    Parameters

    • collection: undefined | null | T
    • iteratee: ObjectIterator<T, TResult | ListOfRecursiveArraysOrValues<TResult>>

    Returns TResult[]

    See

    _.flatMapDeep

  • Parameters

    • collection: undefined | null | object
    • iteratee: string

    Returns any[]

    See

    _.flatMapDeep

  • Parameters

    • collection: undefined | null | object
    • iteratee: object

    Returns boolean[]

    See

    _.flatMapDeep

  • This method is like _.flatMap except that it recursively flattens the mapped results up to depth times.

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | Dictionary<T | ListOfRecursiveArraysOrValues<T>> | NumericDictionary<T | ListOfRecursiveArraysOrValues<T>>

      The collection to iterate over.

    Returns T[]

    Returns the new flattened array.

    Since

    4.7.0

    Example

    function duplicate(n) {
    return [[[n, n]]];
    }

    _.flatMapDepth([1, 2], duplicate, 2);
    // => [[1, 1], [2, 2]]
  • Type Parameters

    • T
    • TResult

    Parameters

    • collection: undefined | null | List<T>
    • iteratee: ListIterator<T, TResult | ListOfRecursiveArraysOrValues<TResult>>
    • Optional depth: number

    Returns TResult[]

    See

    _.flatMapDepth

  • Type Parameters

    • T extends object
    • TResult

    Parameters

    • collection: undefined | null | T
    • iteratee: ObjectIterator<T, TResult | ListOfRecursiveArraysOrValues<TResult>>
    • Optional depth: number

    Returns TResult[]

    See

    _.flatMapDepth

  • Parameters

    • collection: undefined | null | object
    • iteratee: string
    • Optional depth: number

    Returns any[]

    See

    _.flatMapDepth

  • Parameters

    • collection: undefined | null | object
    • iteratee: object
    • Optional depth: number

    Returns boolean[]

    See

    _.flatMapDepth

  • This method is like _.sortBy except that it allows specifying the sort orders of the iteratees to sort by. If orders is unspecified, all values are sorted in ascending order. Otherwise, specify an order of "desc" for descending or "asc" for ascending sort order of corresponding values.

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>

      The collection to iterate over.

    • Optional iteratees: Many<ListIterator<T, unknown>>

      The iteratees to sort by.

    • Optional orders: Many<boolean | "asc" | "desc">

      The sort orders of iteratees.

    Returns T[]

    Returns the new sorted array.

    Example

    var users = [
    { 'user': 'fred', 'age': 48 },
    { 'user': 'barney', 'age': 34 },
    { 'user': 'fred', 'age': 42 },
    { 'user': 'barney', 'age': 36 }
    ];

    // sort by `user` in ascending order and by `age` in descending order
    _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
    // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • Optional iteratees: Many<ListIteratee<T>>
    • Optional orders: Many<boolean | "asc" | "desc">

    Returns T[]

    See

    _.orderBy

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional iteratees: Many<ObjectIterator<T, unknown>>
    • Optional orders: Many<boolean | "asc" | "desc">

    Returns T[keyof T][]

    See

    _.orderBy

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional iteratees: Many<ObjectIteratee<T>>
    • Optional orders: Many<boolean | "asc" | "desc">

    Returns T[keyof T][]

    See

    _.orderBy

  • Creates an array of elements, sorted in ascending order by the results of running each element in a collection through each iteratee. This method performs a stable sort, that is, it preserves the original sort order of equal elements. The iteratees are invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>

      The collection to iterate over.

    • Optional Rest ...iteratees: Many<ListIteratee<T>>[]

      The iteratees to sort by, specified individually or in arrays.

    Returns T[]

    Returns the new sorted array.

    Example

    var users = [
    { 'user': 'fred', 'age': 48 },
    { 'user': 'barney', 'age': 36 },
    { 'user': 'fred', 'age': 42 },
    { 'user': 'barney', 'age': 34 }
    ];

    _.sortBy(users, function(o) { return o.user; });
    // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]

    _.sortBy(users, ['user', 'age']);
    // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]

    _.sortBy(users, 'user', function(o) {
    return Math.floor(o.age / 10);
    });
    // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Rest ...iteratees: Many<ObjectIteratee<T>>[]

    Returns T[keyof T][]

    See

    _.sortBy

Function

  • Creates a function that invokes func with arguments reversed.

    Type Parameters

    • T extends ((...args) => any)

    Parameters

    • func: T

      The function to flip arguments for.

    Returns T

    Returns the new function.

    Example

    var flipped = _.flip(function() {
    return _.toArray(arguments);
    });

    flipped('a', 'b', 'c', 'd');
    // => ['d', 'c', 'b', 'a']
  • Creates a function that accepts up to one argument, ignoring any additional arguments.

    Type Parameters

    • T
    • TResult

    Parameters

    • func: ((arg1, ...args) => TResult)

      The function to cap arguments for.

        • (arg1, ...args): TResult
        • Parameters

          • arg1: T
          • Rest ...args: any[]

          Returns TResult

    Returns ((arg1) => TResult)

    Returns the new function.

    Example

    _.map(['6', '8', '10'], _.unary(parseInt));
    // => [6, 8, 10]

Lang

  • Performs a SameValueZero comparison between two values to determine if they are equivalent.

    Parameters

    • value: any

      The value to compare.

    • other: any

      The other value to compare.

    Returns boolean

    Returns true if the values are equivalent, else false.

    Example

    var object = { 'user': 'fred' };
    var other = { 'user': 'fred' };

    _.eq(object, object);
    // => true

    _.eq(object, other);
    // => false

    _.eq('a', 'a');
    // => true

    _.eq('a', Object('a'));
    // => false

    _.eq(NaN, NaN);
    // => true
  • Checks if value is array-like. A value is considered array-like if it's not a function and has a value.length that's an integer greater than or equal to 0 and less than or equal to Number.MAX_SAFE_INTEGER.

    Type Parameters

    • T extends {
          __lodashAnyHack: any;
      }

    Parameters

    Returns boolean

    Returns true if value is array-like, else false.

    Example

    _.isArrayLike([1, 2, 3]);
    // => true

    _.isArrayLike(document.body.children);
    // => true

    _.isArrayLike('abc');
    // => true

    _.isArrayLike(_.noop);
    // => false
  • Parameters

    • value: undefined | null | ((...args) => any)

    Returns value is never

    See

    _.isArrayLike

  • Parameters

    • value: any

    Returns value is {
        length: number;
    }

    See

    _.isArrayLike

  • This method is like _.isArrayLike except that it also checks if value is an object.

    Type Parameters

    • T extends {
          __lodashAnyHack: any;
      }

    Parameters

    • value: T

      The value to check.

    Returns boolean

    Returns true if value is an array-like object, else false.

    Example

    _.isArrayLikeObject([1, 2, 3]);
    // => true

    _.isArrayLikeObject(document.body.children);
    // => true

    _.isArrayLikeObject('abc');
    // => false

    _.isArrayLikeObject(_.noop);
    // => false
  • Parameters

    • value: undefined | null | string | number | boolean | Function | ((...args) => any)

    Returns value is never

    See

    _.isArrayLikeObject

  • Parameters

    • value: any

    Returns value is object & {
        length: number;
    }

    See

    _.isArrayLikeObject

  • Performs a deep comparison between two values to determine if they are equivalent.

    Note: This method supports comparing arrays, array buffers, booleans, date objects, error objects, maps, numbers, Object objects, regexes, sets, strings, symbols, and typed arrays. Object objects are compared by their own, not inherited, enumerable properties. Functions and DOM nodes are not supported.

    Parameters

    • value: any

      The value to compare.

    • other: any

      The other value to compare.

    Returns boolean

    Returns true if the values are equivalent, else false.

    Example

    var object = { 'user': 'fred' };
    var other = { 'user': 'fred' };

    _.isEqual(object, other);
    // => true

    object === other;
    // => false
  • This method is like _.isEqual except that it accepts customizer which is invoked to compare values. If customizer returns undefined comparisons are handled by the method instead. The customizer is invoked with up to seven arguments: (objValue, othValue [, index|key, object, other, stack]).

    Parameters

    • value: any

      The value to compare.

    • other: any

      The other value to compare.

    • Optional customizer: IsEqualCustomizer

      The function to customize comparisons.

    Returns boolean

    Returns true if the values are equivalent, else false.

    Example

    function isGreeting(value) {
    return /^h(?:i|ello)$/.test(value);
    }

    function customizer(objValue, othValue) {
    if (isGreeting(objValue) && isGreeting(othValue)) {
    return true;
    }
    }

    var array = ['hello', 'goodbye'];
    var other = ['hi', 'goodbye'];

    _.isEqualWith(array, other, customizer);
    // => true
  • Checks if value is an integer.

    Note: This method is based on Number.isInteger.

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

    Returns true if value is an integer, else false.

    Example

    _.isInteger(3);
    // => true

    _.isInteger(Number.MIN_VALUE);
    // => false

    _.isInteger(Infinity);
    // => false

    _.isInteger('3');
    // => false
  • Checks if value is a valid array-like length.

    Note: This function is loosely based on ToLength.

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

    Returns true if value is a valid length, else false.

    Example

    _.isLength(3);
    // => true

    _.isLength(Number.MIN_VALUE);
    // => false

    _.isLength(Infinity);
    // => false

    _.isLength('3');
    // => false
  • Performs a deep comparison between object and source to determine if object contains equivalent property values.

    Note: This method supports comparing the same values as _.isEqual.

    Parameters

    • object: object

      The object to inspect.

    • source: object

      The object of property values to match.

    Returns boolean

    Returns true if object is a match, else false.

    Example

    var object = { 'user': 'fred', 'age': 40 };

    _.isMatch(object, { 'age': 40 });
    // => true

    _.isMatch(object, { 'age': 36 });
    // => false
  • This method is like _.isMatch except that it accepts customizer which is invoked to compare values. If customizer returns undefined comparisons are handled by the method instead. The customizer is invoked with three arguments: (objValue, srcValue, index|key, object, source).

    Parameters

    • object: object

      The object to inspect.

    • source: object

      The object of property values to match.

    • Optional customizer: isMatchWithCustomizer

      The function to customize comparisons.

    Returns boolean

    Returns true if object is a match, else false.

    Example

    function isGreeting(value) {
    return /^h(?:i|ello)$/.test(value);
    }

    function customizer(objValue, srcValue) {
    if (isGreeting(objValue) && isGreeting(srcValue)) {
    return true;
    }
    }

    var object = { 'greeting': 'hello' };
    var source = { 'greeting': 'hi' };

    _.isMatchWith(object, source, customizer);
    // => true
  • Checks if value is null or undefined.

    Parameters

    • value: any

      The value to check.

    Returns value is undefined | null

    Returns true if value is nullish, else false.

    Example

    _.isNil(null);
    // => true

    _.isNil(void 0);
    // => true

    _.isNil(NaN);
    // => false
  • Checks if value is object-like. A value is object-like if it's not null and has a typeof result of "object".

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

    Returns true if value is object-like, else false.

    Example

    _.isObjectLike({});
    // => true

    _.isObjectLike([1, 2, 3]);
    // => true

    _.isObjectLike(_.noop);
    // => false

    _.isObjectLike(null);
    // => false
  • Checks if value is a safe integer. An integer is safe if it's an IEEE-754 double precision number which isn't the result of a rounded unsafe integer.

    Note: This method is based on Number.isSafeInteger.

    Parameters

    • value: any

      The value to check.

    Returns boolean

    Returns true if value is a safe integer, else false.

    Example

    _.isSafeInteger(3);
    // => true

    _.isSafeInteger(Number.MIN_VALUE);
    // => false

    _.isSafeInteger(Infinity);
    // => false

    _.isSafeInteger('3');
    // => false
  • Checks if value is classified as a Symbol primitive or object.

    Parameters

    • value: any

      The value to check.

    Returns value is symbol

    Returns true if value is correctly classified, else false.

    Example

    _.isSymbol(Symbol.iterator);
    // => true

    _.isSymbol('abc');
    // => false
  • Converts value to a finite number.

    Parameters

    • value: any

      The value to convert.

    Returns number

    Returns the converted number.

    Since

    4.12.0

    Example

    _.toFinite(3.2);
    // => 3.2

    _.toFinite(Number.MIN_VALUE);
    // => 5e-324

    _.toFinite(Infinity);
    // => 1.7976931348623157e+308

    _.toFinite('3.2');
    // => 3.2
  • Converts value to an integer.

    Note: This function is loosely based on ToInteger.

    Parameters

    • value: any

      The value to convert.

    Returns number

    Returns the converted integer.

    Example

    _.toInteger(3);
    // => 3

    _.toInteger(Number.MIN_VALUE);
    // => 0

    _.toInteger(Infinity);
    // => 1.7976931348623157e+308

    _.toInteger('3');
    // => 3
  • Converts value to an integer suitable for use as the length of an array-like object.

    Note: This method is based on ToLength.

    Parameters

    • value: any

      The value to convert.

    Returns number

    Returns the converted integer.

    Example

    _.toLength(3);
    // => 3

    _.toLength(Number.MIN_VALUE);
    // => 0

    _.toLength(Infinity);
    // => 4294967295

    _.toLength('3');
    // => 3
  • Converts value to a number.

    Parameters

    • value: any

      The value to process.

    Returns number

    Returns the number.

    Example

    _.toNumber(3);
    // => 3

    _.toNumber(Number.MIN_VALUE);
    // => 5e-324

    _.toNumber(Infinity);
    // => Infinity

    _.toNumber('3');
    // => 3
  • Converts value to a safe integer. A safe integer can be compared and represented correctly.

    Parameters

    • value: any

      The value to convert.

    Returns number

    Returns the converted integer.

    Example

    _.toSafeInteger(3);
    // => 3

    _.toSafeInteger(Number.MIN_VALUE);
    // => 0

    _.toSafeInteger(Infinity);
    // => 9007199254740991

    _.toSafeInteger('3');
    // => 3
  • Converts value to a string if it's not one. An empty string is returned for null and undefined values. The sign of -0 is preserved.

    Parameters

    • value: any

      The value to process.

    Returns string

    Returns the string.

    Example

    _.toString(null);
    // => ''

    _.toString(-0);
    // => '-0'

    _.toString([1, 2, 3]);
    // => '1,2,3'

Math

  • Computes the maximum value of array. If array is empty or falsey undefined is returned.

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>

    Returns undefined | T

    Returns the maximum value.

  • This method is like _.max except that it accepts iteratee which is invoked for each element in array to generate the criterion by which the value is ranked. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • Optional iteratee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns undefined | T

    Returns the maximum value.

    Example

    var objects = [{ 'n': 1 }, { 'n': 2 }];

    _.maxBy(objects, function(o) { return o.n; });
    // => { 'n': 2 }

    // using the `_.property` iteratee shorthand
    _.maxBy(objects, 'n');
    // => { 'n': 2 }
  • Computes the mean of the values in array.

    Parameters

    • collection: undefined | null | List<any>

    Returns number

    Returns the mean.

    Example

    _.mean([4, 2, 8, 6]);
    // => 5
  • Computes the mean of the provided properties of the objects in the array

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • Optional iteratee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns number

    Returns the mean.

    Example

    _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n');
    // => 5
  • Computes the minimum value of array. If array is empty or falsey undefined is returned.

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>

    Returns undefined | T

    Returns the minimum value.

  • This method is like _.min except that it accepts iteratee which is invoked for each element in array to generate the criterion by which the value is ranked. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • Optional iteratee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns undefined | T

    Returns the minimum value.

    Example

    var objects = [{ 'n': 1 }, { 'n': 2 }];

    _.minBy(objects, function(o) { return o.a; });
    // => { 'n': 1 }

    // using the `_.property` iteratee shorthand
    _.minBy(objects, 'n');
    // => { 'n': 1 }
  • Subtract two numbers.

    Parameters

    • minuend: number

      The first number in a subtraction.

    • subtrahend: number

      The second number in a subtraction.

    Returns number

    Returns the difference.

    Example

    _.subtract(6, 4);
    // => 2
  • Computes the sum of the values in array.

    Parameters

    • collection: undefined | null | List<any>

    Returns number

    Returns the sum.

    Example

    _.sum([4, 2, 8, 6]);
    // => 20
  • This method is like _.sum except that it accepts iteratee which is invoked for each element in array to generate the value to be summed. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • Optional iteratee: string | ((value) => number)

      The iteratee invoked per element.

    Returns number

    Returns the sum.

    Example

    var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];

    _.sumBy(objects, function(o) { return o.n; });
    // => 20

    // using the `_.property` iteratee shorthand
    _.sumBy(objects, 'n');
    // => 20

Number

  • Clamps number within the inclusive lower and upper bounds.

    Parameters

    • number: number

      The number to clamp.

    • Optional lower: number

      The lower bound.

    • upper: number

      The upper bound.

    Returns number

    Returns the clamped number.

    Example

    _.clamp(-10, -5, 5);
    // => -5

    _.clamp(10, -5, 5);
    // => 5
    Clamps `number` within the inclusive `lower` and `upper` bounds.

    Example

    _.clamp(-10, -5, 5);
    // => -5

    _.clamp(10, -5, 5);
  • Parameters

    • number: number
    • upper: number

    Returns number

    See

    _.clamp

Object

  • This method is like _.assignIn except that it accepts customizer which is invoked to produce the assigned values. If customizer returns undefined assignment is handled by the method instead. The customizer is invoked with five arguments: (objValue, srcValue, key, object, source).

    Note: This method mutates object.

    Type Parameters

    • TObject
    • TSource

    Parameters

    • object: TObject

      The destination object.

    • source: TSource
    • Optional customizer: AssignCustomizer

      The function to customize assigned values.

    Returns TObject & TSource

    Returns object.

    Alias

    extendWith

    Example

    function customizer(objValue, srcValue) {
    return _.isUndefined(objValue) ? srcValue : objValue;
    }

    var defaults = _.partialRight(_.assignInWith, customizer);

    defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
    // => { 'a': 1, 'b': 2 }
  • Type Parameters

    • TObject
    • TSource1
    • TSource2

    Parameters

    Returns TObject & TSource1 & TSource2

    See

    _.assignInWith

  • Type Parameters

    • TObject
    • TSource1
    • TSource2
    • TSource3

    Parameters

    Returns TObject & TSource1 & TSource2 & TSource3

    See

    _.assignInWith

  • Type Parameters

    • TObject
    • TSource1
    • TSource2
    • TSource3
    • TSource4

    Parameters

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

    See

    _.assignInWith

  • Type Parameters

    • TObject

    Parameters

    Returns TObject

    See

    _.assignInWith

  • Type Parameters

    • TResult

    Parameters

    • object: any
    • Rest ...otherArgs: any[]

    Returns TResult

    See

    _.assignInWith

  • This method is like _.assign except that it accepts customizer which is invoked to produce the assigned values. If customizer returns undefined assignment is handled by the method instead. The customizer is invoked with five arguments: (objValue, srcValue, key, object, source).

    Note: This method mutates object.

    Type Parameters

    • TObject
    • TSource

    Parameters

    • object: TObject

      The destination object.

    • source: TSource
    • Optional customizer: AssignCustomizer

      The function to customize assigned values.

    Returns TObject & TSource

    Returns object.

    Example

    function customizer(objValue, srcValue) {
    return _.isUndefined(objValue) ? srcValue : objValue;
    }

    var defaults = _.partialRight(_.assignWith, customizer);

    defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
    // => { 'a': 1, 'b': 2 }
  • Type Parameters

    • TObject
    • TSource1
    • TSource2

    Parameters

    Returns TObject & TSource1 & TSource2

    See

    _.assignWith

  • Type Parameters

    • TObject
    • TSource1
    • TSource2
    • TSource3

    Parameters

    Returns TObject & TSource1 & TSource2 & TSource3

    See

    _.assignWith

  • Type Parameters

    • TObject
    • TSource1
    • TSource2
    • TSource3
    • TSource4

    Parameters

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

    See

    _.assignWith

  • Type Parameters

    • TObject

    Parameters

    Returns TObject

    See

    _.assignWith

  • Type Parameters

    • TResult

    Parameters

    • object: any
    • Rest ...otherArgs: any[]

    Returns TResult

    See

    _.assignWith

  • Creates an array of function property names from own enumerable properties of object.

    Parameters

    • object: any

      The object to inspect.

    Returns string[]

    Returns the new array of property names.

    Example

    function Foo() {
    this.a = _.constant('a');
    this.b = _.constant('b');
    }

    Foo.prototype.c = _.constant('c');

    _.functions(new Foo);
    // => ['a', 'b']
  • Creates an array of function property names from own and inherited enumerable properties of object.

    Type Parameters

    • T extends {}

    Parameters

    • object: any

      The object to inspect.

    Returns string[]

    Returns the new array of property names.

    Example

    function Foo() {
    this.a = _.constant('a');
    this.b = _.constant('b');
    }

    Foo.prototype.c = _.constant('c');

    _.functionsIn(new Foo);
    // => ['a', 'b', 'c']
  • Checks if path is a direct property of object.

    Type Parameters

    • T

    Parameters

    • object: T

      The object to query.

    • path: PropertyPath

      The path to check.

    Returns boolean

    Returns true if path exists, else false.

    Example

    var object = { 'a': { 'b': { 'c': 3 } } };
    var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });

    _.has(object, 'a');
    // => true

    _.has(object, 'a.b.c');
    // => true

    _.has(object, ['a', 'b', 'c']);
    // => true

    _.has(other, 'a');
    // => false
  • Checks if path is a direct or inherited property of object.

    Type Parameters

    • T

    Parameters

    • object: T

      The object to query.

    • path: PropertyPath

      The path to check.

    Returns boolean

    Returns true if path exists, else false.

    Example

    var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });

    _.hasIn(object, 'a');
    // => true

    _.hasIn(object, 'a.b.c');
    // => true

    _.hasIn(object, ['a', 'b', 'c']);
    // => true

    _.hasIn(object, 'b');
    // => false
  • Recursively merges own and inherited enumerable properties of source objects into the destination object, skipping source properties that resolve to undefined. Array and plain object properties are merged recursively. Other objects and value types are overridden by assignment. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.

    Note: This method mutates object.

    Type Parameters

    • TObject
    • TSource

    Parameters

    Returns TObject & TSource

    Returns object.

    Example

    var users = {
    'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
    };

    var ages = {
    'data': [{ 'age': 36 }, { 'age': 40 }]
    };

    _.merge(users, ages);
    // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
  • Type Parameters

    • TObject
    • TSource1
    • TSource2

    Parameters

    Returns TObject & TSource1 & TSource2

    See

    _.merge

  • Type Parameters

    • TObject
    • TSource1
    • TSource2
    • TSource3

    Parameters

    Returns TObject & TSource1 & TSource2 & TSource3

    See

    _.merge

  • Type Parameters

    • TObject
    • TSource1
    • TSource2
    • TSource3
    • TSource4

    Parameters

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

    See

    _.merge

  • Parameters

    • object: any
    • Rest ...otherArgs: any[]

    Returns any

    See

    _.merge

  • This method is like _.merge except that it accepts customizer which is invoked to produce the merged values of the destination and source properties. If customizer returns undefined merging is handled by the method instead. The customizer is invoked with seven arguments: (objValue, srcValue, key, object, source, stack).

    Type Parameters

    • TObject
    • TSource

    Parameters

    • object: TObject

      The destination object.

    • source: TSource
    • customizer: ((value, srcValue, key, object, source) => any)

      The function to customize assigned values.

        • (value, srcValue, key, object, source): any
        • Parameters

          • value: any
          • srcValue: any
          • key: string
          • object: any
          • source: any

          Returns any

    Returns TObject & TSource

    Returns object.

    Example

    function customizer(objValue, srcValue) {
    if (_.isArray(objValue)) {
    return objValue.concat(srcValue);
    }
    }

    var object = {
    'fruits': ['apple'],
    'vegetables': ['beet']
    };

    var other = {
    'fruits': ['banana'],
    'vegetables': ['carrot']
    };

    _.mergeWith(object, other, customizer);
    // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
  • Type Parameters

    • TObject
    • TSource1
    • TSource2

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • customizer: ((value, srcValue, key, object, source) => any)
        • (value, srcValue, key, object, source): any
        • Parameters

          • value: any
          • srcValue: any
          • key: string
          • object: any
          • source: any

          Returns any

    Returns TObject & TSource1 & TSource2

    See

    _.mergeWith

  • Type Parameters

    • TObject
    • TSource1
    • TSource2
    • TSource3

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • customizer: ((value, srcValue, key, object, source) => any)
        • (value, srcValue, key, object, source): any
        • Parameters

          • value: any
          • srcValue: any
          • key: string
          • object: any
          • source: any

          Returns any

    Returns TObject & TSource1 & TSource2 & TSource3

    See

    _.mergeWith

  • Type Parameters

    • TObject
    • TSource1
    • TSource2
    • TSource3
    • TSource4

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • source4: TSource4
    • customizer: ((value, srcValue, key, object, source) => any)
        • (value, srcValue, key, object, source): any
        • Parameters

          • value: any
          • srcValue: any
          • key: string
          • object: any
          • source: any

          Returns any

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

    See

    _.mergeWith

  • Parameters

    • object: any
    • Rest ...otherArgs: any[]

    Returns any

    See

    _.mergeWith

  • The opposite of _.pick; this method creates an object composed of the own and inherited enumerable properties of object that are not omitted.

    Type Parameters

    • T extends object
    • K extends PropertyName[]

    Parameters

    • object: undefined | null | T

      The source object.

    • Optional Rest ...paths: K

      The property names to omit, specified individually or in arrays..

    Returns Pick<T, Exclude<keyof T, K[number]>>

    Returns the new object.

    Example

    var object = { 'a': 1, 'b': '2', 'c': 3 };

    _.omit(object, ['a', 'c']);
    // => { 'b': '2' }
  • Type Parameters

    • T extends object
    • K extends string | number | symbol

    Parameters

    • object: undefined | null | T
    • Rest ...paths: Many<K>[]

    Returns Omit<T, K>

    See

    _.omit

  • Type Parameters

    • T extends object

    Parameters

    • object: undefined | null | T
    • Rest ...paths: Many<PropertyName>[]

    Returns Partial<T>

    See

    _.omit

  • The opposite of _.pickBy; this method creates an object composed of the own and inherited enumerable properties of object that predicate doesn't return truthy for.

    Type Parameters

    • T

    Parameters

    • object: undefined | null | Dictionary<T>

      The source object.

    • Optional predicate: ValueKeyIteratee<T>

      The function invoked per property.

    Returns Dictionary<T>

    Returns the new object.

    Example

    var object = { 'a': 1, 'b': '2', 'c': 3 };

    _.omitBy(object, _.isNumber);
    // => { 'b': '2' }
  • Type Parameters

    • T

    Parameters

    • object: undefined | null | NumericDictionary<T>
    • Optional predicate: ValueKeyIteratee<T>

    Returns NumericDictionary<T>

    See

    _.omitBy

  • Type Parameters

    • T extends object

    Parameters

    • object: undefined | null | T
    • predicate: ValueKeyIteratee<T[keyof T]>

    Returns Partial<T>

    See

    _.omitBy

  • Creates an object composed of the picked object properties.

    Type Parameters

    • T extends object
    • U extends string | number | symbol

    Parameters

    • object: T

      The source object.

    • Optional Rest ...props: Many<U>[]

      The property names to pick, specified individually or in arrays.

    Returns Pick<T, U>

    Returns the new object.

    Example

    var object = { 'a': 1, 'b': '2', 'c': 3 };

    _.pick(object, ['a', 'c']);
    // => { 'a': 1, 'c': 3 }
  • Type Parameters

    • T

    Parameters

    • object: undefined | null | T
    • Rest ...props: Many<PropertyPath>[]

    Returns Partial<T>

    See

    _.pick

  • Creates an object composed of the object properties predicate returns truthy for. The predicate is invoked with two arguments: (value, key).

    Type Parameters

    • T
    • S

    Parameters

    • object: undefined | null | Dictionary<T>

      The source object.

    • Optional predicate: ValueKeyIterateeTypeGuard<T, S>

      The function invoked per property.

    Returns Dictionary<S>

    Returns the new object.

    Example

    var object = { 'a': 1, 'b': '2', 'c': 3 };

    _.pickBy(object, _.isNumber);
    // => { 'a': 1, 'c': 3 }
  • Type Parameters

    • T
    • S

    Parameters

    • object: undefined | null | NumericDictionary<T>
    • predicate: ValueKeyIterateeTypeGuard<T, S>

    Returns NumericDictionary<S>

    See

    _.pickBy

  • Type Parameters

    • T

    Parameters

    • object: undefined | null | Dictionary<T>
    • Optional predicate: ValueKeyIteratee<T>

    Returns Dictionary<T>

    See

    _.pickBy

  • Type Parameters

    • T

    Parameters

    • object: undefined | null | NumericDictionary<T>
    • Optional predicate: ValueKeyIteratee<T>

    Returns NumericDictionary<T>

    See

    _.pickBy

  • Type Parameters

    • T extends object

    Parameters

    • object: undefined | null | T
    • Optional predicate: ValueKeyIteratee<T[keyof T]>

    Returns Partial<T>

    See

    _.pickBy

  • This method is like _.update except that it accepts customizer which is invoked to produce the objects of path. If customizer returns undefined path creation is handled by the method instead. The customizer is invoked with three arguments: (nsValue, key, nsObject).

    Note: This method mutates object.

    Type Parameters

    • T extends object

    Parameters

    • object: T

      The object to modify.

    • path: PropertyPath

      The path of the property to set.

    • updater: ((oldValue) => any)

      The function to produce the updated value.

        • (oldValue): any
        • Parameters

          • oldValue: any

          Returns any

    • Optional customizer: SetWithCustomizer<T>

      The function to customize assigned values.

    Returns T

    Returns object.

    Since

    4.6.0

    Example

    var object = {};

    _.updateWith(object, '[0][1]', _.constant('a'), Object);
    // => { '0': { '1': 'a' } }
  • Type Parameters

    • T extends object
    • TResult

    Parameters

    • object: T
    • path: PropertyPath
    • updater: ((oldValue) => any)
        • (oldValue): any
        • Parameters

          • oldValue: any

          Returns any

    • Optional customizer: SetWithCustomizer<T>

    Returns TResult

    See

    _.updateWith

Other

VERSION: string

The semantic version number.

bind: FunctionBind

Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind arguments to those provided to the bound function.

The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for partially applied arguments.

Note: Unlike native Function#bind this method does not set the "length" property of bound functions.

Param: func

The function to bind.

Param: thisArg

The this binding of func.

Param: partials

The arguments to be partially applied.

Returns

Returns the new bound function.

bindKey: FunctionBindKey

Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments to those provided to the bound function.

This method differs from _.bind by allowing bound functions to reference methods that may be redefined or don’t yet exist. See Peter Michaux’s article for more details.

The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for partially applied arguments.

Param: object

The object the method belongs to.

Param: key

The key of the method.

Param: partials

The arguments to be partially applied.

Returns

Returns the new bound function.

condense: ((arr) => any[])

Type declaration

    • (arr): any[]
    • Parameters

      • arr: any[]

      Returns any[]

condenseDeep: (<Src>(obj, options?) => Src)

Type declaration

    • <Src>(obj, options?): Src
    • Type Parameters

      • Src

      Parameters

      • obj: Src
      • Optional options: {
            checkCircular: boolean;
        }
        • checkCircular: boolean

      Returns Src

curry: Curry
curryRight: CurryRight
each: {
    <T>(collection, iteratee?): T[];
    (collection, iteratee?): string;
    <T>(collection, iteratee?): List<T>;
    <T>(collection, iteratee?): T;
    <T, TArray>(collection, iteratee?): TArray;
    <TString>(collection, iteratee?): TString;
    <T, TList>(collection, iteratee?): TList;
    <T>(collection, iteratee?): undefined | null | T;
}

Type declaration

    • <T>(collection, iteratee?): T[]
    • Type Parameters

      • T

      Parameters

      • collection: T[]
      • Optional iteratee: ArrayIterator<T, any>

      Returns T[]

    • (collection, iteratee?): string
    • Parameters

      • collection: string
      • Optional iteratee: StringIterator<any>

      Returns string

    • <T>(collection, iteratee?): List<T>
    • Type Parameters

      • T

      Parameters

      • collection: List<T>
      • Optional iteratee: ListIterator<T, any>

      Returns List<T>

    • <T>(collection, iteratee?): T
    • Type Parameters

      • T extends object

      Parameters

      • collection: T
      • Optional iteratee: ObjectIterator<T, any>

      Returns T

    • <T, TArray>(collection, iteratee?): TArray
    • Type Parameters

      • T
      • TArray extends undefined | null | T[]

      Parameters

      • collection: TArray & (undefined | null | T[])
      • Optional iteratee: ArrayIterator<T, any>

      Returns TArray

    • <TString>(collection, iteratee?): TString
    • Type Parameters

      • TString extends undefined | null | string

      Parameters

      • collection: TString
      • Optional iteratee: StringIterator<any>

      Returns TString

    • <T, TList>(collection, iteratee?): TList
    • Type Parameters

      • T
      • TList extends undefined | null | List<T>

      Parameters

      • collection: TList & (undefined | null | List<T>)
      • Optional iteratee: ListIterator<T, any>

      Returns TList

    • <T>(collection, iteratee?): undefined | null | T
    • Type Parameters

      • T extends object

      Parameters

      • collection: undefined | null | T
      • Optional iteratee: ObjectIterator<T, any>

      Returns undefined | null | T

See

_.forEach

eachDeep: ((obj, callback?, options?) => any)

Type declaration

    • (obj, callback?, options?): any
    • Parameters

      • obj: any
      • Optional callback: ((value, key, parentValue, context) => boolean | void)
          • (value, key, parentValue, context): boolean | void
          • Parameters

            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns boolean | void

      • Optional options: {
            callbackAfterIterate?: boolean;
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional callbackAfterIterate?: boolean
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns any

eachRight: {
    <T>(collection, iteratee?): T[];
    (collection, iteratee?): string;
    <T>(collection, iteratee?): List<T>;
    <T>(collection, iteratee?): T;
    <T, TArray>(collection, iteratee?): TArray;
    <TString>(collection, iteratee?): TString;
    <T, TList>(collection, iteratee?): TList;
    <T>(collection, iteratee?): undefined | null | T;
}

Type declaration

    • <T>(collection, iteratee?): T[]
    • Type Parameters

      • T

      Parameters

      • collection: T[]
      • Optional iteratee: ArrayIterator<T, any>

      Returns T[]

    • (collection, iteratee?): string
    • Parameters

      • collection: string
      • Optional iteratee: StringIterator<any>

      Returns string

    • <T>(collection, iteratee?): List<T>
    • Type Parameters

      • T

      Parameters

      • collection: List<T>
      • Optional iteratee: ListIterator<T, any>

      Returns List<T>

    • <T>(collection, iteratee?): T
    • Type Parameters

      • T extends object

      Parameters

      • collection: T
      • Optional iteratee: ObjectIterator<T, any>

      Returns T

    • <T, TArray>(collection, iteratee?): TArray
    • Type Parameters

      • T
      • TArray extends undefined | null | T[]

      Parameters

      • collection: TArray & (undefined | null | T[])
      • Optional iteratee: ArrayIterator<T, any>

      Returns TArray

    • <TString>(collection, iteratee?): TString
    • Type Parameters

      • TString extends undefined | null | string

      Parameters

      • collection: TString
      • Optional iteratee: StringIterator<any>

      Returns TString

    • <T, TList>(collection, iteratee?): TList
    • Type Parameters

      • T
      • TList extends undefined | null | List<T>

      Parameters

      • collection: TList & (undefined | null | List<T>)
      • Optional iteratee: ListIterator<T, any>

      Returns TList

    • <T>(collection, iteratee?): undefined | null | T
    • Type Parameters

      • T extends object

      Parameters

      • collection: undefined | null | T
      • Optional iteratee: ObjectIterator<T, any>

      Returns undefined | null | T

See

_.forEachRight

exists: ((obj, path) => boolean)

Type declaration

    • (obj, path): boolean
    • Parameters

      • obj: any
      • path: Path

      Returns boolean

filterDeep: ((obj, predicate?, options?) => any)

Type declaration

    • (obj, predicate?, options?): any
    • Parameters

      • obj: any
      • Optional predicate: ((value, key, parentValue, context) => boolean | void | {
            cloneDeep: boolean;
            keepIfEmpty: boolean;
            skipChildren: boolean;
        })
          • (value, key, parentValue, context): boolean | void | {
                cloneDeep: boolean;
                keepIfEmpty: boolean;
                skipChildren: boolean;
            }
          • Parameters

            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns boolean | void | {
                cloneDeep: boolean;
                keepIfEmpty: boolean;
                skipChildren: boolean;
            }

      • Optional options: {
            callbackAfterIterate?: boolean;
            checkCircular?: boolean;
            childrenPath?: Path[];
            cloneDeep?: ((value) => any);
            condense?: boolean;
            includeRoot?: boolean;
            keepCircular?: boolean;
            leavesOnly?: boolean;
            onFalse?: {
                cloneDeep?: boolean;
                keepIfEmpty?: boolean;
                skipChildren?: boolean;
            };
            onTrue?: {
                cloneDeep?: boolean;
                keepIfEmpty?: boolean;
                skipChildren?: boolean;
            };
            onUndefined?: {
                cloneDeep?: boolean;
                keepIfEmpty?: boolean;
                skipChildren?: boolean;
            };
            pathFormat?: "string" | "array";
            replaceCircularBy?: any;
            rootIsChildren?: boolean;
        }
        • Optional callbackAfterIterate?: boolean
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional cloneDeep?: ((value) => any)
            • (value): any
            • Parameters

              • value: any

              Returns any

        • Optional condense?: boolean
        • Optional includeRoot?: boolean
        • Optional keepCircular?: boolean
        • Optional leavesOnly?: boolean
        • Optional onFalse?: {
              cloneDeep?: boolean;
              keepIfEmpty?: boolean;
              skipChildren?: boolean;
          }
          • Optional cloneDeep?: boolean
          • Optional keepIfEmpty?: boolean
          • Optional skipChildren?: boolean
        • Optional onTrue?: {
              cloneDeep?: boolean;
              keepIfEmpty?: boolean;
              skipChildren?: boolean;
          }
          • Optional cloneDeep?: boolean
          • Optional keepIfEmpty?: boolean
          • Optional skipChildren?: boolean
        • Optional onUndefined?: {
              cloneDeep?: boolean;
              keepIfEmpty?: boolean;
              skipChildren?: boolean;
          }
          • Optional cloneDeep?: boolean
          • Optional keepIfEmpty?: boolean
          • Optional skipChildren?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional replaceCircularBy?: any
        • Optional rootIsChildren?: boolean

      Returns any

findDeep: ((obj, callback?, options?) => IDeepEntry | undefined)

Type declaration

    • (obj, callback?, options?): IDeepEntry | undefined
    • Parameters

      • obj: any
      • Optional callback: ((value, key, parentValue, context) => boolean | void)
          • (value, key, parentValue, context): boolean | void
          • Parameters

            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns boolean | void

      • Optional options: {
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns IDeepEntry | undefined

findPathDeep: ((obj, callback?, options?) => Path)

Type declaration

    • (obj, callback?, options?): Path
    • Parameters

      • obj: any
      • Optional callback: ((value, key, parentValue, context) => boolean | void)
          • (value, key, parentValue, context): boolean | void
          • Parameters

            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns boolean | void

      • Optional options: {
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns Path

findValueDeep: ((obj, callback?, options?) => any)

Type declaration

    • (obj, callback?, options?): any
    • Parameters

      • obj: any
      • Optional callback: ((value, key, parentValue, context) => boolean | void)
          • (value, key, parentValue, context): boolean | void
          • Parameters

            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns boolean | void

      • Optional options: {
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns any

first: (<T>(array) => undefined | T)

Type declaration

    • <T>(array): undefined | T
    • Type Parameters

      • T

      Parameters

      • array: undefined | null | List<T>

      Returns undefined | T

See

_.head

forEachDeep: ((obj, callback?, options?) => any)

Type declaration

    • (obj, callback?, options?): any
    • Parameters

      • obj: any
      • Optional callback: ((value, key, parentValue, context) => boolean | void)
          • (value, key, parentValue, context): boolean | void
          • Parameters

            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns boolean | void

      • Optional options: {
            callbackAfterIterate?: boolean;
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional callbackAfterIterate?: boolean
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns any

index: ((obj, options?) => Object)

Type declaration

    • (obj, options?): Object
    • Parameters

      • obj: any
      • Optional options: {
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            rootIsChildren?: boolean;
        }
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional rootIsChildren?: boolean

      Returns Object

keysDeep: ((obj, options?) => Path[])

Type declaration

    • (obj, options?): Path[]
    • Parameters

      • obj: any
      • Optional options: {
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeCircularPath?: boolean;
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeCircularPath?: boolean
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns Path[]

mapDeep: ((obj, callback?, options?) => any[])

Type declaration

    • (obj, callback?, options?): any[]
    • Parameters

      • obj: any
      • Optional callback: ((value, key, parentValue, context) => any)
          • (value, key, parentValue, context): any
          • Parameters

            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns any

      • Optional options: {
            callbackAfterIterate?: boolean;
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional callbackAfterIterate?: boolean
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns any[]

mapKeysDeep: ((obj, callback?, options?) => any)

Type declaration

    • (obj, callback?, options?): any
    • Parameters

      • obj: any
      • Optional callback: ((value, key, parentValue, context) => string | number)
          • (value, key, parentValue, context): string | number
          • Parameters

            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns string | number

      • Optional options: {
            callbackAfterIterate?: boolean;
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional callbackAfterIterate?: boolean
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns any

mapValuesDeep: ((obj, callback?, options?) => any)

Type declaration

    • (obj, callback?, options?): any
    • Parameters

      • obj: any
      • Optional callback: ((value, key, parentValue, context) => any)
          • (value, key, parentValue, context): any
          • Parameters

            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns any

      • Optional options: {
            callbackAfterIterate?: boolean;
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional callbackAfterIterate?: boolean
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns any

memoize: {
    Cache: MapCacheConstructor;
    <T>(func, resolver?): T & MemoizedFunction;
}

Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for storing the result based on the arguments provided to the memoized function. By default, the first argument provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with the this binding of the memoized function.

Type declaration

    • <T>(func, resolver?): T & MemoizedFunction
    • Type Parameters

      • T extends ((...args) => any)

      Parameters

      • func: T

        The function to have its output memoized.

      • Optional resolver: ((...args) => any)

        The function to resolve the cache key.

          • (...args): any
          • Parameters

            • Rest ...args: Parameters<T>

            Returns any

      Returns T & MemoizedFunction

  • Cache: MapCacheConstructor

Returns

Returns the new memoizing function.

omitDeep: ((obj, paths, options?) => any)

Type declaration

    • (obj, paths, options?): any
    • Parameters

      • obj: any
      • paths: string | RegExp | (string | RegExp)[]
      • Optional options: {
            checkCircular?: boolean;
            cloneDeep?: ((value) => any);
            condense?: boolean;
            keepCircular?: boolean;
            onMatch?: {
                cloneDeep?: boolean;
                keepIfEmpty?: boolean;
                skipChildren?: boolean;
            };
            onNotMatch?: {
                cloneDeep?: boolean;
                keepIfEmpty?: boolean;
                skipChildren?: boolean;
            };
            replaceCircularBy?: any;
        }
        • Optional checkCircular?: boolean
        • Optional cloneDeep?: ((value) => any)
            • (value): any
            • Parameters

              • value: any

              Returns any

        • Optional condense?: boolean
        • Optional keepCircular?: boolean
        • Optional onMatch?: {
              cloneDeep?: boolean;
              keepIfEmpty?: boolean;
              skipChildren?: boolean;
          }
          • Optional cloneDeep?: boolean
          • Optional keepIfEmpty?: boolean
          • Optional skipChildren?: boolean
        • Optional onNotMatch?: {
              cloneDeep?: boolean;
              keepIfEmpty?: boolean;
              skipChildren?: boolean;
          }
          • Optional cloneDeep?: boolean
          • Optional keepIfEmpty?: boolean
          • Optional skipChildren?: boolean
        • Optional replaceCircularBy?: any

      Returns any

partial: Partial

Creates a function that, when called, invokes func with any additional partial arguments prepended to those provided to the new function. This method is similar to _.bind except it does not alter the this binding.

Param: func

The function to partially apply arguments to.

Param: args

Arguments to be partially applied.

Returns

The new partially applied function.

partialRight: PartialRight

This method is like _.partial except that partial arguments are appended to those provided to the new function.

Param: func

The function to partially apply arguments to.

Param: args

Arguments to be partially applied.

Returns

The new partially applied function.

pathMatches: ((path, paths) => boolean)

Type declaration

    • (path, paths): boolean
    • Parameters

      • path: Path
      • paths: string | RegExp | (string | RegExp)[]

      Returns boolean

pathToString: ((path, ...prefixes) => string)

Type declaration

    • (path, ...prefixes): string
    • Parameters

      • path: (string | number)[]
      • Rest ...prefixes: string[]

      Returns string

paths: ((obj, options?) => Path[])

Type declaration

    • (obj, options?): Path[]
    • Parameters

      • obj: any
      • Optional options: {
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeCircularPath?: boolean;
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeCircularPath?: boolean
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns Path[]

pickDeep: ((obj, paths, options?) => any)

Type declaration

    • (obj, paths, options?): any
    • Parameters

      • obj: any
      • paths: string | RegExp | (string | RegExp)[]
      • Optional options: {
            checkCircular?: boolean;
            cloneDeep?: ((value) => any);
            condense?: boolean;
            keepCircular?: boolean;
            onMatch?: {
                cloneDeep?: boolean;
                keepIfEmpty?: boolean;
                skipChildren?: boolean;
            };
            onNotMatch?: {
                cloneDeep?: boolean;
                keepIfEmpty?: boolean;
                skipChildren?: boolean;
            };
            replaceCircularBy?: any;
        }
        • Optional checkCircular?: boolean
        • Optional cloneDeep?: ((value) => any)
            • (value): any
            • Parameters

              • value: any

              Returns any

        • Optional condense?: boolean
        • Optional keepCircular?: boolean
        • Optional onMatch?: {
              cloneDeep?: boolean;
              keepIfEmpty?: boolean;
              skipChildren?: boolean;
          }
          • Optional cloneDeep?: boolean
          • Optional keepIfEmpty?: boolean
          • Optional skipChildren?: boolean
        • Optional onNotMatch?: {
              cloneDeep?: boolean;
              keepIfEmpty?: boolean;
              skipChildren?: boolean;
          }
          • Optional cloneDeep?: boolean
          • Optional keepIfEmpty?: boolean
          • Optional skipChildren?: boolean
        • Optional replaceCircularBy?: any

      Returns any

reduceDeep: ((obj, callback?, accumulator?, options?) => any)

Type declaration

    • (obj, callback?, accumulator?, options?): any
    • Parameters

      • obj: any
      • Optional callback: ((accumulator, value, key, parentValue, context) => any)
          • (accumulator, value, key, parentValue, context): any
          • Parameters

            • accumulator: any
            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns any

      • Optional accumulator: any
      • Optional options: {
            callbackAfterIterate?: boolean;
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional callbackAfterIterate?: boolean
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns any

someDeep: ((obj, callback?, options?) => boolean)

Type declaration

    • (obj, callback?, options?): boolean
    • Parameters

      • obj: any
      • Optional callback: ((value, key, parentValue, context) => boolean | void)
          • (value, key, parentValue, context): boolean | void
          • Parameters

            • value: any
            • key: string | number
            • parentValue: any
            • context: IIterateeContext

            Returns boolean | void

      • Optional options: {
            checkCircular?: boolean;
            childrenPath?: Path[];
            includeRoot?: boolean;
            leavesOnly?: boolean;
            pathFormat?: "string" | "array";
            rootIsChildren?: boolean;
        }
        • Optional checkCircular?: boolean
        • Optional childrenPath?: Path[]
        • Optional includeRoot?: boolean
        • Optional leavesOnly?: boolean
        • Optional pathFormat?: "string" | "array"
        • Optional rootIsChildren?: boolean

      Returns boolean

templateSettings: TemplateSettings

By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby (ERB). Change the following template settings to use alternative delimiters.

  • Adds two numbers.

    Parameters

    • augend: number

      The first number to add.

    • addend: number

      The second number to add.

    Returns number

    Returns the sum.

  • The opposite of _.before; this method creates a function that invokes func once it’s called n or more times.

    Type Parameters

    • TFunc extends ((...args) => any)

    Parameters

    • n: number

      The number of calls before func is invoked.

    • func: TFunc

      The function to restrict.

    Returns TFunc

    Returns the new restricted function.

  • Creates a function that accepts up to n arguments ignoring any additional arguments.

    Parameters

    • func: ((...args) => any)

      The function to cap arguments for.

        • (...args): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional n: number

      The arity cap.

    Returns ((...args) => any)

    Returns the new function.

      • (...args): any
      • Parameters

        • Rest ...args: any[]

        Returns any

  • Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be specified as individual arguments or as arrays of keys.

    Type Parameters

    • T

    Parameters

    • object: undefined | null | Dictionary<T> | NumericDictionary<T>

      The object to iterate over.

    • Rest ...props: PropertyPath[]

      The property names or indexes of elements to pick, specified individually or in arrays.

    Returns T[]

    Returns the new array of picked elements.

  • Type Parameters

    • T extends object

    Parameters

    • object: undefined | null | T
    • Rest ...props: Many<keyof T>[]

    Returns T[keyof T][]

    See

    _.at

  • Attempts to invoke func, returning either the result or the caught error object. Any additional arguments are provided to func when it’s invoked.

    Type Parameters

    • TResult

    Parameters

    • func: ((...args) => TResult)

      The function to attempt.

    • Rest ...args: any[]

    Returns Error | TResult

    Returns the func result or error object.

  • Creates a function that invokes func, with the this binding and arguments of the created function, while it’s called less than n times. Subsequent calls to the created function return the result of the last func invocation.

    Type Parameters

    • TFunc extends ((...args) => any)

    Parameters

    • n: number

      The number of calls at which func is no longer invoked.

    • func: TFunc

      The function to restrict.

    Returns TFunc

    Returns the new restricted function.

  • Binds methods of an object to the object itself, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names. If no method names are provided all enumerable function properties, own and inherited, of object are bound.

    Note: This method does not set the "length" property of bound functions.

    Type Parameters

    • T

    Parameters

    • object: T

      The object to bind and assign the bound methods to.

    • Rest ...methodNames: Many<string>[]

      The object method names to bind, specified as individual method names or arrays of method names.

    Returns T

    Returns object.

  • Converts string to camel case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the camel cased string.

  • Converts the first character of string to upper case and the remaining to lower case.

    Parameters

    • Optional string: string

      The string to capitalize.

    Returns string

    Returns the capitalized string.

  • Casts value as an array if it’s not one.

    Type Parameters

    • T

    Parameters

    • Optional value: Many<T>

      The value to inspect.

    Returns T[]

    Returns the cast array.

  • Calculates n rounded up to precision.

    Parameters

    • n: number

      The number to round up.

    • Optional precision: number

      The precision to round up to.

    Returns number

    Returns the rounded up number.

  • Creates a lodash object that wraps value with explicit method chaining enabled.

    Type Parameters

    • TrapAny extends {
          __lodashAnyHack: any;
      }

    Parameters

    Returns CollectionChain<any> & FunctionChain<any> & ObjectChain<any> & PrimitiveChain<any> & StringChain

    Returns the new lodash wrapper instance.

  • Type Parameters

    • T extends undefined | null

    Parameters

    • value: T

    Returns PrimitiveChain<T>

    See

    _.chain

  • Parameters

    • value: string

    Returns StringChain

    See

    _.chain

  • Parameters

    • value: undefined | null | string

    Returns StringNullableChain

    See

    _.chain

  • Type Parameters

    • T extends ((...args) => any)

    Parameters

    • value: T

    Returns FunctionChain<T>

    See

    _.chain

  • Type Parameters

    • T = any

    Parameters

    • value: undefined | null | List<T>

    Returns CollectionChain<T>

    See

    _.chain

  • Type Parameters

    • T extends object

    Parameters

    • value: undefined | null | T

    Returns ObjectChain<T>

    See

    _.chain

  • Type Parameters

    • T

    Parameters

    • value: T

    Returns PrimitiveChain<T>

    See

    _.chain

  • Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the final chunk will be the remaining elements.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to process.

    • Optional size: number

      The length of each chunk.

    Returns T[][]

    Returns the new array containing chunks.

  • Creates a shallow clone of value.

    Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps.

    Type Parameters

    • T

    Parameters

    • value: T

      The value to clone.

    Returns T

    Returns the cloned value.

  • This method is like _.clone except that it recursively clones value.

    Type Parameters

    • T

    Parameters

    • value: T

      The value to recursively clone.

    Returns T

    Returns the deep cloned value.

  • This method is like _.cloneWith except that it recursively clones value.

    Type Parameters

    • T

    Parameters

    • value: T

      The value to recursively clone.

    • customizer: CloneDeepWithCustomizer<T>

      The function to customize cloning.

    Returns any

    Returns the deep cloned value.

  • Type Parameters

    • T

    Parameters

    • value: T

    Returns T

    See

    _.cloneDeepWith

  • This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. If customizer returns undefined cloning is handled by the method instead.

    Type Parameters

    • T
    • TResult extends null | string | number | boolean | object

    Parameters

    • value: T

      The value to clone.

    • customizer: CloneWithCustomizer<T, TResult>

      The function to customize cloning.

    Returns TResult

    Returns the cloned value.

  • Type Parameters

    • T
    • TResult

    Parameters

    • value: T
    • customizer: CloneWithCustomizer<T, undefined | TResult>

    Returns T | TResult

    See

    _.cloneWith

  • Type Parameters

    • T

    Parameters

    • value: T

    Returns T

    See

    _.cloneWith

  • Creates an array with all falsey values removed. The values false, null, 0, 0n, "", undefined, and NaN are falsey.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T | Falsey>

      The array to compact.

    Returns T[]

    Returns the new array of filtered values.

  • Creates a function that invokes the predicate properties of source with the corresponding property values of a given object, returning true if all predicates return truthy, else false.

    Type Parameters

    • T

    Parameters

    • source: ConformsPredicateObject<T>

    Returns ((value) => boolean)

      • (value): boolean
      • Parameters

        • value: T

        Returns boolean

  • Checks if object conforms to source by invoking the predicate properties of source with the corresponding property values of object.

    Note: This method is equivalent to _.conforms when source is partially applied.

    Type Parameters

    • T

    Parameters

    • object: T
    • source: ConformsPredicateObject<T>

    Returns boolean

  • Creates a function that returns value.

    Type Parameters

    • T

    Parameters

    • value: T

      The value to return from the new function.

    Returns (() => T)

    Returns the new function.

      • (): T
      • Returns T

  • Creates an object composed of keys generated from the results of running each element of collection through iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>

      The collection to iterate over.

    • Optional iteratee: ValueIteratee<T>

      The function invoked per iteration.

    Returns Dictionary<number>

    Returns the composed aggregate object.

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional iteratee: ValueIteratee<T[keyof T]>

    Returns Dictionary<number>

    See

    _.countBy

  • Creates an object that inherits from the given prototype object. If a properties object is provided its own enumerable properties are assigned to the created object.

    Type Parameters

    • T extends object
    • U extends object

    Parameters

    • prototype: T

      The object to inherit from.

    • Optional properties: U

      The properties to assign to the object.

    Returns T & U

    Returns the new object.

  • Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls to the debounced function return the result of the last func invocation.

    Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if the the debounced function is invoked more than once during the wait timeout.

    See David Corbacho’s article for details over the differences between _.debounce and _.throttle.

    Type Parameters

    • T extends ((...args) => any)

    Parameters

    • func: T

      The function to debounce.

    • wait: undefined | number

      The number of milliseconds to delay.

    • options: DebounceSettingsLeading

      The options object.

    Returns DebouncedFuncLeading<T>

    Returns the new debounced function.

  • Type Parameters

    • T extends ((...args) => any)

    Parameters

    • func: T
    • Optional wait: number
    • Optional options: DebounceSettings

    Returns DebouncedFunc<T>

  • Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining diacritical marks.

    Parameters

    • Optional string: string

      The string to deburr.

    Returns string

    Returns the deburred string.

  • Checks value to determine whether a default value should be returned in its place. The defaultValue is returned if value is NaN, null, or undefined.

    Type Parameters

    • T

    Parameters

    • value: undefined | null | T

      The value to check.

    • defaultValue: T

      The default value.

    Returns T

    Returns the resolved value.

  • Type Parameters

    • T
    • TDefault

    Parameters

    • value: undefined | null | T
    • defaultValue: TDefault

    Returns T | TDefault

    See

    _.defaultTo

  • This method is like _.defaults except that it recursively assigns default properties.

    Parameters

    • object: any

      The destination object.

    • Rest ...sources: any[]

      The source objects.

    Returns any

    Returns object.

  • Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to func when it’s invoked.

    Parameters

    • func: ((...args) => any)

      The function to defer.

        • (...args): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Rest ...args: any[]

      The arguments to invoke the function with.

    Returns number

    Returns the timer id.

  • Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked.

    Parameters

    • func: ((...args) => any)

      The function to delay.

        • (...args): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • wait: number

      The number of milliseconds to delay invocation.

    • Rest ...args: any[]

      The arguments to invoke the function with.

    Returns number

    Returns the timer id.

  • Creates an array of array values not included in the other provided arrays using SameValueZero for equality comparisons. The order and references of result values are determined by the first array.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    • Rest ...values: List<T>[]

      The arrays of values to exclude.

    Returns T[]

    Returns the new array of filtered values.

  • This method is like _.difference except that it accepts iteratee which is invoked for each element of array and values to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T1
    • T2

    Parameters

    • array: undefined | null | List<T1>

      The array to inspect.

    • values: List<T2>

      The values to exclude.

    • iteratee: ValueIteratee<T1 | T2>

      The iteratee invoked per element.

    Returns T1[]

    Returns the new array of filtered values.

  • Type Parameters

    • T1
    • T2
    • T3

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • iteratee: ValueIteratee<T1 | T2 | T3>

    Returns T1[]

    See

    _.differenceBy

  • Type Parameters

    • T1
    • T2
    • T3
    • T4

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • values3: List<T4>
    • iteratee: ValueIteratee<T1 | T2 | T3 | T4>

    Returns T1[]

    See

    _.differenceBy

  • Type Parameters

    • T1
    • T2
    • T3
    • T4
    • T5

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • values3: List<T4>
    • values4: List<T5>
    • iteratee: ValueIteratee<T1 | T2 | T3 | T4 | T5>

    Returns T1[]

    See

    _.differenceBy

  • Type Parameters

    • T1
    • T2
    • T3
    • T4
    • T5
    • T6

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • values3: List<T4>
    • values4: List<T5>
    • values5: List<T6>
    • iteratee: ValueIteratee<T1 | T2 | T3 | T4 | T5 | T6>

    Returns T1[]

    See

    _.differenceBy

  • Type Parameters

    • T1
    • T2
    • T3
    • T4
    • T5
    • T6
    • T7

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • values3: List<T4>
    • values4: List<T5>
    • values5: List<T6>
    • Rest ...values: (List<T7> | ValueIteratee<T1 | T2 | T3 | T4 | T5 | T6 | T7>)[]

    Returns T1[]

    See

    _.differenceBy

  • Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>
    • Rest ...values: List<T>[]

    Returns T[]

    See

    _.differenceBy

  • Divide two numbers.

    Parameters

    • dividend: number

      The first number in a division.

    • divisor: number

      The second number in a division.

    Returns number

    Returns the quotient.

  • Creates a slice of array with n elements dropped from the beginning.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    • Optional n: number

      The number of elements to drop.

    Returns T[]

    Returns the slice of array.

  • Creates a slice of array with n elements dropped from the end.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    • Optional n: number

      The number of elements to drop.

    Returns T[]

    Returns the slice of array.

  • Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    • Optional predicate: ListIteratee<T>

      The function invoked per iteration.

    Returns T[]

    Returns the slice of array.

  • Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    • Optional predicate: ListIteratee<T>

      The function invoked per iteration.

    Returns T[]

    Returns the slice of array.

  • Checks if string ends with the given target string.

    Parameters

    • Optional string: string

      The string to search.

    • Optional target: string

      The string to search for.

    • Optional position: number

      The position to search from.

    Returns boolean

    Returns true if string ends with target, else false.

  • Type Parameters

    • T

    Parameters

    • Optional object: Dictionary<T> | NumericDictionary<T>

    Returns [string, T][]

    See

    _.toPairs

  • Parameters

    • Optional object: object

    Returns [string, any][]

    See

    _.entries

  • Type Parameters

    • T

    Parameters

    • Optional object: Dictionary<T> | NumericDictionary<T>

    Returns [string, T][]

    See

    _.entriesIn

  • Parameters

    • Optional object: object

    Returns [string, any][]

    See

    _.entriesIn

  • Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities.

    Note: No other characters are escaped. To escape additional characters use a third-party library like he.

    Though the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s article (under "semi-related fun fact") for more details.

    Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59, #102, #108, and #133 of the HTML5 Security Cheatsheet for more details.

    When working with HTML you should always quote attribute values to reduce XSS vectors.

    Parameters

    • Optional string: string

      The string to escape.

    Returns string

    Returns the escaped string.

  • Escapes the RegExp special characters "^", "$", "", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in string.

    Parameters

    • Optional string: string

      The string to escape.

    Returns string

    Returns the escaped string.

  • Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate returns falsey. The predicate is invoked with three arguments: (value, index|key, collection).

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>

      The collection to iterate over.

    • Optional predicate: ListIterateeCustom<T, boolean>

      The function invoked per iteration.

    Returns boolean

    Returns true if all elements pass the predicate check, else false.

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional predicate: ObjectIterateeCustom<T, boolean>

    Returns boolean

    See

    _.every

  • Fills elements of array with value from start up to, but not including, end.

    Note: This method mutates array.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | any[]

      The array to fill.

    • value: T

      The value to fill array with.

    Returns T[]

    Returns array.

  • Type Parameters

    • T

    Parameters

    • array: undefined | null | List<any>
    • value: T

    Returns List<T>

    See

    _.fill

  • Type Parameters

    • T
    • U

    Parameters

    • array: undefined | null | U[]
    • value: T
    • Optional start: number
    • Optional end: number

    Returns (T | U)[]

    See

    _.fill

  • Type Parameters

    • T
    • U

    Parameters

    • array: undefined | null | List<U>
    • value: T
    • Optional start: number
    • Optional end: number

    Returns List<T | U>

    See

    _.fill

  • Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The predicate is invoked with three arguments: (value, index|key, collection).

    Parameters

    • collection: undefined | null | string

      The collection to iterate over.

    • Optional predicate: StringIterator<boolean>

      The function invoked per iteration.

    Returns string[]

    Returns the new filtered array.

  • Type Parameters

    • T
    • S

    Parameters

    • collection: undefined | null | List<T>
    • predicate: ListIteratorTypeGuard<T, S>

    Returns S[]

    See

    _.filter

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • Optional predicate: ListIterateeCustom<T, boolean>

    Returns T[]

    See

    _.filter

  • Type Parameters

    • T extends object
    • S

    Parameters

    • collection: undefined | null | T
    • predicate: ObjectIteratorTypeGuard<T, S>

    Returns S[]

    See

    _.filter

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional predicate: ObjectIterateeCustom<T, boolean>

    Returns T[keyof T][]

    See

    _.filter

  • Iterates over elements of collection, returning the first element predicate returns truthy for. The predicate is invoked with three arguments: (value, index|key, collection).

    Type Parameters

    • T
    • S

    Parameters

    • collection: undefined | null | List<T>

      The collection to search.

    • predicate: ListIteratorTypeGuard<T, S>

      The function invoked per iteration.

    • Optional fromIndex: number

      The index to search from.

    Returns undefined | S

    Returns the matched element, else undefined.

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • Optional predicate: ListIterateeCustom<T, boolean>
    • Optional fromIndex: number

    Returns undefined | T

    See

    _.find

  • Type Parameters

    • T extends object
    • S

    Parameters

    • collection: undefined | null | T
    • predicate: ObjectIteratorTypeGuard<T, S>
    • Optional fromIndex: number

    Returns undefined | S

    See

    _.find

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional predicate: ObjectIterateeCustom<T, boolean>
    • Optional fromIndex: number

    Returns undefined | T[keyof T]

    See

    _.find

  • This method is like _.find except that it returns the index of the first element predicate returns truthy for instead of the element itself.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to search.

    • Optional predicate: ListIterateeCustom<T, boolean>

      The function invoked per iteration.

    • Optional fromIndex: number

      The index to search from.

    Returns number

    Returns the index of the found element, else -1.

  • This method is like _.find except that it returns the key of the first element predicate returns truthy for instead of the element itself.

    Type Parameters

    • T

    Parameters

    • object: undefined | null | T

      The object to search.

    • Optional predicate: ObjectIteratee<T>

      The function invoked per iteration.

    Returns undefined | string

    Returns the key of the matched element, else undefined.

  • This method is like _.find except that it iterates over elements of a collection from right to left.

    Type Parameters

    • T
    • S

    Parameters

    • collection: undefined | null | List<T>

      Searches for a value in this list.

    • predicate: ListIteratorTypeGuard<T, S>

      The function called per iteration.

    • Optional fromIndex: number

      The index to search from.

    Returns undefined | S

    The found element, else undefined.

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • Optional predicate: ListIterateeCustom<T, boolean>
    • Optional fromIndex: number

    Returns undefined | T

    See

    _.findLast

  • Type Parameters

    • T extends object
    • S

    Parameters

    • collection: undefined | null | T
    • predicate: ObjectIteratorTypeGuard<T, S>
    • Optional fromIndex: number

    Returns undefined | S

    See

    _.findLast

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional predicate: ObjectIterateeCustom<T, boolean>
    • Optional fromIndex: number

    Returns undefined | T[keyof T]

    See

    _.findLast

  • This method is like _.findIndex except that it iterates over elements of collection from right to left.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to search.

    • Optional predicate: ListIterateeCustom<T, boolean>

      The function invoked per iteration.

    • Optional fromIndex: number

      The index to search from.

    Returns number

    Returns the index of the found element, else -1.

  • This method is like _.findKey except that it iterates over elements of a collection in the opposite order.

    Type Parameters

    • T

    Parameters

    • object: undefined | null | T

      The object to search.

    • Optional predicate: ObjectIteratee<T>

      The function invoked per iteration.

    Returns undefined | string

    Returns the key of the matched element, else undefined.

  • Creates an array of flattened values by running each element in collection through iteratee and concating its result to the other mapped values. The iteratee is invoked with three arguments: (value, index|key, collection).

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | Dictionary<Many<T>> | NumericDictionary<Many<T>>

      The collection to iterate over.

    Returns T[]

    Returns the new flattened array.

  • Parameters

    • collection: undefined | null | object

    Returns any[]

    See

    _.flatMap

  • Type Parameters

    • T
    • TResult

    Parameters

    • collection: undefined | null | List<T>
    • iteratee: ListIterator<T, Many<TResult>>

    Returns TResult[]

    See

    _.flatMap

  • Type Parameters

    • T extends object
    • TResult

    Parameters

    • collection: undefined | null | T
    • iteratee: ObjectIterator<T, Many<TResult>>

    Returns TResult[]

    See

    _.flatMap

  • Parameters

    • collection: undefined | null | object
    • iteratee: string

    Returns any[]

    See

    _.flatMap

  • Parameters

    • collection: undefined | null | object
    • iteratee: object

    Returns boolean[]

    See

    _.flatMap

  • Flattens array a single level deep.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<Many<T>>

      The array to flatten.

    Returns T[]

    Returns the new flattened array.

  • Recursively flattens a nested array.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | ListOfRecursiveArraysOrValues<T>

      The array to recursively flatten.

    Returns Flat<T>[]

    Returns the new flattened array.

  • Recursively flatten array up to depth times.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | ListOfRecursiveArraysOrValues<T>

      The array to recursively flatten.

    • Optional depth: number

    Returns T[]

    Returns the new flattened array.

  • Calculates n rounded down to precision.

    Parameters

    • n: number

      The number to round down.

    • Optional precision: number

      The precision to round down to.

    Returns number

    Returns the rounded down number.

  • Creates a function that returns the result of invoking the provided functions with the this binding of the created function, where each successive invocation is supplied the return value of the previous.

    Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3
    • R4
    • R5
    • R6
    • R7

    Parameters

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    • f4: ((a) => R4)
        • (a): R4
        • Parameters

          Returns R4

    • f5: ((a) => R5)
        • (a): R5
        • Parameters

          Returns R5

    • f6: ((a) => R6)
        • (a): R6
        • Parameters

          Returns R6

    • f7: ((a) => R7)
        • (a): R7
        • Parameters

          Returns R7

    Returns ((...args) => R7)

    Returns the new function.

      • (...args): R7
      • Parameters

        • Rest ...args: A

        Returns R7

  • Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3
    • R4
    • R5
    • R6
    • R7

    Parameters

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    • f4: ((a) => R4)
        • (a): R4
        • Parameters

          Returns R4

    • f5: ((a) => R5)
        • (a): R5
        • Parameters

          Returns R5

    • f6: ((a) => R6)
        • (a): R6
        • Parameters

          Returns R6

    • f7: ((a) => R7)
        • (a): R7
        • Parameters

          Returns R7

    • Rest ...func: Many<((a) => any)>[]

    Returns ((...args) => any)

      • (...args): any
      • Parameters

        • Rest ...args: A

        Returns any

    See

    _.flow

  • Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3
    • R4
    • R5
    • R6

    Parameters

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    • f4: ((a) => R4)
        • (a): R4
        • Parameters

          Returns R4

    • f5: ((a) => R5)
        • (a): R5
        • Parameters

          Returns R5

    • f6: ((a) => R6)
        • (a): R6
        • Parameters

          Returns R6

    Returns ((...args) => R6)

      • (...args): R6
      • Parameters

        • Rest ...args: A

        Returns R6

    See

    _.flow

  • Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3
    • R4
    • R5

    Parameters

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    • f4: ((a) => R4)
        • (a): R4
        • Parameters

          Returns R4

    • f5: ((a) => R5)
        • (a): R5
        • Parameters

          Returns R5

    Returns ((...args) => R5)

      • (...args): R5
      • Parameters

        • Rest ...args: A

        Returns R5

    See

    _.flow

  • Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3
    • R4

    Parameters

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    • f4: ((a) => R4)
        • (a): R4
        • Parameters

          Returns R4

    Returns ((...args) => R4)

      • (...args): R4
      • Parameters

        • Rest ...args: A

        Returns R4

    See

    _.flow

  • Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3

    Parameters

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    Returns ((...args) => R3)

      • (...args): R3
      • Parameters

        • Rest ...args: A

        Returns R3

    See

    _.flow

  • Type Parameters

    • A extends any[]
    • R1
    • R2

    Parameters

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    Returns ((...args) => R2)

      • (...args): R2
      • Parameters

        • Rest ...args: A

        Returns R2

    See

    _.flow

  • Parameters

    • Rest ...func: Many<((...args) => any)>[]

    Returns ((...args) => any)

      • (...args): any
      • Parameters

        • Rest ...args: any[]

        Returns any

    See

    _.flow

  • This method is like _.flow except that it creates a function that invokes the provided functions from right to left.

    Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3
    • R4
    • R5
    • R6
    • R7

    Parameters

    • f7: ((a) => R7)
        • (a): R7
        • Parameters

          Returns R7

    • f6: ((a) => R6)
        • (a): R6
        • Parameters

          Returns R6

    • f5: ((a) => R5)
        • (a): R5
        • Parameters

          Returns R5

    • f4: ((a) => R4)
        • (a): R4
        • Parameters

          Returns R4

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    Returns ((...args) => R7)

    Returns the new function.

      • (...args): R7
      • Parameters

        • Rest ...args: A

        Returns R7

  • Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3
    • R4
    • R5
    • R6

    Parameters

    • f6: ((a) => R6)
        • (a): R6
        • Parameters

          Returns R6

    • f5: ((a) => R5)
        • (a): R5
        • Parameters

          Returns R5

    • f4: ((a) => R4)
        • (a): R4
        • Parameters

          Returns R4

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    Returns ((...args) => R6)

      • (...args): R6
      • Parameters

        • Rest ...args: A

        Returns R6

    See

    _.flowRight

  • Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3
    • R4
    • R5

    Parameters

    • f5: ((a) => R5)
        • (a): R5
        • Parameters

          Returns R5

    • f4: ((a) => R4)
        • (a): R4
        • Parameters

          Returns R4

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    Returns ((...args) => R5)

      • (...args): R5
      • Parameters

        • Rest ...args: A

        Returns R5

    See

    _.flowRight

  • Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3
    • R4

    Parameters

    • f4: ((a) => R4)
        • (a): R4
        • Parameters

          Returns R4

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    Returns ((...args) => R4)

      • (...args): R4
      • Parameters

        • Rest ...args: A

        Returns R4

    See

    _.flowRight

  • Type Parameters

    • A extends any[]
    • R1
    • R2
    • R3

    Parameters

    • f3: ((a) => R3)
        • (a): R3
        • Parameters

          Returns R3

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    Returns ((...args) => R3)

      • (...args): R3
      • Parameters

        • Rest ...args: A

        Returns R3

    See

    _.flowRight

  • Type Parameters

    • A extends any[]
    • R1
    • R2

    Parameters

    • f2: ((a) => R2)
        • (a): R2
        • Parameters

          Returns R2

    • f1: ((...args) => R1)
        • (...args): R1
        • Parameters

          • Rest ...args: A

          Returns R1

    Returns ((...args) => R2)

      • (...args): R2
      • Parameters

        • Rest ...args: A

        Returns R2

    See

    _.flowRight

  • Parameters

    • Rest ...func: Many<((...args) => any)>[]

    Returns ((...args) => any)

      • (...args): any
      • Parameters

        • Rest ...args: any[]

        Returns any

    See

    _.flowRight

  • Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked with three arguments: (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false.

    Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To avoid this behavior _.forIn or _.forOwn may be used for object iteration.

    Type Parameters

    • T

    Parameters

    • collection: T[]

      The collection to iterate over.

    • Optional iteratee: ArrayIterator<T, any>

      The function invoked per iteration.

    Returns T[]

    Alias

    _.each

  • Parameters

    • collection: string
    • Optional iteratee: StringIterator<any>

    Returns string

    See

    _.forEach

  • Type Parameters

    • T

    Parameters

    • collection: List<T>
    • Optional iteratee: ListIterator<T, any>

    Returns List<T>

    See

    _.forEach

  • Type Parameters

    • T extends object

    Parameters

    • collection: T
    • Optional iteratee: ObjectIterator<T, any>

    Returns T

    See

    _.forEach

  • Type Parameters

    • T
    • TArray extends undefined | null | T[]

    Parameters

    • collection: TArray & (undefined | null | T[])
    • Optional iteratee: ArrayIterator<T, any>

    Returns TArray

    See

    _.forEach

  • Type Parameters

    • TString extends undefined | null | string

    Parameters

    • collection: TString
    • Optional iteratee: StringIterator<any>

    Returns TString

    See

    _.forEach

  • Type Parameters

    • T
    • TList extends undefined | null | List<T>

    Parameters

    • collection: TList & (undefined | null | List<T>)
    • Optional iteratee: ListIterator<T, any>

    Returns TList

    See

    _.forEach

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional iteratee: ObjectIterator<T, any>

    Returns undefined | null | T

    See

    _.forEach

  • This method is like _.forEach except that it iterates over elements of collection from right to left.

    Type Parameters

    • T

    Parameters

    • collection: T[]

      The collection to iterate over.

    • Optional iteratee: ArrayIterator<T, any>

      The function called per iteration.

    Returns T[]

    Alias

    _.eachRight

  • Parameters

    • collection: string
    • Optional iteratee: StringIterator<any>

    Returns string

    See

    _.forEachRight

  • Type Parameters

    • T

    Parameters

    • collection: List<T>
    • Optional iteratee: ListIterator<T, any>

    Returns List<T>

    See

    _.forEachRight

  • Type Parameters

    • T extends object

    Parameters

    • collection: T
    • Optional iteratee: ObjectIterator<T, any>

    Returns T

    See

    _.forEachRight

  • Type Parameters

    • T
    • TArray extends undefined | null | T[]

    Parameters

    • collection: TArray & (undefined | null | T[])
    • Optional iteratee: ArrayIterator<T, any>

    Returns TArray

    See

    _.forEachRight

  • Type Parameters

    • TString extends undefined | null | string

    Parameters

    • collection: TString
    • Optional iteratee: StringIterator<any>

    Returns TString

    See

    _.forEachRight

  • Type Parameters

    • T
    • TList extends undefined | null | List<T>

    Parameters

    • collection: TList & (undefined | null | List<T>)
    • Optional iteratee: ListIterator<T, any>

    Returns TList

    See

    _.forEachRight

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional iteratee: ObjectIterator<T, any>

    Returns undefined | null | T

    See

    _.forEachRight

  • Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The iteratee is invoked with three arguments: (value, key, object). Iteratee functions may exit iteration early by explicitly returning false.

    Type Parameters

    • T

    Parameters

    • object: T

      The object to iterate over.

    • Optional iteratee: ObjectIterator<T, any>

      The function invoked per iteration.

    Returns T

    Returns object.

  • Type Parameters

    • T

    Parameters

    • object: undefined | null | T
    • Optional iteratee: ObjectIterator<T, any>

    Returns undefined | null | T

    See

    _.forIn

  • This method is like _.forIn except that it iterates over properties of object in the opposite order.

    Type Parameters

    • T

    Parameters

    • object: T

      The object to iterate over.

    • Optional iteratee: ObjectIterator<T, any>

      The function invoked per iteration.

    Returns T

    Returns object.

  • Type Parameters

    • T

    Parameters

    • object: undefined | null | T
    • Optional iteratee: ObjectIterator<T, any>

    Returns undefined | null | T

    See

    _.forInRight

  • Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is invoked with three arguments: (value, key, object). Iteratee functions may exit iteration early by explicitly returning false.

    Type Parameters

    • T

    Parameters

    • object: T

      The object to iterate over.

    • Optional iteratee: ObjectIterator<T, any>

      The function invoked per iteration.

    Returns T

    Returns object.

  • Type Parameters

    • T

    Parameters

    • object: undefined | null | T
    • Optional iteratee: ObjectIterator<T, any>

    Returns undefined | null | T

    See

    _.forOwn

  • This method is like _.forOwn except that it iterates over properties of object in the opposite order.

    Type Parameters

    • T

    Parameters

    • object: T

      The object to iterate over.

    • Optional iteratee: ObjectIterator<T, any>

      The function invoked per iteration.

    Returns T

    Returns object.

  • Type Parameters

    • T

    Parameters

    • object: undefined | null | T
    • Optional iteratee: ObjectIterator<T, any>

    Returns undefined | null | T

    See

    _.forOwnRight

  • Gets the property value at path of object. If the resolved value is undefined the defaultValue is used in its place.

    Type Parameters

    • TObject extends object
    • TKey extends string | number | symbol

    Parameters

    • object: TObject

      The object to query.

    • path: TKey | [TKey]

      The path of the property to get.

    Returns TObject[TKey]

    Returns the resolved value.

  • Type Parameters

    • TObject extends object
    • TKey extends string | number | symbol

    Parameters

    Returns undefined | TObject[TKey]

    See

    _.get

  • Type Parameters

    • TObject extends object
    • TKey extends string | number | symbol
    • TDefault

    Parameters

    Returns TDefault | Exclude<TObject[TKey], undefined>

    See

    _.get

  • Type Parameters

    • TObject extends object
    • TKey1 extends string | number | symbol
    • TKey2 extends string | number | symbol

    Parameters

    Returns TObject[TKey1][TKey2]

    See

    _.get

  • Type Parameters

    • TObject extends object
    • TKey1 extends string | number | symbol
    • TKey2 extends string | number | symbol

    Parameters

    Returns undefined | TObject[TKey1][TKey2]

    See

    _.get

  • Type Parameters

    • TObject extends object
    • TKey1 extends string | number | symbol
    • TKey2 extends string | number | symbol
    • TDefault

    Parameters

    Returns TDefault | Exclude<TObject[TKey1][TKey2], undefined>

    See

    _.get

  • Type Parameters

    • TObject extends object
    • TKey1 extends string | number | symbol
    • TKey2 extends string | number | symbol
    • TKey3 extends string | number | symbol

    Parameters

    Returns TObject[TKey1][TKey2][TKey3]

    See

    _.get

  • Type Parameters

    • TObject extends object
    • TKey1 extends string | number | symbol
    • TKey2 extends string | number | symbol
    • TKey3 extends string | number | symbol

    Parameters

    Returns undefined | TObject[TKey1][TKey2][TKey3]

    See

    _.get

  • Type Parameters

    • TObject extends object
    • TKey1 extends string | number | symbol
    • TKey2 extends string | number | symbol
    • TKey3 extends string | number | symbol
    • TDefault

    Parameters

    Returns TDefault | Exclude<TObject[TKey1][TKey2][TKey3], undefined>

    See

    _.get

  • Type Parameters

    • TObject extends object
    • TKey1 extends string | number | symbol
    • TKey2 extends string | number | symbol
    • TKey3 extends string | number | symbol
    • TKey4 extends string | number | symbol

    Parameters

    Returns TObject[TKey1][TKey2][TKey3][TKey4]

    See

    _.get

  • Type Parameters

    • TObject extends object
    • TKey1 extends string | number | symbol
    • TKey2 extends string | number | symbol
    • TKey3 extends string | number | symbol
    • TKey4 extends string | number | symbol

    Parameters

    Returns undefined | TObject[TKey1][TKey2][TKey3][TKey4]

    See

    _.get

  • Type Parameters

    • TObject extends object
    • TKey1 extends string | number | symbol
    • TKey2 extends string | number | symbol
    • TKey3 extends string | number | symbol
    • TKey4 extends string | number | symbol
    • TDefault

    Parameters

    Returns TDefault | Exclude<TObject[TKey1][TKey2][TKey3][TKey4], undefined>

    See

    _.get

  • Type Parameters

    • T

    Parameters

    • object: NumericDictionary<T>
    • path: number

    Returns T

    See

    _.get

  • Type Parameters

    • T

    Parameters

    • object: undefined | null | NumericDictionary<T>
    • path: number

    Returns undefined | T

    See

    _.get

  • Type Parameters

    • T
    • TDefault

    Parameters

    • object: undefined | null | NumericDictionary<T>
    • path: number
    • defaultValue: TDefault

    Returns T | TDefault

    See

    _.get

  • Type Parameters

    • TDefault

    Parameters

    • object: undefined | null
    • path: PropertyPath
    • defaultValue: TDefault

    Returns TDefault

    See

    _.get

  • Parameters

    • object: undefined | null
    • path: PropertyPath

    Returns undefined

    See

    _.get

  • Type Parameters

    • TObject
    • TPath extends string

    Parameters

    Returns string extends TPath
        ? any
        : GetFieldType<TObject, TPath>

    See

    _.get

  • Type Parameters

    • TObject
    • TPath extends string
    • TDefault = GetFieldType<TObject, TPath>

    Parameters

    Returns TDefault | Exclude<GetFieldType<TObject, TPath>, undefined | null>

    See

    _.get

  • Parameters

    • object: any
    • path: PropertyPath
    • Optional defaultValue: any

    Returns any

    See

    _.get

  • Creates an object composed of keys generated from the results of running each element of collection through iteratee. The corresponding value of each key is an array of the elements responsible for generating the key. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>

      The collection to iterate over.

    • Optional iteratee: ValueIteratee<T>

      The function invoked per iteration.

    Returns Dictionary<T[]>

    Returns the composed aggregate object.

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional iteratee: ValueIteratee<T[keyof T]>

    Returns Dictionary<T[keyof T][]>

    See

    _.groupBy

  • Checks if value is greater than other.

    Parameters

    • value: any

      The value to compare.

    • other: any

      The other value to compare.

    Returns boolean

    Returns true if value is greater than other, else false.

  • Checks if value is greater than or equal to other.

    Parameters

    • value: any

      The value to compare.

    • other: any

      The other value to compare.

    Returns boolean

    Returns true if value is greater than or equal to other, else false.

  • Gets the first element of array.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    Returns undefined | T

    Returns the first element of array.

    Alias

    _.first

  • This method returns the first argument provided to it.

    Type Parameters

    • T

    Parameters

    • value: T

      Any value.

    Returns T

    Returns value.

  • Returns undefined

    See

    _.identity

  • Checks if n is between start and up to but not including, end. If end is not specified it’s set to start with start then set to 0.

    Parameters

    • n: number

      The number to check.

    • start: number

      The start of the range.

    • Optional end: number

      The end of the range.

    Returns boolean

    Returns true if n is in the range, else false.

  • Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, it’s used as the offset from the end of collection.

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | Dictionary<T> | NumericDictionary<T>

      The collection to search.

    • target: T

      The value to search for.

    • Optional fromIndex: number

      The index to search from.

    Returns boolean

    True if the target element is found, else false.

  • Gets all but the last element of array.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    Returns T[]

    Returns the slice of array.

  • Creates an array of unique values that are included in all of the provided arrays using SameValueZero for equality comparisons.

    Type Parameters

    • T

    Parameters

    • Rest ...arrays: (undefined | null | List<T>)[]

      The arrays to inspect.

    Returns T[]

    Returns the new array of shared values.

  • Creates an object composed of the inverted keys and values of object. If object contains duplicate values, subsequent values overwrite property assignments of previous values unless multiValue is true.

    Parameters

    • object: object

      The object to invert.

    Returns Dictionary<string>

    Returns the new inverted object.

  • This method is like _.invert except that the inverted object is generated from the results of running each element of object through iteratee. The corresponding inverted value of each inverted key is an array of keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • object: undefined | null | Dictionary<T> | NumericDictionary<T>

      The object to invert.

    • Optional interatee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns Dictionary<string[]>

    Returns the new inverted object.

  • Type Parameters

    • T extends object

    Parameters

    • object: undefined | null | T
    • Optional interatee: ValueIteratee<T[keyof T]>

    Returns Dictionary<string[]>

    See

    _.invertBy

  • Invokes the method at path of object.

    Parameters

    • object: any

      The object to query.

    • path: PropertyPath

      The path of the method to invoke.

    • Rest ...args: any[]

      The arguments to invoke the method with.

    Returns any

  • Invokes the method named by methodName on each element in the collection returning an array of the results of each invoked method. Additional arguments will be provided to each invoked method. If methodName is a function it will be invoked for, and this bound to, each element in the collection.

    Parameters

    • collection: undefined | null | object

      The collection to iterate over.

    • methodName: string

      The name of the method to invoke.

    • Rest ...args: any[]

      Arguments to invoke the method with.

    Returns any[]

  • Type Parameters

    • TResult

    Parameters

    • collection: undefined | null | object
    • method: ((...args) => TResult)
    • Rest ...args: any[]

    Returns TResult[]

    See

    _.invokeMap

  • Checks if value is classified as an arguments object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is IArguments

    Returns true if value is correctly classified, else false.

  • Checks if value is classified as an Array object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is any[]

    Returns true if value is correctly classified, else false.

  • Type Parameters

    • T

    Parameters

    • Optional value: any

    Returns value is any[]

    See

    _.isArray

  • Checks if value is classified as an ArrayBuffer object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is ArrayBuffer

    Returns true if value is correctly classified, else false.

  • Checks if value is classified as a boolean primitive or object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is boolean

    Returns true if value is correctly classified, else false.

  • Checks if value is a buffer.

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

    Returns true if value is a buffer, else false.

  • Checks if value is classified as a Date object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is Date

    Returns true if value is correctly classified, else false.

  • Checks if value is a DOM element.

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

    Returns true if value is a DOM element, else false.

  • Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or jQuery-like collection with a length greater than 0 or an object with own enumerable properties.

    Type Parameters

    • T extends {
          __trapAny: any;
      }

    Parameters

    • Optional value: T

      The value to inspect.

    Returns boolean

    Returns true if value is empty, else false.

  • Parameters

    • value: string

    Returns value is ""

  • Parameters

    • value: undefined | null | List<any> | Map<any, any> | Set<any>

    Returns boolean

  • Parameters

    • value: object

    Returns boolean

  • Type Parameters

    • T extends object

    Parameters

    • value: undefined | null | T

    Returns value is undefined | null | EmptyObjectOf<T>

  • Parameters

    • Optional value: any

    Returns boolean

  • Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError object.

    Parameters

    • value: any

      The value to check.

    Returns value is Error

    Returns true if value is an error object, else false.

  • Checks if value is a finite primitive number.

    Note: This method is based on Number.isFinite.

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

    Returns true if value is a finite number, else false.

  • Checks if value is a callable function.

    Parameters

    • value: any

      The value to check.

    Returns value is ((...args) => any)

    Returns true if value is correctly classified, else false.

  • Checks if value is classified as a Map object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is Map<any, any>

    Returns true if value is correctly classified, else false.

  • Checks if value is NaN.

    Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values.

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

    Returns true if value is NaN, else false.

  • Checks if value is a native function.

    Parameters

    • value: any

      The value to check.

    Returns value is ((...args) => any)

    Returns true if value is a native function, else false.

  • Checks if value is null.

    Parameters

    • value: any

      The value to check.

    Returns value is null

    Returns true if value is null, else false.

  • Checks if value is classified as a Number primitive or object.

    Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is number

    Returns true if value is correctly classified, else false.

  • Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))

    Parameters

    • Optional value: any

      The value to check.

    Returns value is object

    Returns true if value is an object, else false.

  • Checks if value is a plain object, that is, an object created by the Object constructor or one with a [[Prototype]] of null.

    Note: This method assumes objects created by the Object constructor have no inherited enumerable properties.

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

    Returns true if value is a plain object, else false.

  • Checks if value is classified as a RegExp object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is RegExp

    Returns true if value is correctly classified, else false.

  • Checks if value is classified as a Set object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is Set<any>

    Returns true if value is correctly classified, else false.

  • Checks if value is classified as a String primitive or object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is string

    Returns true if value is correctly classified, else false.

  • Checks if value is classified as a typed array.

    Parameters

    • value: any

      The value to check.

    Returns boolean

    Returns true if value is correctly classified, else false.

  • Checks if value is undefined.

    Parameters

    • value: any

      The value to check.

    Returns value is undefined

    Returns true if value is undefined, else false.

  • Checks if value is classified as a WeakMap object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is WeakMap<object, any>

    Returns true if value is correctly classified, else false.

  • Checks if value is classified as a WeakSet object.

    Parameters

    • Optional value: any

      The value to check.

    Returns value is WeakSet<object>

    Returns true if value is correctly classified, else false.

  • Converts all elements in array into a string separated by separator.

    Parameters

    • array: undefined | null | List<any>

      The array to convert.

    • Optional separator: string

      The element separator.

    Returns string

    Returns the joined string.

  • Converts string to kebab case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the kebab cased string.

  • Creates an object composed of keys generated from the results of running each element of collection through iteratee. The corresponding value of each key is the last element responsible for generating the key. The iteratee function is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>

      The collection to iterate over.

    • Optional iteratee: ValueIterateeCustom<T, PropertyName>

      The function invoked per iteration.

    Returns Dictionary<T>

    Returns the composed aggregate object.

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional iteratee: ValueIterateeCustom<T[keyof T], PropertyName>

    Returns Dictionary<T[keyof T]>

    See

    _.keyBy

  • Creates an array of the own enumerable property names of object.

    Note: Non-object values are coerced to objects. See the ES spec for more details.

    Parameters

    • Optional object: any

      The object to query.

    Returns string[]

    Returns the array of property names.

  • Creates an array of the own and inherited enumerable property names of object.

    Note: Non-object values are coerced to objects.

    Parameters

    • Optional object: any

      The object to query.

    Returns string[]

    An array of property names.

  • Gets the last element of array.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    Returns undefined | T

    Returns the last element of array.

  • This method is like _.indexOf except that it iterates over elements of array from right to left.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to search.

    • value: T

      The value to search for.

    • Optional fromIndex: number | true

      The index to search from or true to perform a binary search on a sorted array.

    Returns number

    Returns the index of the matched value, else -1.

  • Converts string, as space separated words, to lower case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the lower cased string.

  • Converts the first character of string to lower case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the converted string.

  • Checks if value is less than other.

    Parameters

    • value: any

      The value to compare.

    • other: any

      The other value to compare.

    Returns boolean

    Returns true if value is less than other, else false.

  • Checks if value is less than or equal to other.

    Parameters

    • value: any

      The value to compare.

    • other: any

      The other value to compare.

    Returns boolean

    Returns true if value is less than or equal to other, else false.

  • Creates an array of values by running each element in collection through iteratee. The iteratee is invoked with three arguments: (value, index|key, collection).

    Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, _.reject, and _.some.

    The guarded methods are: ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, sample, some, sum, uniq, and words

    Type Parameters

    • T
    • TResult

    Parameters

    • collection: undefined | null | T[]

      The collection to iterate over.

    • iteratee: ArrayIterator<T, TResult>

      The function invoked per iteration.

    Returns TResult[]

    Returns the new mapped array.

  • Type Parameters

    • T
    • TResult

    Parameters

    • collection: undefined | null | List<T>
    • iteratee: ListIterator<T, TResult>

    Returns TResult[]

    See

    _.map

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | Dictionary<T> | NumericDictionary<T>

    Returns T[]

    See

    _.map

  • Type Parameters

    • T extends object
    • TResult

    Parameters

    • collection: undefined | null | T
    • iteratee: ObjectIterator<T, TResult>

    Returns TResult[]

    See

    _.map

  • Type Parameters

    • T
    • K extends string | number | symbol

    Parameters

    • collection: undefined | null | Dictionary<T> | NumericDictionary<T>
    • iteratee: K

    Returns T[K][]

    See

    _.map

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | Dictionary<T> | NumericDictionary<T>
    • Optional iteratee: string

    Returns any[]

    See

    _.map

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | Dictionary<T> | NumericDictionary<T>
    • Optional iteratee: object

    Returns boolean[]

    See

    _.map

  • The opposite of _.mapValues; this method creates an object with the same values as object and keys generated by running each own enumerable property of object through iteratee.

    Type Parameters

    • T

    Parameters

    • object: undefined | null | List<T>

      The object to iterate over.

    • Optional iteratee: ListIteratee<T>

      The function invoked per iteration.

    Returns Dictionary<T>

    Returns the new mapped object.

  • Type Parameters

    • T extends object

    Parameters

    • object: undefined | null | T
    • Optional iteratee: ObjectIteratee<T>

    Returns Dictionary<T[keyof T]>

    See

    _.mapKeys

  • Creates an object with the same keys as object and values generated by running each own enumerable property of object through iteratee. The iteratee function is invoked with three arguments: (value, key, object).

    Type Parameters

    • TResult

    Parameters

    • obj: undefined | null | string
    • callback: StringIterator<TResult>

    Returns NumericDictionary<TResult>

    Returns the new mapped object.

  • Type Parameters

    • T extends object
    • TResult

    Parameters

    • obj: undefined | null | T
    • callback: ObjectIterator<T, TResult>

    Returns {
        [P in string | number | symbol]: TResult
    }

    See

    _.mapValues

  • Type Parameters

    • T

    Parameters

    • obj: undefined | null | Dictionary<T> | NumericDictionary<T>
    • iteratee: object

    Returns Dictionary<boolean>

    See

    _.mapValues

  • Type Parameters

    • T extends object

    Parameters

    • obj: undefined | null | T
    • iteratee: object

    Returns {
        [P in string | number | symbol]: boolean
    }

    See

    _.mapValues

  • Type Parameters

    • T
    • TKey extends string | number | symbol

    Parameters

    • obj: undefined | null | Dictionary<T> | NumericDictionary<T>
    • iteratee: TKey

    Returns Dictionary<T[TKey]>

    See

    _.mapValues

  • Type Parameters

    • T

    Parameters

    • obj: undefined | null | Dictionary<T> | NumericDictionary<T>
    • iteratee: string

    Returns Dictionary<any>

    See

    _.mapValues

  • Type Parameters

    • T extends object

    Parameters

    • obj: undefined | null | T
    • iteratee: string

    Returns {
        [P in string | number | symbol]: any
    }

    See

    _.mapValues

  • Parameters

    • obj: undefined | null | string

    Returns NumericDictionary<string>

    See

    _.mapValues

  • Type Parameters

    • T

    Parameters

    • obj: undefined | null | Dictionary<T> | NumericDictionary<T>

    Returns Dictionary<T>

    See

    _.mapValues

  • Type Parameters

    • T extends object

    Parameters

    • obj: T

    Returns T

    See

    _.mapValues

  • Type Parameters

    • T extends object

    Parameters

    • obj: undefined | null | T

    Returns Partial<T>

    See

    _.mapValues

  • Creates a function that performs a deep comparison between a given object and source, returning true if the given object has equivalent property values, else false.

    Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own or inherited property value see _.matchesProperty.

    Type Parameters

    • T

    Parameters

    • source: T

      The object of property values to match.

    Returns ((value) => boolean)

    Returns the new function.

      • (value): boolean
      • Parameters

        • value: any

        Returns boolean

  • Type Parameters

    • T
    • V

    Parameters

    • source: T

    Returns ((value) => boolean)

      • (value): boolean
      • Parameters

        • value: V

        Returns boolean

    See

    _.matches

  • Creates a function that compares the property value of path on a given object to value.

    Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and strings. Objects are compared by their own, not inherited, enumerable properties.

    Type Parameters

    • T

    Parameters

    • path: PropertyPath

      The path of the property to get.

    • srcValue: T

      The value to match.

    Returns ((value) => boolean)

    Returns the new function.

      • (value): boolean
      • Parameters

        • value: any

        Returns boolean

  • Type Parameters

    • T
    • V

    Parameters

    • path: PropertyPath
    • srcValue: T

    Returns ((value) => boolean)

      • (value): boolean
      • Parameters

        • value: V

        Returns boolean

    See

    _.matchesProperty

  • Creates a function that invokes the method at path on a given object. Any additional arguments are provided to the invoked method.

    Parameters

    • path: PropertyPath

      The path of the method to invoke.

    • Rest ...args: any[]

      The arguments to invoke the method with.

    Returns ((object) => any)

    Returns the new function.

      • (object): any
      • Parameters

        • object: any

        Returns any

  • The opposite of _.method; this method creates a function that invokes the method at a given path on object. Any additional arguments are provided to the invoked method.

    Parameters

    • object: object

      The object to query.

    • Rest ...args: any[]

      The arguments to invoke the method with.

    Returns ((path) => any)

    Returns the new function.

      • (path): any
      • Parameters

        • path: PropertyPath

        Returns any

  • Adds all own enumerable function properties of a source object to the destination object. If object is a function then methods are added to its prototype as well.

    Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying the original.

    Type Parameters

    • TObject

    Parameters

    • object: TObject

      The destination object.

    • source: Dictionary<((...args) => any)>

      The object of functions to add.

    • Optional options: MixinOptions

      The options object.

    Returns TObject

    Returns object.

  • Type Parameters

    • TResult

    Parameters

    • source: Dictionary<((...args) => any)>
    • Optional options: MixinOptions

    Returns LoDashStatic

    See

    _.mixin

  • Multiply two numbers.

    Parameters

    • multiplier: number

      The first number in a multiplication.

    • multiplicand: number

      The second number in a multiplication.

    Returns number

    Returns the product.

  • Creates a function that negates the result of the predicate func. The func predicate is invoked with the this binding and arguments of the created function.

    Type Parameters

    • T extends any[]

    Parameters

    • predicate: ((...args) => boolean)

      The predicate to negate.

        • (...args): boolean
        • Parameters

          • Rest ...args: T

          Returns boolean

    Returns ((...args) => boolean)

    Returns the new function.

      • (...args): boolean
      • Parameters

        • Rest ...args: T

        Returns boolean

  • Reverts the _ variable to its previous value and returns a reference to the lodash function.

    Returns LoDashStatic

    Returns the lodash function.

  • A no-operation function that returns undefined regardless of the arguments it receives.

    Parameters

    • Rest ...args: any[]

    Returns void

    undefined

  • Returns number

  • Gets the element at index n of array. If n is negative, the nth element from the end is returned.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      array The array to query.

    • Optional n: number

    Returns undefined | T

    Returns the nth element of array.

  • Creates a function that returns its nth argument.

    Parameters

    • Optional n: number

      The index of the argument to return.

    Returns ((...args) => any)

    Returns the new function.

      • (...args): any
      • Parameters

        • Rest ...args: any[]

        Returns any

  • Creates a function that is restricted to invoking func once. Repeat calls to the function return the value of the first call. The func is invoked with the this binding and arguments of the created function.

    Type Parameters

    • T extends ((...args) => any)

    Parameters

    • func: T

      The function to restrict.

    Returns T

    Returns the new restricted function.

  • Creates a function that invokes iteratees with the arguments provided to the created function and returns their results.

    Type Parameters

    • TResult

    Parameters

    • Rest ...iteratees: Many<((...args) => TResult)>[]

      The iteratees to invoke.

    Returns ((...args) => TResult[])

    Returns the new function.

  • Creates a function that runs each argument through a corresponding transform function.

    Parameters

    • func: ((...args) => any)

      The function to wrap.

        • (...args): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Rest ...transforms: Many<((...args) => any)>[]

      The functions to transform arguments, specified as individual functions or arrays of functions.

    Returns ((...args) => any)

    Returns the new function.

      • (...args): any
      • Parameters

        • Rest ...args: any[]

        Returns any

  • Creates a function that checks if all of the predicates return truthy when invoked with the arguments provided to the created function.

    Type Parameters

    • T
    • Result1
    • Result2

    Parameters

    • Rest ...predicates: [((arg) => arg is Result1), ((arg) => arg is Result2)]

      The predicates to check.

    Returns ((arg) => arg is Result1 & Result2)

    Returns the new function.

  • Type Parameters

    • T

    Parameters

    • Rest ...predicates: Many<((...args) => boolean)>[]

    Returns ((...args) => boolean)

      • (...args): boolean
      • Parameters

        • Rest ...args: T[]

        Returns boolean

  • Creates a function that checks if any of the predicates return truthy when invoked with the arguments provided to the created function.

    Type Parameters

    • T
    • Result1
    • Result2

    Parameters

    • Rest ...predicates: [((arg) => arg is Result1), ((arg) => arg is Result2)]

      The predicates to check.

    Returns ((arg) => arg is Result1 | Result2)

    Returns the new function.

  • Type Parameters

    • T

    Parameters

    • Rest ...predicates: Many<((...args) => boolean)>[]

    Returns ((...args) => boolean)

      • (...args): boolean
      • Parameters

        • Rest ...args: T[]

        Returns boolean

  • Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if they can’t be evenly divided by length.

    Parameters

    • Optional string: string

      The string to pad.

    • Optional length: number

      The padding length.

    • Optional chars: string

      The string used as padding.

    Returns string

    Returns the padded string.

  • Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed length.

    Parameters

    • Optional string: string

      The string to pad.

    • Optional length: number

      The padding length.

    • Optional chars: string

      The string used as padding.

    Returns string

    Returns the padded string.

  • Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed length.

    Parameters

    • Optional string: string

      The string to pad.

    • Optional length: number

      The padding length.

    • Optional chars: string

      The string used as padding.

    Returns string

    Returns the padded string.

  • Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used unless value is a hexadecimal, in which case a radix of 16 is used.

    Note: This method aligns with the ES5 implementation of parseInt.

    Parameters

    • string: string

      The string to convert.

    • Optional radix: number

      The radix to interpret value by.

    Returns number

    Returns the converted integer.

  • Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, while the second of which contains elements predicate returns falsey for. The predicate is invoked with three arguments: (value, index|key, collection).

    Type Parameters

    • T
    • U

    Parameters

    • collection: undefined | null | List<T>

      The collection to iterate over.

    • callback: ValueIteratorTypeGuard<T, U>

      The function called per iteration.

    Returns [U[], Exclude<T, U>[]]

    Returns the array of grouped elements.

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • callback: ValueIteratee<T>

    Returns [T[], T[]]

    See

    _.partition

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • callback: ValueIteratee<T[keyof T]>

    Returns [T[keyof T][], T[keyof T][]]

    See

    _.partition

  • Creates a function that returns the property value at path on a given object.

    Type Parameters

    • TObj
    • TResult

    Parameters

    • path: PropertyPath

      The path of the property to get.

    Returns ((obj) => TResult)

    Returns the new function.

  • The opposite of _.property; this method creates a function that returns the property value at a given path on object.

    Type Parameters

    • T extends {}

    Parameters

    • object: T

      The object to query.

    Returns ((path) => any)

    Returns the new function.

      • (path): any
      • Parameters

        • path: PropertyPath

        Returns any

  • Removes all provided values from array using SameValueZero for equality comparisons.

    Note: Unlike _.without, this method mutates array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • Rest ...values: T[]

      The values to remove.

    Returns T[]

    Returns array.

  • Type Parameters

    • T

    Parameters

    • array: List<T>
    • Rest ...values: T[]

    Returns List<T>

    See

    _.pull

  • Removes elements from array corresponding to the given indexes and returns an array of the removed elements. Indexes may be specified as an array of indexes or as individual arguments.

    Note: Unlike _.at, this method mutates array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • Rest ...indexes: Many<number>[]

      The indexes of elements to remove, specified as individual indexes or arrays of indexes.

    Returns T[]

    Returns the new array of removed elements.

  • Type Parameters

    • T

    Parameters

    • array: List<T>
    • Rest ...indexes: Many<number>[]

    Returns List<T>

    See

    _.pullAt

  • Produces a random number between min and max (inclusive). If only one argument is provided a number between 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point number is returned instead of an integer.

    Parameters

    • Optional floating: boolean

      Specify returning a floating-point number.

    Returns number

    Returns the random number.

  • Parameters

    • max: number
    • Optional floating: boolean

    Returns number

    See

    _.random

  • Parameters

    • min: number
    • max: number
    • Optional floating: boolean

    Returns number

    See

    _.random

  • Parameters

    • min: number
    • index: string | number
    • guard: object

    Returns number

    See

    _.random

  • Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length range is created unless a negative step is specified.

    Parameters

    • start: number

      The start of the range.

    • Optional end: number

      The end of the range.

    • Optional step: number

      The value to increment or decrement by.

    Returns number[]

    Returns a new range array.

  • Parameters

    • end: number
    • index: string | number
    • guard: object

    Returns number[]

    See

    _.range

  • Creates a function that invokes func with arguments arranged according to the specified indexes where the argument value at the first index is provided as the first argument, the argument value at the second index is provided as the second argument, and so on.

    Parameters

    • func: ((...args) => any)

      The function to rearrange arguments for.

        • (...args): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Rest ...indexes: Many<number>[]

      The arranged argument indexes, specified as individual indexes or arrays of indexes.

    Returns ((...args) => any)

    Returns the new function.

      • (...args): any
      • Parameters

        • Rest ...args: any[]

        Returns any

  • Reduces a collection to a value which is the accumulated result of running each element in the collection through the callback, where each successive callback execution consumes the return value of the previous execution. If accumulator is not provided the first element of the collection will be used as the initial accumulator value. The callback is invoked with four arguments: (accumulator, value, index|key, collection).

    Type Parameters

    • T
    • TResult

    Parameters

    • collection: undefined | null | T[]

      The collection to iterate over.

    • callback: MemoListIterator<T, TResult, T[]>

      The function called per iteration.

    • accumulator: TResult

      Initial value of the accumulator.

    Returns TResult

    Returns the accumulated value.

  • Type Parameters

    • T
    • TResult

    Parameters

    • collection: undefined | null | List<T>
    • callback: MemoListIterator<T, TResult, List<T>>
    • accumulator: TResult

    Returns TResult

    See

    _.reduce

  • Type Parameters

    • T extends object
    • TResult

    Parameters

    • collection: undefined | null | T
    • callback: MemoObjectIterator<T[keyof T], TResult, T>
    • accumulator: TResult

    Returns TResult

    See

    _.reduce

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | T[]
    • callback: MemoListIterator<T, T, T[]>

    Returns undefined | T

    See

    _.reduce

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • callback: MemoListIterator<T, T, List<T>>

    Returns undefined | T

    See

    _.reduce

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • callback: MemoObjectIterator<T[keyof T], T[keyof T], T>

    Returns undefined | T[keyof T]

    See

    _.reduce

  • This method is like _.reduce except that it iterates over elements of a collection from right to left.

    Type Parameters

    • T
    • TResult

    Parameters

    • collection: undefined | null | T[]

      The collection to iterate over.

    • callback: MemoListIterator<T, TResult, T[]>

      The function called per iteration.

    • accumulator: TResult

      Initial value of the accumulator.

    Returns TResult

    The accumulated value.

  • Type Parameters

    • T
    • TResult

    Parameters

    • collection: undefined | null | List<T>
    • callback: MemoListIterator<T, TResult, List<T>>
    • accumulator: TResult

    Returns TResult

    See

    _.reduceRight

  • Type Parameters

    • T extends object
    • TResult

    Parameters

    • collection: undefined | null | T
    • callback: MemoObjectIterator<T[keyof T], TResult, T>
    • accumulator: TResult

    Returns TResult

    See

    _.reduceRight

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | T[]
    • callback: MemoListIterator<T, T, T[]>

    Returns undefined | T

    See

    _.reduceRight

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • callback: MemoListIterator<T, T, List<T>>

    Returns undefined | T

    See

    _.reduceRight

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • callback: MemoObjectIterator<T[keyof T], T[keyof T], T>

    Returns undefined | T[keyof T]

    See

    _.reduceRight

  • The opposite of _.filter; this method returns the elements of collection that predicate does not return truthy for.

    Parameters

    • collection: undefined | null | string

      The collection to iterate over.

    • Optional predicate: StringIterator<boolean>

      The function invoked per iteration.

    Returns string[]

    Returns the new filtered array.

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • Optional predicate: ListIterateeCustom<T, boolean>

    Returns T[]

    See

    _.reject

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional predicate: ObjectIterateeCustom<T, boolean>

    Returns T[keyof T][]

    See

    _.reject

  • Removes all elements from array that predicate returns truthy for and returns an array of the removed elements. The predicate is invoked with three arguments: (value, index, array).

    Note: Unlike _.filter, this method mutates array.

    Type Parameters

    • T

    Parameters

    • array: List<T>

      The array to modify.

    • Optional predicate: ListIteratee<T>

      The function invoked per iteration.

    Returns T[]

    Returns the new array of removed elements.

  • Repeats the given string n times.

    Parameters

    • Optional string: string

      The string to repeat.

    • Optional n: number

      The number of times to repeat the string.

    Returns string

    Returns the repeated string.

  • Replaces matches for pattern in string with replacement.

    Note: This method is based on String#replace.

    Parameters

    • string: string
    • pattern: string | RegExp
    • replacement: string | ReplaceFunction

    Returns string

    Returns the modified string.

  • Parameters

    • pattern: string | RegExp
    • replacement: string | ReplaceFunction

    Returns string

    See

    _.replace

  • Creates a function that invokes func with the this binding of the created function and arguments from start and beyond provided as an array.

    Note: This method is based on the rest parameter.

    Parameters

    • func: ((...args) => any)

      The function to apply a rest parameter to.

        • (...args): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional start: number

      The start position of the rest parameter.

    Returns ((...args) => any)

    Returns the new function.

      • (...args): any
      • Parameters

        • Rest ...args: any[]

        Returns any

  • This method is like _.get except that if the resolved value is a function it’s invoked with the this binding of its parent object and its result is returned.

    Type Parameters

    • TResult

    Parameters

    • object: any

      The object to query.

    • path: PropertyPath

      The path of the property to resolve.

    • Optional defaultValue: TResult | ((...args) => TResult)

      The value returned if the resolved value is undefined.

    Returns TResult

    Returns the resolved value.

  • Calculates n rounded to precision.

    Parameters

    • n: number

      The number to round.

    • Optional precision: number

      The precision to round to.

    Returns number

    Returns the rounded number.

  • Create a new pristine lodash function using the given context object.

    Parameters

    • Optional context: object

      The context object.

    Returns LoDashStatic

    Returns a new lodash function.

  • Gets a random element from collection.

    Type Parameters

    • T

    Parameters

    • collection: readonly [T, T]

      The collection to sample.

    Returns T

    Returns the random element.

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | Dictionary<T> | NumericDictionary<T>

    Returns undefined | T

    See

    _.sample

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T

    Returns undefined | T[keyof T]

    See

    _.sample

  • Gets n random elements at unique keys from collection up to the size of collection.

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | Dictionary<T> | NumericDictionary<T>

      The collection to sample.

    • Optional n: number

      The number of elements to sample.

    Returns T[]

    Returns the random elements.

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional n: number

    Returns T[keyof T][]

    See

    _.sampleSize

  • Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for missing index properties while objects are created for all other missing properties. Use _.setWith to customize path creation.

    Type Parameters

    • T extends object

    Parameters

    • object: T

      The object to modify.

    • path: PropertyPath

      The path of the property to set.

    • value: any

      The value to set.

    Returns T

    Returns object.

  • Type Parameters

    • TResult

    Parameters

    • object: object
    • path: PropertyPath
    • value: any

    Returns TResult

    See

    _.set

  • This method is like _.set except that it accepts customizer which is invoked to produce the objects of path. If customizer returns undefined path creation is handled by the method instead. The customizer is invoked with three arguments: (nsValue, key, nsObject).

    Type Parameters

    • T extends object

    Parameters

    • object: T

      The object to modify.

    • path: PropertyPath

      The path of the property to set.

    • value: any

      The value to set.

    • Optional customizer: SetWithCustomizer<T>

      The function to customize assigned values.

    Returns T

    Returns object.

  • Type Parameters

    • T extends object
    • TResult

    Parameters

    • object: T
    • path: PropertyPath
    • value: any
    • Optional customizer: SetWithCustomizer<T>

    Returns TResult

    See

    _.setWith

  • Creates an array of shuffled values, using a version of the Fisher-Yates shuffle.

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>

      The collection to shuffle.

    Returns T[]

    Returns the new shuffled array.

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T

    Returns T[keyof T][]

    See

    _.shuffle

  • Gets the size of collection by returning its length for array-like values or the number of own enumerable properties for objects.

    Parameters

    • collection: undefined | null | string | object

      The collection to inspect.

    Returns number

    Returns the size of collection.

  • Creates a slice of array from start up to, but not including, end.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to slice.

    • Optional start: number

      The start position.

    • Optional end: number

      The end position.

    Returns T[]

    Returns the slice of array.

  • Converts string to snake case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the snake cased string.

  • Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate returns truthy. The predicate is invoked with three arguments: (value, index|key, collection).

    Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>

      The collection to iterate over.

    • Optional predicate: ListIterateeCustom<T, boolean>

      The function invoked per iteration.

    Returns boolean

    Returns true if any element passes the predicate check, else false.

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optional predicate: ObjectIterateeCustom<T, boolean>

    Returns boolean

    See

    _.some

  • Splits string by separator.

    Note: This method is based on String#split.

    Parameters

    • string: undefined | null | string

      The string to split.

    • Optional separator: string | RegExp

      The separator pattern to split by.

    • Optional limit: number

      The length to truncate results to.

    Returns string[]

    Returns the new array of string segments.

  • Parameters

    • string: undefined | null | string
    • index: string | number
    • guard: object

    Returns string[]

    See

    _.split

  • Creates a function that invokes func with the this binding of the created function and an array of arguments much like Function#apply.

    Note: This method is based on the spread operator.

    Type Parameters

    • TResult

    Parameters

    • func: ((...args) => TResult)

      The function to spread arguments over.

    • Optional start: number

    Returns ((...args) => TResult)

    Returns the new function.

  • Converts string to start case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the start cased string.

  • Checks if string starts with the given target string.

    Parameters

    • Optional string: string

      The string to search.

    • Optional target: string

      The string to search for.

    • Optional position: number

      The position to search from.

    Returns boolean

    Returns true if string starts with target, else false.

  • This method returns a new empty array.

    Returns any[]

    Returns the new empty array.

  • This method returns false.

    Returns false

    Returns false.

  • This method returns false.

    Returns false

    Returns false.

  • This method returns a new empty object.

    Returns any

    Returns the new empty object.

  • This method returns an empty string.

    Returns string

    Returns the empty string.

  • This method returns true.

    Returns true

    Returns true.

  • This method returns true.

    Returns true

    Returns true.

  • Gets all but the first element of array.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    Returns T[]

    Returns the slice of array.

  • Creates a slice of array with n elements taken from the beginning.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    • Optional n: number

      The number of elements to take.

    Returns T[]

    Returns the slice of array.

  • Creates a slice of array with n elements taken from the end.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    • Optional n: number

      The number of elements to take.

    Returns T[]

    Returns the slice of array.

  • Creates a slice of array with elements taken from the end. Elements are taken until predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    • Optional predicate: ListIteratee<T>

      The function invoked per iteration.

    Returns T[]

    Returns the slice of array.

  • Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns falsey. The predicate is invoked with three arguments: (value, index, array).

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to query.

    • Optional predicate: ListIteratee<T>

      The function invoked per iteration.

    Returns T[]

    Returns the slice of array.

  • This method invokes interceptor and returns value. The interceptor is invoked with one argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations on intermediate results within the chain.

    Type Parameters

    • T

    Parameters

    • value: T

      The value to provide to interceptor.

    • interceptor: ((value) => void)

      The function to invoke.

        • (value): void
        • Parameters

          • value: T

          Returns void

    Returns T

    Returns value.

  • Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data properties may be accessed as free variables in the template. If a setting object is provided it takes precedence over _.templateSettings values.

    Note: In the development build _.template utilizes sourceURLs for easier debugging.

    For more information on precompiling templates see lodash's custom builds documentation.

    For more information on Chrome extension sandboxes see Chrome's extensions documentation.

    Parameters

    • Optional string: string

      The template string.

    • Optional options: TemplateOptions

      The options object.

    Returns TemplateExecutor

    Returns the compiled template function.

  • Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls to the throttled function return the result of the last func call.

    Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if the the throttled function is invoked more than once during the wait timeout.

    Type Parameters

    • T extends ((...args) => any)

    Parameters

    • func: T

      The function to throttle.

    • Optional wait: number

      The number of milliseconds to throttle invocations to.

    • Optional options: ThrottleSettings

      The options object.

    Returns DebouncedFunc<T>

    Returns the new throttled function.

  • This method is like _.tap except that it returns the result of interceptor.

    Type Parameters

    • T
    • TResult

    Parameters

    • value: T

      The value to provide to interceptor.

    • interceptor: ((value) => TResult)

      The function to invoke.

    Returns TResult

    Returns the result of interceptor.

  • Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee is invoked with one argument; (index).

    Type Parameters

    • TResult

    Parameters

    • n: number

      The number of times to invoke iteratee.

    • iteratee: ((num) => TResult)

      The function invoked per iteration.

    Returns TResult[]

    Returns the array of results.

  • Parameters

    • n: number

    Returns number[]

    See

    _.times

  • Converts value to an array.

    Type Parameters

    • T

    Parameters

    • value: undefined | null | Dictionary<T> | NumericDictionary<T>

      The value to convert.

    Returns T[]

    Returns the converted array.

  • Type Parameters

    • T

    Parameters

    • value: T

    Returns T[keyof T][]

    See

    _.toArray

  • Returns any[]

    See

    _.toArray

  • Converts string, as a whole, to lower case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the lower cased string.

  • Creates an array of own enumerable key-value pairs for object.

    Type Parameters

    • T

    Parameters

    • Optional object: Dictionary<T> | NumericDictionary<T>

      The object to query.

    Returns [string, T][]

    Returns the new array of key-value pairs.

  • Parameters

    • Optional object: object

    Returns [string, any][]

    See

    _.toPairs

  • Creates an array of own and inherited enumerable key-value pairs for object.

    Type Parameters

    • T

    Parameters

    • Optional object: Dictionary<T> | NumericDictionary<T>

      The object to query.

    Returns [string, T][]

    Returns the new array of key-value pairs.

  • Parameters

    • Optional object: object

    Returns [string, any][]

    See

    _.toPairsIn

  • Converts value to a plain object flattening inherited enumerable properties of value to own properties of the plain object.

    Parameters

    • Optional value: any

      The value to convert.

    Returns any

    Returns the converted plain object.

  • Converts string, as a whole, to upper case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the upper cased string.

  • An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of running each of its own enumerable properties through iteratee, with each invocation potentially mutating the accumulator object. The iteratee is invoked with four arguments: (accumulator, value, key, object). Iteratee functions may exit iteration early by explicitly returning false.

    Type Parameters

    • T
    • TResult

    Parameters

    • object: readonly T[]

      The object to iterate over.

    • iteratee: MemoVoidArrayIterator<T, TResult>

      The function invoked per iteration.

    • Optional accumulator: TResult

      The custom accumulator value.

    Returns TResult

    Returns the accumulated value.

  • Type Parameters

    • T
    • TResult

    Parameters

    • object: Dictionary<T>
    • iteratee: MemoVoidDictionaryIterator<T, string, TResult>
    • Optional accumulator: TResult

    Returns TResult

    See

    _.transform

  • Type Parameters

    • T extends object
    • TResult

    Parameters

    • object: T
    • iteratee: MemoVoidDictionaryIterator<T[keyof T], keyof T, TResult>
    • Optional accumulator: TResult

    Returns TResult

    See

    _.transform

  • Parameters

    • object: any[]

    Returns any[]

    See

    _.transform

  • Parameters

    • object: object

    Returns Dictionary<any>

    See

    _.transform

  • Removes leading and trailing whitespace or specified characters from string.

    Parameters

    • Optional string: string

      The string to trim.

    • Optional chars: string

      The characters to trim.

    Returns string

    Returns the trimmed string.

  • Parameters

    • string: string
    • index: string | number
    • guard: object

    Returns string

    See

    _.trim

  • Removes trailing whitespace or specified characters from string.

    Parameters

    • Optional string: string

      The string to trim.

    • Optional chars: string

      The characters to trim.

    Returns string

    Returns the trimmed string.

  • Parameters

    • string: string
    • index: string | number
    • guard: object

    Returns string

    See

    _.trimEnd

  • Removes leading whitespace or specified characters from string.

    Parameters

    • Optional string: string

      The string to trim.

    • Optional chars: string

      The characters to trim.

    Returns string

    Returns the trimmed string.

  • Parameters

    • string: string
    • index: string | number
    • guard: object

    Returns string

    See

    _.trimStart

  • Truncates string if it’s longer than the given maximum string length. The last characters of the truncated string are replaced with the omission string which defaults to "…".

    Parameters

    • Optional string: string

      The string to truncate.

    • Optional options: TruncateOptions

      The options object or maximum string length.

    Returns string

    Returns the truncated string.

  • The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` in string to their corresponding characters.

    Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library like he.

    Parameters

    • Optional string: string

      The string to unescape.

    Returns string

    Returns the unescaped string.

  • Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for equality comparisons.

    Type Parameters

    • T

    Parameters

    • Rest ...arrays: (undefined | null | List<T>)[]

      The arrays to inspect.

    Returns T[]

    Returns the new array of combined values.

  • This method is like _.union except that it accepts iteratee which is invoked for each element of each arrays to generate the criterion by which uniqueness is computed. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • arrays: undefined | null | List<T>

      The arrays to inspect.

    • Optional iteratee: ValueIteratee<T>

      The iteratee invoked per element.

    Returns T[]

    Returns the new array of combined values.

  • Type Parameters

    • T

    Parameters

    • arrays1: undefined | null | List<T>
    • arrays2: undefined | null | List<T>
    • Optional iteratee: ValueIteratee<T>

    Returns T[]

    See

    _.unionBy

  • Type Parameters

    • T

    Parameters

    • arrays1: undefined | null | List<T>
    • arrays2: undefined | null | List<T>
    • arrays3: undefined | null | List<T>
    • Optional iteratee: ValueIteratee<T>

    Returns T[]

    See

    _.unionBy

  • Type Parameters

    • T

    Parameters

    • arrays1: undefined | null | List<T>
    • arrays2: undefined | null | List<T>
    • arrays3: undefined | null | List<T>
    • arrays4: undefined | null | List<T>
    • Optional iteratee: ValueIteratee<T>

    Returns T[]

    See

    _.unionBy

  • Type Parameters

    • T

    Parameters

    • arrays1: undefined | null | List<T>
    • arrays2: undefined | null | List<T>
    • arrays3: undefined | null | List<T>
    • arrays4: undefined | null | List<T>
    • arrays5: undefined | null | List<T>
    • Rest ...iteratee: (undefined | null | List<T> | ValueIteratee<T>)[]

    Returns T[]

    See

    _.unionBy

  • Generates a unique ID. If prefix is provided the ID is appended to it.

    Parameters

    • Optional prefix: string

      The value to prefix the ID with.

    Returns string

    Returns the unique ID.

  • Removes the property at path of object.

    Note: This method mutates object.

    Parameters

    • object: any

      The object to modify.

    • path: PropertyPath

      The path of the property to unset.

    Returns boolean

    Returns true if the property is deleted, else false.

  • This method is like _.zip except that it accepts an array of grouped elements and creates an array regrouping the elements to their pre-zip configuration.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | T[][] | List<List<T>>

      The array of grouped elements to process.

    Returns T[][]

    Returns the new array of regrouped elements.

  • This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be combined. The iteratee is invoked with four arguments: (accumulator, value, index, group).

    Type Parameters

    • T
    • TResult

    Parameters

    • array: undefined | null | List<List<T>>

      The array of grouped elements to process.

    • iteratee: ((...values) => TResult)

      The function to combine regrouped values.

    Returns TResult[]

    Returns the new array of regrouped elements.

  • Type Parameters

    • T

    Parameters

    • array: undefined | null | List<List<T>>

    Returns T[][]

    See

    _.unzipWith

  • This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to customize path creation. The updater is invoked with one argument: (value).

    Parameters

    • object: object

      The object to modify.

    • path: PropertyPath

      The path of the property to set.

    • updater: ((value) => any)

      The function to produce the updated value.

        • (value): any
        • Parameters

          • value: any

          Returns any

    Returns any

    Returns object.

  • Converts string, as space separated words, to upper case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the upper cased string.

  • Converts the first character of string to upper case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the converted string.

  • Creates an array of the own enumerable property values of object.

    Type Parameters

    • T

    Parameters

    • object: undefined | null | Dictionary<T> | NumericDictionary<T> | List<T>

      The object to query.

    Returns T[]

    Returns an array of property values.

  • Type Parameters

    • T extends object

    Parameters

    • object: undefined | null | T

    Returns T[keyof T][]

    See

    _.values

  • Parameters

    • object: any

    Returns any[]

    See

    _.values

  • Creates an array of the own and inherited enumerable property values of object.

    Type Parameters

    • T

    Parameters

    • object: undefined | null | Dictionary<T> | NumericDictionary<T> | List<T>

      The object to query.

    Returns T[]

    Returns the array of property values.

  • Type Parameters

    • T extends object

    Parameters

    • object: undefined | null | T

    Returns T[keyof T][]

    See

    _.valuesIn

  • Creates an array excluding all provided values using SameValueZero for equality comparisons.

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to filter.

    • Rest ...values: T[]

      The values to exclude.

    Returns T[]

    Returns the new array of filtered values.

  • Splits string into an array of its words.

    Parameters

    • Optional string: string

      The string to inspect.

    • Optional pattern: string | RegExp

      The pattern to match words.

    Returns string[]

    Returns the words of string.

  • Parameters

    • string: string
    • index: string | number
    • guard: object

    Returns string[]

    See

    _.words

  • Creates a function that provides value to the wrapper function as its first argument. Any additional arguments provided to the function are appended to those provided to the wrapper function. The wrapper is invoked with the this binding of the created function.

    Type Parameters

    • T
    • TArgs
    • TResult

    Parameters

    • value: T

      The value to wrap.

    • wrapper: ((value, ...args) => TResult)

      The wrapper function.

    Returns ((...args) => TResult)

    Returns the new function.

  • Creates an array of unique values that is the symmetric difference of the provided arrays.

    Type Parameters

    • T

    Parameters

    • Rest ...arrays: (undefined | null | List<T>)[]

      The arrays to inspect.

    Returns T[]

    Returns the new array of values.

  • Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on.

    Type Parameters

    • T1
    • T2

    Parameters

    • arrays1: List<T1>
    • arrays2: List<T2>

    Returns [undefined | T1, undefined | T2][]

    Returns the new array of grouped elements.

  • Type Parameters

    • T1
    • T2
    • T3

    Parameters

    • arrays1: List<T1>
    • arrays2: List<T2>
    • arrays3: List<T3>

    Returns [undefined | T1, undefined | T2, undefined | T3][]

    See

    _.zip

  • Type Parameters

    • T1
    • T2
    • T3
    • T4

    Parameters

    • arrays1: List<T1>
    • arrays2: List<T2>
    • arrays3: List<T3>
    • arrays4: List<T4>

    Returns [undefined | T1, undefined | T2, undefined | T3, undefined | T4][]

    See

    _.zip

  • Type Parameters

    • T1
    • T2
    • T3
    • T4
    • T5

    Parameters

    • arrays1: List<T1>
    • arrays2: List<T2>
    • arrays3: List<T3>
    • arrays4: List<T4>
    • arrays5: List<T5>

    Returns [undefined | T1, undefined | T2, undefined | T3, undefined | T4, undefined | T5][]

    See

    _.zip

  • Type Parameters

    • T

    Parameters

    • Rest ...arrays: (undefined | null | List<T>)[]

    Returns (undefined | T)[][]

    See

    _.zip

  • This method is like _.fromPairs except that it accepts two arrays, one of property identifiers and one of corresponding values.

    Type Parameters

    • T

    Parameters

    • props: List<PropertyName>

      The property names.

    • values: List<T>

      The property values.

    Returns Dictionary<T>

    Returns the new object.

  • Parameters

    • Optional props: List<PropertyName>

    Returns Dictionary<undefined>

    See

    _.zipObject

  • This method is like _.zipObject except that it supports property paths.

    Parameters

    • Optional paths: List<PropertyPath>

      The property names.

    • Optional values: List<any>

      The property values.

    Returns object

    Returns the new object.

  • This method is like _.zip except that it accepts an iteratee to specify how grouped values should be combined. The iteratee is invoked with four arguments: (accumulator, value, index, group).

    Type Parameters

    • T
    • TResult

    Parameters

    • arrays: List<T>

      The arrays to process.

    • iteratee: ((value1) => TResult)

      The function to combine grouped values.

    Returns TResult[]

    Returns the new array of grouped elements.

  • Type Parameters

    • T1
    • T2
    • TResult

    Parameters

    Returns TResult[]

    See

    _.zipWith

  • Type Parameters

    • T1
    • T2
    • T3
    • TResult

    Parameters

    • arrays1: List<T1>
    • arrays2: List<T2>
    • arrays3: List<T3>
    • iteratee: ((value1, value2, value3) => TResult)

    Returns TResult[]

    See

    _.zipWith

  • Type Parameters

    • T1
    • T2
    • T3
    • T4
    • TResult

    Parameters

    • arrays1: List<T1>
    • arrays2: List<T2>
    • arrays3: List<T3>
    • arrays4: List<T4>
    • iteratee: ((value1, value2, value3, value4) => TResult)

    Returns TResult[]

    See

    _.zipWith

  • Type Parameters

    • T1
    • T2
    • T3
    • T4
    • T5
    • TResult

    Parameters

    • arrays1: List<T1>
    • arrays2: List<T2>
    • arrays3: List<T3>
    • arrays4: List<T4>
    • arrays5: List<T5>
    • iteratee: ((value1, value2, value3, value4, value5) => TResult)
        • (value1, value2, value3, value4, value5): TResult
        • Parameters

          • value1: T1
          • value2: T2
          • value3: T3
          • value4: T4
          • value5: T5

          Returns TResult

    Returns TResult[]

    See

    _.zipWith

  • Type Parameters

    • T
    • TResult

    Parameters

    • Rest ...iteratee: (undefined | null | ((...group) => TResult) | List<T>)[]

    Returns TResult[]

    See

    _.zipWith

Util

  • Creates a function that iterates over pairs and invokes the corresponding function of the first predicate to return truthy. The predicate-function pairs are invoked with the this binding and arguments of the created function.

    Type Parameters

    • R

    Parameters

    • pairs: CondPairNullary<R>[]

      The predicate-function pairs.

    Returns (() => R)

    Returns the new composite function.

      • (): R
      • Returns R

    Since

    4.0.0

    Example

    var func = _.cond([
    [_.matches({ 'a': 1 }), _.constant('matches A')],
    [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
    [_.stubTrue, _.constant('no match')]
    ]);

    func({ 'a': 1, 'b': 2 });
    // => 'matches A'

    func({ 'a': 0, 'b': 1 });
    // => 'matches B'

    func({ 'a': '1', 'b': '2' });
    // => 'no match'
  • Type Parameters

    • T
    • R

    Parameters

    • pairs: CondPairUnary<T, R>[]

    Returns ((Target) => R)

      • (Target): R
      • Parameters

        • Target: T

        Returns R

  • Creates a function that invokes func with the arguments of the created function. If func is a property name the created callback returns the property value for a given element. If func is an object the created callback returns true for elements that contain the equivalent object properties, otherwise it returns false.

    Type Parameters

    • TFunction extends ((...args) => any)

    Parameters

    • Optional func: TFunction

      The value to convert to a callback.

    Returns TFunction

    Returns the callback.

    Example

    var users = [
    { 'user': 'barney', 'age': 36 },
    { 'user': 'fred', 'age': 40 }
    ];

    // create custom iteratee shorthands
    _.iteratee = _.wrap(_.iteratee, function(callback, func) {
    var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func);
    return !p ? callback(func) : function(object) {
    return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);
    };
    });

    _.filter(users, 'age > 36');
    // => [{ 'user': 'fred', 'age': 40 }]
  • Parameters

    • func: string | number | symbol | object

    Returns ((...args) => any)

      • (...args): any
      • Parameters

        • Rest ...args: any[]

        Returns any

    See

    _.iteratee

  • This method is like _.range except that it populates values in descending order.

    Parameters

    • start: number

      The start of the range.

    • Optional end: number

      The end of the range.

    • Optional step: number

      The value to increment or decrement by.

    Returns number[]

    Returns the new array of numbers.

    Example

    _.rangeRight(4);
    // => [3, 2, 1, 0]

    _.rangeRight(-4);
    // => [-3, -2, -1, 0]

    _.rangeRight(1, 5);
    // => [4, 3, 2, 1]

    _.rangeRight(0, 20, 5);
    // => [15, 10, 5, 0]

    _.rangeRight(0, -4, -1);
    // => [-3, -2, -1, 0]

    _.rangeRight(1, 4, 0);
    // => [1, 1, 1]

    _.rangeRight(0);
    // => []
  • Parameters

    • end: number
    • index: string | number
    • guard: object

    Returns number[]

    See

    _.rangeRight

  • Converts value to a property path array.

    Parameters

    • value: any

      The value to convert.

    Returns string[]

    Returns the new property path array.

    Example

    _.toPath('a.b.c');
    // => ['a', 'b', 'c']

    _.toPath('a[0].b.c');
    // => ['a', '0', 'b', 'c']

    var path = ['a', 'b', 'c'],
    newPath = _.toPath(path);

    console.log(newPath);
    // => ['a', 'b', 'c']

    console.log(path === newPath);
    // => false