Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

References

Interfaces

Variables

Functions Array

Functions Collection

Functions Function

Functions Lang

Functions Math

Functions Number

Functions Object

Functions Other

Functions Util

References

forEach

Renames and re-exports __type

forEachRight

Renames and re-exports __type

head

Renames and re-exports __type

Variables

bind

bind: FunctionBind

bindKey

bindKey: FunctionBindKey

curry

curry: Curry

curryRight

curryRight: CurryRight

each

each: { <T>(collection: T[], iteratee?: ArrayIterator<T, any>): T[]; (collection: string, iteratee?: StringIterator<any>): string; <T>(collection: List<T>, iteratee?: ListIterator<T, any>): List<T>; <T>(collection: T, iteratee?: ObjectIterator<T, any>): T; <T, TArray>(collection: (TArray & undefined) & (TArray & null) & (TArray & T[]), iteratee?: ArrayIterator<T, any>): TArray; <TString>(collection: TString, iteratee?: StringIterator<any>): TString; <T, TList>(collection: (TList & undefined) & (TList & null) & (TList & List<T>), iteratee?: ListIterator<T, any>): TList; <T>(collection: undefined | null | T, iteratee?: ObjectIterator<T, any>): undefined | null | T }

Type declaration

    • <T>(collection: T[], iteratee?: ArrayIterator<T, any>): T[]
    • (collection: string, iteratee?: StringIterator<any>): string
    • <T>(collection: List<T>, iteratee?: ListIterator<T, any>): List<T>
    • <T>(collection: T, iteratee?: ObjectIterator<T, any>): T
    • <T, TArray>(collection: (TArray & undefined) & (TArray & null) & (TArray & T[]), iteratee?: ArrayIterator<T, any>): TArray
    • <TString>(collection: TString, iteratee?: StringIterator<any>): TString
    • <T, TList>(collection: (TList & undefined) & (TList & null) & (TList & List<T>), iteratee?: ListIterator<T, any>): TList
    • <T>(collection: undefined | null | T, iteratee?: ObjectIterator<T, any>): undefined | null | T
    • 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.

      alias

      _.each

      Type parameters

      • T

      Parameters

      • collection: T[]

        The collection to iterate over.

      • Optional iteratee: ArrayIterator<T, any>

        The function invoked per iteration.

      Returns T[]

    • see

      _.forEach

      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: object

      Parameters

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

      Returns T

    • see

      _.forEach

      Type parameters

      • T

      • TArray: undefined | null | T[]

      Parameters

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

      Returns TArray

    • see

      _.forEach

      Type parameters

      • TString: undefined | null | string

      Parameters

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

      Returns TString

    • see

      _.forEach

      Type parameters

      • T

      • TList: undefined | null | List<T>

      Parameters

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

      Returns TList

    • see

      _.forEach

      Type parameters

      • T: object

      Parameters

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

      Returns undefined | null | T

eachRight

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

Type declaration

    • <T>(collection: T[], iteratee?: ArrayIterator<T, any>): T[]
    • (collection: string, iteratee?: StringIterator<any>): string
    • <T>(collection: List<T>, iteratee?: ListIterator<T, any>): List<T>
    • <T>(collection: T, iteratee?: ObjectIterator<T, any>): T
    • <T, TArray>(collection: (TArray & undefined) & (TArray & null) & (TArray & T[]), iteratee?: ArrayIterator<T, any>): TArray
    • <TString>(collection: TString, iteratee?: StringIterator<any>): TString
    • <T, TList>(collection: (TList & undefined) & (TList & null) & (TList & List<T>), iteratee?: ListIterator<T, any>): TList
    • <T>(collection: undefined | null | T, iteratee?: ObjectIterator<T, any>): undefined | null | T
    • This method is like _.forEach except that it iterates over elements of collection from right to left.

      alias

      _.eachRight

      Type parameters

      • T

      Parameters

      • collection: T[]

        The collection to iterate over.

      • Optional iteratee: ArrayIterator<T, any>

        The function called per iteration.

      Returns T[]

    • see

      _.forEachRight

      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: object

      Parameters

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

      Returns T

    • see

      _.forEachRight

      Type parameters

      • T

      • TArray: undefined | null | T[]

      Parameters

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

      Returns TArray

    • see

      _.forEachRight

      Type parameters

      • TString: undefined | null | string

      Parameters

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

      Returns TString

    • see

      _.forEachRight

      Type parameters

      • T

      • TList: undefined | null | List<T>

      Parameters

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

      Returns TList

    • see

      _.forEachRight

      Type parameters

      • T: object

      Parameters

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

      Returns undefined | null | T

first

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

Type declaration

    • <T>(array: undefined | null | List<T>): undefined | T
    • Gets the first element of array.

      alias

      _.first

      Type parameters

      • T

      Parameters

      • array: undefined | null | List<T>

        The array to query.

      Returns undefined | T

      Returns the first element of array.

memoize

memoize: { Cache: MapCacheConstructor }

Type declaration

    • <T>(func: T, resolver?: (...args: Parameters<T>) => any): T & MemoizedFunction
    • Type parameters

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

      Parameters

      • func: T
      • Optional resolver: (...args: Parameters<T>) => any
          • (...args: Parameters<T>): any
          • Parameters

            • Rest ...args: Parameters<T>

            Returns any

      Returns T & MemoizedFunction

  • Cache: MapCacheConstructor

partial

partial: Partial

partialRight

partialRight: PartialRight

templateSettings

templateSettings: TemplateSettings

Array Functions

concat

  • concat<T>(array: Many<T>, ...values: Many<T>[]): T[]
  • Creates a new array concatenating array with any additional arrays and/or values.

    example

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

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

    console.log(array); // => [1]

    Type parameters

    • T

    Parameters

    • array: Many<T>

      The array to concatenate.

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

    Returns T[]

    Returns the new concatenated array.

differenceWith

  • differenceWith<T1, T2>(array: undefined | null | List<T1>, values: List<T2>, comparator: Comparator2<T1, T2>): T1[]
  • differenceWith<T1, T2, T3>(array: undefined | null | List<T1>, values1: List<T2>, values2: List<T3>, comparator: Comparator2<T1, T2 | T3>): T1[]
  • differenceWith<T1, T2, T3, T4>(array: undefined | null | List<T1>, values1: List<T2>, values2: List<T3>, ...values: (List<T4> | Comparator2<T1, T2 | T3 | T4>)[]): T1[]
  • differenceWith<T>(array: undefined | null | List<T>, ...values: List<T>[]): T[]
  • Creates an array of unique array values not included in the other provided arrays using SameValueZero for equality comparisons.

    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

    Parameters

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

    Returns T1[]

    Returns the new array of filtered values.

  • see

    _.differenceWith

    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[]

fromPairs

  • fromPairs<T>(pairs: undefined | null | List<[PropertyName, T]>): Dictionary<T>
  • fromPairs(pairs: undefined | null | List<any[]>): Dictionary<any>
  • The inverse of _.toPairs; this method returns an object composed from key-value pairs.

    example

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

    Type parameters

    • T

    Parameters

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

      The key-value pairs.

    Returns Dictionary<T>

    Returns the new object.

  • see

    _.fromPairs

    Parameters

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

    Returns Dictionary<any>

indexOf

  • indexOf<T>(array: undefined | null | List<T>, value: T, fromIndex?: number): number
  • 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.

    example

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

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

    Type parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to search.

    • value: T

      The value to search for.

    • Optional fromIndex: number

    Returns number

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

intersectionBy

  • intersectionBy<T1, T2>(array: null | List<T1>, values: List<T2>, iteratee: ValueIteratee<T1 | T2>): T1[]
  • intersectionBy<T1, T2, T3>(array: null | List<T1>, values1: List<T2>, values2: List<T3>, iteratee: ValueIteratee<T1 | T2 | T3>): T1[]
  • intersectionBy<T1, T2, T3, T4>(array: undefined | null | List<T1>, values1: List<T2>, values2: List<T3>, ...values: (List<T4> | ValueIteratee<T1 | T2 | T3 | T4>)[]): T1[]
  • intersectionBy<T>(array?: null | List<T>, ...values: List<T>[]): T[]
  • intersectionBy<T>(...values: (List<T> | ValueIteratee<T>)[]): T[]
  • 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).

    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

    Parameters

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

    Returns T1[]

    Returns the new array of shared values.

  • see

    _.intersectionBy

    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[]

intersectionWith

  • intersectionWith<T1, T2>(array: undefined | null | List<T1>, values: List<T2>, comparator: Comparator2<T1, T2>): T1[]
  • intersectionWith<T1, T2, T3>(array: undefined | null | List<T1>, values1: List<T2>, values2: List<T3>, comparator: Comparator2<T1, T2 | T3>): T1[]
  • intersectionWith<T1, T2, T3, T4>(array: undefined | null | List<T1>, values1: List<T2>, values2: List<T3>, ...values: (List<T4> | Comparator2<T1, T2 | T3 | T4>)[]): T1[]
  • intersectionWith<T>(array?: null | List<T>, ...values: (List<T> | Comparator2<T, never>)[]): T[]
  • Creates an array of unique array values not included in the other provided arrays using SameValueZero for equality comparisons.

    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

    Parameters

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

    Returns T1[]

    Returns the new array of filtered values.

  • see

    _.intersectionWith

    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[]

pullAll

  • pullAll<T>(array: T[], values?: List<T>): T[]
  • pullAll<T>(array: List<T>, values?: List<T>): List<T>
  • This method is like _.pull except that it accepts an array of values to remove.

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

    example

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

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

    Type parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • Optional values: List<T>

      The values to remove.

    Returns T[]

    Returns array.

  • see

    _.pullAll

    Type parameters

    • T

    Parameters

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

    Returns List<T>

pullAllBy

  • pullAllBy<T>(array: T[], values?: List<T>, iteratee?: ValueIteratee<T>): T[]
  • pullAllBy<T>(array: List<T>, values?: List<T>, iteratee?: ValueIteratee<T>): List<T>
  • pullAllBy<T1, T2>(array: T1[], values: List<T2>, iteratee: ValueIteratee<T1 | T2>): T1[]
  • pullAllBy<T1, T2>(array: List<T1>, values: List<T2>, iteratee: ValueIteratee<T1 | T2>): List<T1>
  • 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.

    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: T[]

      The array to modify.

    • Optional values: List<T>

      The values to remove.

    • Optional iteratee: ValueIteratee<T>

    Returns T[]

    Returns array.

  • see

    _.pullAllBy

    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>

pullAllWith

  • pullAllWith<T>(array: T[], values?: List<T>, comparator?: Comparator<T>): T[]
  • pullAllWith<T>(array: List<T>, values?: List<T>, comparator?: Comparator<T>): List<T>
  • pullAllWith<T1, T2>(array: T1[], values: List<T2>, comparator: Comparator2<T1, T2>): T1[]
  • pullAllWith<T1, T2>(array: List<T1>, values: List<T2>, comparator: Comparator2<T1, T2>): List<T1>
  • 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.

    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: T[]

      The array to modify.

    • Optional values: List<T>

      The values to remove.

    • Optional comparator: Comparator<T>

    Returns T[]

    Returns array.

  • see

    _.pullAllWith

    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>

reverse

  • reverse<TList>(array: TList): TList
  • 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.

    example

    var array = [1, 2, 3];

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

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

    Type parameters

    • TList: ArrayLike<any, TList>

    Parameters

    • array: TList

    Returns TList

    Returns array.

sortedIndex

  • sortedIndex<T>(array: undefined | null | List<T>, value: T): number
  • sortedIndex<T>(array: undefined | null | List<T>, value: T): number
  • Uses a binary search to determine the lowest index at which value should be inserted into array in order to maintain its sort order.

    example

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

    _.sortedIndex([4, 5], 4); // => 0

    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.

  • Uses a binary search to determine the lowest index at which value should be inserted into array in order to maintain its sort order.

    example

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

    _.sortedIndex([4, 5], 4); // => 0

    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.

sortedIndexBy

  • sortedIndexBy<T>(array: undefined | null | List<T>, value: T, iteratee?: ValueIteratee<T>): number
  • 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).

    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

    Type parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The sorted array to inspect.

    • value: T

      The value to evaluate.

    • Optional iteratee: ValueIteratee<T>

    Returns number

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

sortedIndexOf

  • sortedIndexOf<T>(array: undefined | null | List<T>, value: T): number
  • This method is like _.indexOf except that it performs a binary search on a sorted array.

    example

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

    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.

sortedLastIndex

  • sortedLastIndex<T>(array: undefined | null | List<T>, value: T): number
  • 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.

    example

    _.sortedLastIndex([4, 5], 4); // => 1

    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.

sortedLastIndexBy

  • sortedLastIndexBy<T>(array: undefined | null | List<T>, value: T, iteratee: ValueIteratee<T>): number
  • 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).

    example

    // using the _.property iteratee shorthand _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); // => 1

    Type parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The sorted array to inspect.

    • value: T

      The value to evaluate.

    • iteratee: ValueIteratee<T>

    Returns number

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

sortedLastIndexOf

  • sortedLastIndexOf<T>(array: undefined | null | List<T>, value: T): number
  • This method is like _.lastIndexOf except that it performs a binary search on a sorted array.

    example

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

    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.

sortedUniq

  • sortedUniq<T>(array: undefined | null | List<T>): T[]
  • This method is like _.uniq except that it's designed and optimized for sorted arrays.

    example

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

    Type parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    Returns T[]

    Returns the new duplicate free array.

sortedUniqBy

  • sortedUniqBy<T>(array: undefined | null | List<T>, iteratee: ValueIteratee<T>): T[]
  • This method is like _.uniqBy except that it's designed and optimized for sorted arrays.

    example

    _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); // => [1.1, 2.3]

    Type parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    • iteratee: ValueIteratee<T>

    Returns T[]

    Returns the new duplicate free array.

unionWith

  • unionWith<T>(arrays: undefined | null | List<T>, comparator?: Comparator<T>): T[]
  • unionWith<T>(arrays: undefined | null | List<T>, arrays2: undefined | null | List<T>, comparator?: Comparator<T>): T[]
  • unionWith<T>(arrays: undefined | null | List<T>, arrays2: undefined | null | List<T>, arrays3: undefined | null | List<T>, ...comparator: (undefined | null | List<T> | Comparator<T>)[]): T[]
  • 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).

    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>
    • Optional comparator: Comparator<T>

    Returns T[]

    Returns the new array of combined values.

  • see

    _.unionWith

    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[]

uniq

  • uniq<T>(array: undefined | null | List<T>): T[]
  • Creates a duplicate-free version of an array, using SameValueZero for equality comparisons, in which only the first occurrence of each element is kept.

    example

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

    Type parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    Returns T[]

    Returns the new duplicate free array.

uniqBy

  • uniqBy<T>(array: undefined | null | List<T>, iteratee: ValueIteratee<T>): T[]
  • 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).

    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 }]

    Type parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    • iteratee: ValueIteratee<T>

    Returns T[]

    Returns the new duplicate free array.

uniqWith

  • uniqWith<T>(array: undefined | null | List<T>, comparator?: Comparator<T>): T[]
  • 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).

    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 }]

    Type parameters

    • T

    Parameters

    • array: undefined | null | List<T>

      The array to inspect.

    • Optional comparator: Comparator<T>

    Returns T[]

    Returns the new duplicate free array.

xorBy

  • xorBy<T>(arrays: undefined | null | List<T>, iteratee?: ValueIteratee<T>): T[]
  • xorBy<T>(arrays: undefined | null | List<T>, arrays2: undefined | null | List<T>, iteratee?: ValueIteratee<T>): T[]
  • xorBy<T>(arrays: undefined | null | List<T>, arrays2: undefined | null | List<T>, arrays3: undefined | null | List<T>, ...iteratee: (undefined | null | List<T> | ValueIteratee<T>)[]): T[]
  • 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).

    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>
    • Optional iteratee: ValueIteratee<T>

    Returns T[]

    Returns the new array of values.

  • see

    _.xorBy

    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[]

xorWith

  • xorWith<T>(arrays: undefined | null | List<T>, comparator?: Comparator<T>): T[]
  • xorWith<T>(arrays: undefined | null | List<T>, arrays2: undefined | null | List<T>, comparator?: Comparator<T>): T[]
  • xorWith<T>(arrays: undefined | null | List<T>, arrays2: undefined | null | List<T>, arrays3: undefined | null | List<T>, ...comparator: (undefined | null | List<T> | Comparator<T>)[]): T[]
  • 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).

    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>
    • Optional comparator: Comparator<T>

    Returns T[]

    Returns the new array of values.

  • see

    _.xorWith

    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[]

Collection Functions

flatMapDeep

  • flatMapDeep<T>(collection: undefined | null | Dictionary<T | ListOfRecursiveArraysOrValues<T>> | NumericDictionary<T | ListOfRecursiveArraysOrValues<T>>): T[]
  • flatMapDeep<T, TResult>(collection: undefined | null | List<T>, iteratee: ListIterator<T, TResult | ListOfRecursiveArraysOrValues<TResult>>): TResult[]
  • flatMapDeep<T, TResult>(collection: undefined | null | T, iteratee: ObjectIterator<T, TResult | ListOfRecursiveArraysOrValues<TResult>>): TResult[]
  • flatMapDeep(collection: undefined | null | object, iteratee: string): any[]
  • flatMapDeep(collection: undefined | null | object, iteratee: object): boolean[]
  • This method is like _.flatMap except that it recursively flattens the mapped results.

    since

    4.7.0

    example

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

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

    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.

  • see

    _.flatMapDeep

    Type parameters

    • T

    • TResult

    Parameters

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

    Returns TResult[]

  • see

    _.flatMapDeep

    Type parameters

    • T: 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[]

flatMapDepth

  • flatMapDepth<T>(collection: undefined | null | Dictionary<T | ListOfRecursiveArraysOrValues<T>> | NumericDictionary<T | ListOfRecursiveArraysOrValues<T>>): T[]
  • flatMapDepth<T, TResult>(collection: undefined | null | List<T>, iteratee: ListIterator<T, TResult | ListOfRecursiveArraysOrValues<TResult>>, depth?: number): TResult[]
  • flatMapDepth<T, TResult>(collection: undefined | null | T, iteratee: ObjectIterator<T, TResult | ListOfRecursiveArraysOrValues<TResult>>, depth?: number): TResult[]
  • flatMapDepth(collection: undefined | null | object, iteratee: string, depth?: number): any[]
  • flatMapDepth(collection: undefined | null | object, iteratee: object, depth?: number): boolean[]
  • This method is like _.flatMap except that it recursively flattens the mapped results up to depth times.

    since

    4.7.0

    example

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

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

    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.

  • see

    _.flatMapDepth

    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: 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[]

orderBy

  • orderBy<T>(collection: undefined | null | List<T>, iteratees?: Many<ListIterator<T, unknown>>, orders?: Many<boolean | "desc" | "asc">): T[]
  • orderBy<T>(collection: undefined | null | List<T>, iteratees?: Many<ListIteratee<T>>, orders?: Many<boolean | "desc" | "asc">): T[]
  • orderBy<T>(collection: undefined | null | T, iteratees?: Many<ObjectIterator<T, unknown>>, orders?: Many<boolean | "desc" | "asc">): T[keyof T][]
  • orderBy<T>(collection: undefined | null | T, iteratees?: Many<ObjectIteratee<T>>, orders?: Many<boolean | "desc" | "asc">): T[keyof T][]
  • 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.

    param-

    {Object} [guard] Enables use as an iteratee for functions like _.reduce.

    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>

      The collection to iterate over.

    • Optional iteratees: Many<ListIterator<T, unknown>>
    • Optional orders: Many<boolean | "desc" | "asc">

    Returns T[]

    Returns the new sorted array.

  • see

    _.orderBy

    Type parameters

    • T

    Parameters

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

    Returns T[]

  • see

    _.orderBy

    Type parameters

    • T: object

    Parameters

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

    Returns T[keyof T][]

  • see

    _.orderBy

    Type parameters

    • T: object

    Parameters

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

    Returns T[keyof T][]

sortBy

  • sortBy<T>(collection: undefined | null | List<T>, ...iteratees: Many<ListIteratee<T>>[]): T[]
  • sortBy<T>(collection: undefined | null | T, ...iteratees: Many<ObjectIteratee<T>>[]): T[keyof T][]
  • 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).

    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

    Parameters

    • collection: undefined | null | List<T>

      The collection to iterate over.

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

    Returns T[]

    Returns the new sorted array.

  • see

    _.sortBy

    Type parameters

    • T: object

    Parameters

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

    Returns T[keyof T][]

Function Functions

flip

  • flip<T>(func: T): T
  • Creates a function that invokes func with arguments reversed.

    example

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

    flipped('a', 'b', 'c', 'd'); // => ['d', 'c', 'b', 'a']

    Type parameters

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

    Parameters

    • func: T

      The function to flip arguments for.

    Returns T

    Returns the new function.

unary

  • unary<T, TResult>(func: (arg1: T, ...args: any[]) => TResult): (arg1: T) => TResult
  • Creates a function that accepts up to one argument, ignoring any additional arguments.

    example

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

    Type parameters

    • T

    • TResult

    Parameters

    • func: (arg1: T, ...args: any[]) => TResult

      The function to cap arguments for.

        • (arg1: T, ...args: any[]): TResult
        • Parameters

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

          Returns TResult

    Returns (arg1: T) => TResult

    Returns the new function.

      • (arg1: T): TResult
      • Creates a function that accepts up to one argument, ignoring any additional arguments.

        category

        Function

        example

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

        Parameters

        • arg1: T

        Returns TResult

        Returns the new function.

Lang Functions

eq

  • eq(value: any, other: any): boolean
  • Performs a SameValueZero comparison between two values to determine if they are equivalent.

    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

    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.

isArrayLike

  • isArrayLike<T>(t: T): boolean
  • isArrayLike(value: undefined | null | ((...args: any[]) => any)): value is never
  • isArrayLike(value: any): value is { length: number }
  • 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.

    example

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

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

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

    .isArrayLike(.noop); // => false

    Type parameters

    • T: { __lodashAnyHack: any }

    Parameters

    • t: T

    Returns boolean

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

  • see

    _.isArrayLike

    Parameters

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

    Returns value is never

  • see

    _.isArrayLike

    Parameters

    • value: any

    Returns value is { length: number }

isArrayLikeObject

  • isArrayLikeObject<T>(value: T): boolean
  • isArrayLikeObject(value: undefined | null | string | number | boolean | Function | ((...args: any[]) => any)): value is never
  • isArrayLikeObject(value: any): value is object & { length: number }
  • This method is like _.isArrayLike except that it also checks if value is an object.

    example

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

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

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

    .isArrayLikeObject(.noop); // => false

    Type parameters

    • T: { __lodashAnyHack: any }

    Parameters

    • value: T

      The value to check.

    Returns boolean

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

  • see

    _.isArrayLikeObject

    Parameters

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

    Returns value is never

  • see

    _.isArrayLikeObject

    Parameters

    • value: any

    Returns value is object & { length: number }

isEqual

  • isEqual(value: any, other: any): boolean
  • 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.

    example

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

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

    object === other; // => false

    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.

isEqualWith

  • isEqualWith(value: any, other: any, customizer?: IsEqualCustomizer): boolean
  • 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]).

    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

    Parameters

    • value: any

      The value to compare.

    • other: any

      The other value to compare.

    • Optional customizer: IsEqualCustomizer

    Returns boolean

    Returns true if the values are equivalent, else false.

isInteger

  • isInteger(value?: any): boolean
  • Checks if value is an integer.

    Note: This method is based on Number.isInteger.

    example

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

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

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

    _.isInteger('3'); // => false

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

    Returns true if value is an integer, else false.

isLength

  • isLength(value?: any): boolean
  • Checks if value is a valid array-like length.

    Note: This function is loosely based on ToLength.

    example

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

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

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

    _.isLength('3'); // => false

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

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

isMatch

  • isMatch(object: object, source: object): boolean
  • 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.

    example

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

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

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

    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.

isMatchWith

  • isMatchWith(object: object, source: object, customizer: isMatchWithCustomizer): boolean
  • 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).

    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

    Parameters

    • object: object

      The object to inspect.

    • source: object

      The object of property values to match.

    • customizer: isMatchWithCustomizer

    Returns boolean

    Returns true if object is a match, else false.

isNil

  • isNil(value: any): value is undefined | null
  • Checks if value is null or undefined.

    example

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

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

    _.isNil(NaN); // => false

    Parameters

    • value: any

      The value to check.

    Returns value is undefined | null

    Returns true if value is nullish, else false.

isObjectLike

  • isObjectLike(value?: any): boolean
  • Checks if value is object-like. A value is object-like if it's not null and has a typeof result of "object".

    example

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

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

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

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

    Parameters

    • Optional value: any

      The value to check.

    Returns boolean

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

isSafeInteger

  • isSafeInteger(value: any): boolean
  • 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.

    example

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

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

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

    _.isSafeInteger('3'); // => false

    Parameters

    • value: any

      The value to check.

    Returns boolean

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

isSymbol

  • isSymbol(value: any): value is symbol
  • Checks if value is classified as a Symbol primitive or object.

    example

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

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

    Parameters

    • value: any

      The value to check.

    Returns value is symbol

    Returns true if value is correctly classified, else false.

toFinite

  • toFinite(value: any): number
  • Converts value to a finite 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

    Parameters

    • value: any

      The value to convert.

    Returns number

    Returns the converted number.

toInteger

  • toInteger(value: any): number
  • Converts value to an integer.

    Note: This function is loosely based on ToInteger.

    example

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

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

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

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

    Parameters

    • value: any

      The value to convert.

    Returns number

    Returns the converted integer.

toLength

  • toLength(value: any): number
  • Converts value to an integer suitable for use as the length of an array-like object.

    Note: This method is based on ToLength.

    example

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

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

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

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

    Parameters

    • value: any

      The value to convert.

    Returns number

    Returns the converted integer.

toNumber

  • toNumber(value: any): number
  • Converts value to a number.

    example

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

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

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

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

    Parameters

    • value: any

      The value to process.

    Returns number

    Returns the number.

toSafeInteger

  • toSafeInteger(value: any): number
  • Converts value to a safe integer. A safe integer can be compared and represented correctly.

    example

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

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

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

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

    Parameters

    • value: any

      The value to convert.

    Returns number

    Returns the converted integer.

toString

  • toString(value: any): string
  • 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.

    example

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

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

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

    Parameters

    • value: any

      The value to process.

    Returns string

    Returns the string.

Math Functions

max

  • max<T>(collection: undefined | null | List<T>): undefined | T
  • 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.

maxBy

  • maxBy<T>(collection: undefined | null | List<T>, iteratee?: ValueIteratee<T>): undefined | T
  • 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).

    example

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

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

    // using the _.property iteratee shorthand _.maxBy(objects, 'n'); // => { 'n': 2 }

    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.

mean

  • mean(collection: undefined | null | List<any>): number
  • Computes the mean of the values in array.

    example

    _.mean([4, 2, 8, 6]); // => 5

    Parameters

    • collection: undefined | null | List<any>

    Returns number

    Returns the mean.

meanBy

  • meanBy<T>(collection: undefined | null | List<T>, iteratee?: ValueIteratee<T>): number
  • Computes the mean of the provided properties of the objects in the array

    example

    _.mean([{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }], 'n'); // => 5

    Type parameters

    • T

    Parameters

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

      The iteratee invoked per element.

    Returns number

    Returns the mean.

min

  • min<T>(collection: undefined | null | List<T>): undefined | T
  • 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.

minBy

  • minBy<T>(collection: undefined | null | List<T>, iteratee?: ValueIteratee<T>): undefined | T
  • 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).

    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 }

    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.

subtract

  • subtract(minuend: number, subtrahend: number): number
  • Subtract two numbers.

    example

    _.subtract(6, 4); // => 2

    Parameters

    • minuend: number

      The first number in a subtraction.

    • subtrahend: number

      The second number in a subtraction.

    Returns number

    Returns the difference.

sum

  • sum(collection: undefined | null | List<any>): number
  • Computes the sum of the values in array.

    example

    _.sum([4, 2, 8, 6]); // => 20

    Parameters

    • collection: undefined | null | List<any>

    Returns number

    Returns the sum.

sumBy

  • sumBy<T>(collection: undefined | null | List<T>, iteratee?: string | ((value: T) => number)): number
  • 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).

    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

    Type parameters

    • T

    Parameters

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

    Returns number

    Returns the sum.

Number Functions

clamp

  • clamp(number: number, lower: number, upper: number): number
  • clamp(number: number, upper: number): number
  • Clamps number within the inclusive lower and upper bounds.

    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

      The number to clamp.

    • lower: number
    • upper: number

      The upper bound.

    Returns number

    Returns the clamped number.

  • see

    _.clamp

    Parameters

    • number: number
    • upper: number

    Returns number

Object Functions

assign

  • assign<TObject, TSource>(object: TObject, source: TSource): TObject & TSource
  • assign<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2
  • assign<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3): TObject & TSource1 & TSource2 & TSource3
  • assign<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4): TObject & TSource1 & TSource2 & TSource3 & TSource4
  • assign<TObject>(object: TObject): TObject
  • assign(object: any, ...otherArgs: any[]): any
  • Assigns own enumerable properties of source objects to the destination object. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.

    Note: This method mutates object and is loosely based on Object.assign.

    example

    function Foo() { this.c = 3; }

    function Bar() { this.e = 5; }

    Foo.prototype.d = 4; Bar.prototype.f = 6;

    _.assign({ 'a': 1 }, new Foo, new Bar); // => { 'a': 1, 'c': 3, 'e': 5 }

    Type parameters

    • TObject

    • TSource

    Parameters

    • object: TObject

      The destination object.

    • source: TSource

    Returns TObject & TSource

    Returns object.

  • see

    _.assign

    Type parameters

    • TObject

    • TSource1

    • TSource2

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2

    Returns TObject & TSource1 & TSource2

  • see

    _.assign

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3

    Returns TObject & TSource1 & TSource2 & TSource3

  • see

    _.assign

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    • TSource4

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • source4: TSource4

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

  • see

    _.assign

    Type parameters

    • TObject

    Parameters

    • object: TObject

    Returns TObject

  • see

    _.assign

    Parameters

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

    Returns any

assignIn

  • assignIn<TObject, TSource>(object: TObject, source: TSource): TObject & TSource
  • assignIn<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2
  • assignIn<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3): TObject & TSource1 & TSource2 & TSource3
  • assignIn<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4): TObject & TSource1 & TSource2 & TSource3 & TSource4
  • assignIn<TObject>(object: TObject): TObject
  • assignIn<TResult>(object: any, ...otherArgs: any[]): TResult
  • This method is like _.assign except that it iterates over own and inherited source properties.

    Note: This method mutates object.

    alias

    extend

    example

    function Foo() { this.b = 2; }

    function Bar() { this.d = 4; }

    Foo.prototype.c = 3; Bar.prototype.e = 5;

    _.assignIn({ 'a': 1 }, new Foo, new Bar); // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }

    Type parameters

    • TObject

    • TSource

    Parameters

    • object: TObject

      The destination object.

    • source: TSource

    Returns TObject & TSource

    Returns object.

  • see

    _.assignIn

    Type parameters

    • TObject

    • TSource1

    • TSource2

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2

    Returns TObject & TSource1 & TSource2

  • see

    _.assignIn

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3

    Returns TObject & TSource1 & TSource2 & TSource3

  • see

    _.assignIn

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    • TSource4

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • source4: TSource4

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

  • see

    _.assignIn

    Type parameters

    • TObject

    Parameters

    • object: TObject

    Returns TObject

  • see

    _.assignIn

    Type parameters

    • TResult

    Parameters

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

    Returns TResult

assignInWith

  • assignInWith<TObject, TSource>(object: TObject, source: TSource, customizer: AssignCustomizer): TObject & TSource
  • assignInWith<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2, customizer: AssignCustomizer): TObject & TSource1 & TSource2
  • assignInWith<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer): TObject & TSource1 & TSource2 & TSource3
  • assignInWith<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer): TObject & TSource1 & TSource2 & TSource3 & TSource4
  • assignInWith<TObject>(object: TObject): TObject
  • assignInWith<TResult>(object: any, ...otherArgs: any[]): TResult
  • 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.

    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

    • TSource

    Parameters

    • object: TObject

      The destination object.

    • source: TSource
    • customizer: AssignCustomizer

    Returns TObject & TSource

    Returns object.

  • see

    _.assignInWith

    Type parameters

    • TObject

    • TSource1

    • TSource2

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • customizer: AssignCustomizer

    Returns TObject & TSource1 & TSource2

  • see

    _.assignInWith

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • customizer: AssignCustomizer

    Returns TObject & TSource1 & TSource2 & TSource3

  • see

    _.assignInWith

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    • TSource4

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • source4: TSource4
    • customizer: AssignCustomizer

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

  • see

    _.assignInWith

    Type parameters

    • TObject

    Parameters

    • object: TObject

    Returns TObject

  • see

    _.assignInWith

    Type parameters

    • TResult

    Parameters

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

    Returns TResult

assignWith

  • assignWith<TObject, TSource>(object: TObject, source: TSource, customizer: AssignCustomizer): TObject & TSource
  • assignWith<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2, customizer: AssignCustomizer): TObject & TSource1 & TSource2
  • assignWith<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer): TObject & TSource1 & TSource2 & TSource3
  • assignWith<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer): TObject & TSource1 & TSource2 & TSource3 & TSource4
  • assignWith<TObject>(object: TObject): TObject
  • assignWith<TResult>(object: any, ...otherArgs: any[]): TResult
  • 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.

    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

    • TSource

    Parameters

    • object: TObject

      The destination object.

    • source: TSource
    • customizer: AssignCustomizer

    Returns TObject & TSource

    Returns object.

  • see

    _.assignWith

    Type parameters

    • TObject

    • TSource1

    • TSource2

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • customizer: AssignCustomizer

    Returns TObject & TSource1 & TSource2

  • see

    _.assignWith

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • customizer: AssignCustomizer

    Returns TObject & TSource1 & TSource2 & TSource3

  • see

    _.assignWith

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    • TSource4

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • source4: TSource4
    • customizer: AssignCustomizer

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

  • see

    _.assignWith

    Type parameters

    • TObject

    Parameters

    • object: TObject

    Returns TObject

  • see

    _.assignWith

    Type parameters

    • TResult

    Parameters

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

    Returns TResult

functions

  • functions(object: any): string[]
  • Creates an array of function property names from own enumerable properties of object.

    example

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

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

    _.functions(new Foo); // => ['a', 'b']

    Parameters

    • object: any

      The object to inspect.

    Returns string[]

    Returns the new array of property names.

functionsIn

  • functionsIn<T>(object: any): string[]
  • Creates an array of function property names from own and inherited enumerable properties of object.

    example

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

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

    _.functionsIn(new Foo); // => ['a', 'b', 'c']

    Type parameters

    • T: {}

    Parameters

    • object: any

      The object to inspect.

    Returns string[]

    Returns the new array of property names.

has

  • has<T>(object: T, path: PropertyPath): boolean
  • Checks if path is a direct property of object.

    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

    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.

hasIn

  • hasIn<T>(object: T, path: PropertyPath): boolean
  • Checks if path is a direct or inherited property of object.

    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

    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.

merge

  • merge<TObject, TSource>(object: TObject, source: TSource): TObject & TSource
  • merge<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2
  • merge<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3): TObject & TSource1 & TSource2 & TSource3
  • merge<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4): TObject & TSource1 & TSource2 & TSource3 & TSource4
  • merge(object: any, ...otherArgs: any[]): any
  • 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.

    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

    • TSource

    Parameters

    • object: TObject

      The destination object.

    • source: TSource

    Returns TObject & TSource

    Returns object.

  • see

    _.merge

    Type parameters

    • TObject

    • TSource1

    • TSource2

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2

    Returns TObject & TSource1 & TSource2

  • see

    _.merge

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3

    Returns TObject & TSource1 & TSource2 & TSource3

  • see

    _.merge

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    • TSource4

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • source4: TSource4

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

  • see

    _.merge

    Parameters

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

    Returns any

mergeWith

  • mergeWith<TObject, TSource>(object: TObject, source: TSource, customizer: (value: any, srcValue: any, key: string, object: any, source: any) => any): TObject & TSource
  • mergeWith<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2, customizer: (value: any, srcValue: any, key: string, object: any, source: any) => any): TObject & TSource1 & TSource2
  • mergeWith<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, customizer: (value: any, srcValue: any, key: string, object: any, source: any) => any): TObject & TSource1 & TSource2 & TSource3
  • mergeWith<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: (value: any, srcValue: any, key: string, object: any, source: any) => any): TObject & TSource1 & TSource2 & TSource3 & TSource4
  • mergeWith(object: any, ...otherArgs: any[]): any
  • 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).

    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

    • TSource

    Parameters

    • object: TObject

      The destination object.

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

      The function to customize assigned values.

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

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

          Returns any

    Returns TObject & TSource

    Returns object.

  • see

    _.mergeWith

    Type parameters

    • TObject

    • TSource1

    • TSource2

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • customizer: (value: any, srcValue: any, key: string, object: any, source: any) => any
        • (value: any, srcValue: any, key: string, object: any, source: any): 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: any, srcValue: any, key: string, object: any, source: any) => any
        • (value: any, srcValue: any, key: string, object: any, source: any): 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: any, srcValue: any, key: string, object: any, source: any) => any
        • (value: any, srcValue: any, key: string, object: any, source: any): 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

omit

  • omit<T, K>(object: undefined | null | T, ...paths: K): Pick<T, Exclude<keyof T, K[number]>>
  • omit<T, K>(object: undefined | null | T, ...paths: Many<K>[]): Omit<T, K>
  • omit<T>(object: undefined | null | T, ...paths: Many<PropertyName>[]): Partial<T>
  • The opposite of _.pick; this method creates an object composed of the own and inherited enumerable properties of object that are not omitted.

    example

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

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

    Type parameters

    • T: object

    • K: PropertyName[]

    Parameters

    • object: undefined | null | T

      The source object.

    • Rest ...paths: K

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

    Returns the new object.

  • see

    _.omit

    Type parameters

    • T: object

    • K: string | number | symbol

    Parameters

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

    Returns Omit<T, K>

  • see

    _.omit

    Type parameters

    • T: object

    Parameters

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

    Returns Partial<T>

omitBy

  • omitBy<T>(object: undefined | null | Dictionary<T>, predicate?: ValueKeyIteratee<T>): Dictionary<T>
  • omitBy<T>(object: undefined | null | NumericDictionary<T>, predicate?: ValueKeyIteratee<T>): NumericDictionary<T>
  • omitBy<T>(object: undefined | null | T, predicate: ValueKeyIteratee<T[keyof T]>): Partial<T>
  • 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.

    example

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

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

    Type parameters

    • T

    Parameters

    • object: undefined | null | Dictionary<T>

      The source object.

    • Optional predicate: ValueKeyIteratee<T>

    Returns Dictionary<T>

    Returns the new object.

  • see

    _.omitBy

    Type parameters

    • T

    Parameters

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

    Returns NumericDictionary<T>

  • see

    _.omitBy

    Type parameters

    • T: object

    Parameters

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

    Returns Partial<T>

pick

  • pick<T, U>(object: T, ...props: Many<U>[]): Pick<T, U>
  • pick<T>(object: undefined | null | T, ...props: PropertyPath[]): Partial<T>
  • Creates an object composed of the picked object properties.

    example

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

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

    Type parameters

    • T: object

    • U: string | number | symbol

    Parameters

    • object: T

      The source object.

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

    Returns Pick<T, U>

    Returns the new object.

  • see

    _.pick

    Type parameters

    • T

    Parameters

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

    Returns Partial<T>

pickBy

  • pickBy<T, S>(object: undefined | null | Dictionary<T>, predicate: ValueKeyIterateeTypeGuard<T, S>): Dictionary<S>
  • pickBy<T, S>(object: undefined | null | NumericDictionary<T>, predicate: ValueKeyIterateeTypeGuard<T, S>): NumericDictionary<S>
  • pickBy<T>(object: undefined | null | Dictionary<T>, predicate?: ValueKeyIteratee<T>): Dictionary<T>
  • pickBy<T>(object: undefined | null | NumericDictionary<T>, predicate?: ValueKeyIteratee<T>): NumericDictionary<T>
  • pickBy<T>(object: undefined | null | T, predicate?: ValueKeyIteratee<T[keyof T]>): Partial<T>
  • Creates an object composed of the object properties predicate returns truthy for. The predicate is invoked with two arguments: (value, key).

    example

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

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

    Type parameters

    • T

    • S

    Parameters

    • object: undefined | null | Dictionary<T>

      The source object.

    • predicate: ValueKeyIterateeTypeGuard<T, S>

    Returns Dictionary<S>

    Returns the new object.

  • see

    _.pickBy

    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: object

    Parameters

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

    Returns Partial<T>

updateWith

  • updateWith<T>(object: T, path: PropertyPath, updater: (oldValue: any) => any, customizer?: SetWithCustomizer<T>): T
  • updateWith<T, TResult>(object: T, path: PropertyPath, updater: (oldValue: any) => any, customizer?: SetWithCustomizer<T>): TResult
  • 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.

    since

    4.6.0

    example

    var object = {};

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

    Type parameters

    • T: object

    Parameters

    • object: T

      The object to modify.

    • path: PropertyPath

      The path of the property to set.

    • updater: (oldValue: any) => any

      The function to produce the updated value.

        • (oldValue: any): any
        • Parameters

          • oldValue: any

          Returns any

    • Optional customizer: SetWithCustomizer<T>

    Returns T

    Returns object.

  • see

    _.updateWith

    Type parameters

    • T: object

    • TResult

    Parameters

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

          • oldValue: any

          Returns any

    • Optional customizer: SetWithCustomizer<T>

    Returns TResult

Other Functions

add

  • add(augend: number, addend: number): number
  • Adds two numbers.

    Parameters

    • augend: number

      The first number to add.

    • addend: number

      The second number to add.

    Returns number

    Returns the sum.

after

  • after<TFunc>(n: number, func: TFunc): TFunc
  • The opposite of _.before; this method creates a function that invokes func once it’s called n or more times.

    Type parameters

    • TFunc: (...args: any[]) => 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.

ary

  • ary(func: (...args: any[]) => any, n?: number): (...args: any[]) => any
  • Creates a function that accepts up to n arguments ignoring any additional arguments.

    Parameters

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

      The function to cap arguments for.

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional n: number

      The arity cap.

    Returns (...args: any[]) => any

    Returns the new function.

      • (...args: any[]): any
      • Creates a function that accepts up to n arguments ignoring any additional arguments.

        Parameters

        • Rest ...args: any[]

        Returns any

        Returns the new function.

at

  • at<T>(object: undefined | null | Dictionary<T> | NumericDictionary<T>, ...props: PropertyPath[]): T[]
  • at<T>(object: undefined | null | T, ...props: Many<keyof T>[]): T[keyof T][]
  • 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.

  • see

    _.at

    Type parameters

    • T: object

    Parameters

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

    Returns T[keyof T][]

attempt

  • attempt<TResult>(func: (...args: any[]) => TResult, ...args: any[]): Error | TResult
  • 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: any[]) => TResult

      The function to attempt.

        • (...args: any[]): TResult
        • Parameters

          • Rest ...args: any[]

          Returns TResult

    • Rest ...args: any[]

    Returns Error | TResult

    Returns the func result or error object.

before

  • before<TFunc>(n: number, func: TFunc): TFunc
  • 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: (...args: any[]) => 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.

bindAll

  • bindAll<T>(object: T, ...methodNames: Many<string>[]): T
  • 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.

camelCase

  • camelCase(string?: string): string
  • Converts string to camel case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the camel cased string.

capitalize

  • capitalize(string?: string): 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.

castArray

  • castArray<T>(value?: Many<T>): T[]
  • 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.

ceil

  • ceil(n: number, precision?: number): number
  • 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.

chunk

  • chunk<T>(array: undefined | null | List<T>, size?: number): T[][]
  • 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.

clone

  • clone<T>(value: T): T
  • 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.

cloneDeep

  • cloneDeep<T>(value: T): T
  • 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.

cloneDeepWith

  • cloneDeepWith<T>(value: T, customizer: CloneDeepWithCustomizer<T>): any
  • cloneDeepWith<T>(value: T): T
  • 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.

  • see

    _.cloneDeepWith

    Type parameters

    • T

    Parameters

    • value: T

    Returns T

cloneWith

  • cloneWith<T, TResult>(value: T, customizer: CloneWithCustomizer<T, TResult>): TResult
  • cloneWith<T, TResult>(value: T, customizer: CloneWithCustomizer<T, undefined | TResult>): T | TResult
  • cloneWith<T>(value: T): T
  • 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: 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.

  • see

    _.cloneWith

    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

compact

  • compact<T>(array: undefined | null | List<undefined | null | false | "" | 0 | T>): T[]
  • Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey.

    Type parameters

    • T

    Parameters

    • array: undefined | null | List<undefined | null | false | "" | 0 | T>

      The array to compact.

    Returns T[]

    Returns the new array of filtered values.

conforms

  • conforms<T>(source: ConformsPredicateObject<T>): (value: T) => boolean
  • 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: T) => boolean

      • (value: T): boolean
      • 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.

        Parameters

        • value: T

        Returns boolean

conformsTo

  • conformsTo<T>(object: T, source: ConformsPredicateObject<T>): 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

constant

  • constant<T>(value: T): () => T
  • 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
      • Creates a function that returns value.

        Returns T

        Returns the new function.

countBy

  • countBy<T>(collection: undefined | null | List<T>, iteratee?: ValueIteratee<T>): Dictionary<number>
  • countBy<T>(collection: undefined | null | T, iteratee?: ValueIteratee<T[keyof T]>): Dictionary<number>
  • 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.

  • see

    _.countBy

    Type parameters

    • T: object

    Parameters

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

    Returns Dictionary<number>

create

  • create<T, U>(prototype: T, properties?: U): T & U
  • 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: object

    • U: 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.

debounce

  • 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: (...args: any) => any

    Parameters

    • func: T

      The function to debounce.

    • Optional wait: number

      The number of milliseconds to delay.

    • Optional options: DebounceSettings

      The options object.

    Returns DebouncedFunc<T>

    Returns the new debounced function.

deburr

  • deburr(string?: string): string
  • 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.

defaultTo

  • defaultTo<T>(value: undefined | null | T, defaultValue: T): T
  • defaultTo<T, TDefault>(value: undefined | null | T, defaultValue: TDefault): T | TDefault
  • 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.

  • see

    _.defaultTo

    Type parameters

    • T

    • TDefault

    Parameters

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

    Returns T | TDefault

defaults

  • defaults<TObject, TSource>(object: TObject, source: TSource): NonNullable<TSource & TObject>
  • defaults<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): NonNullable<TSource2 & TSource1 & TObject>
  • defaults<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3): NonNullable<TSource3 & TSource2 & TSource1 & TObject>
  • defaults<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4): NonNullable<TSource4 & TSource3 & TSource2 & TSource1 & TObject>
  • defaults<TObject>(object: TObject): NonNullable<TObject>
  • defaults(object: any, ...sources: any[]): any
  • Assigns own enumerable properties of source object(s) to the destination object for all destination properties that resolve to undefined. Once a property is set, additional values of the same property are ignored.

    Note: This method mutates object.

    Type parameters

    • TObject

    • TSource

    Parameters

    • object: TObject

      The destination object.

    • source: TSource

    Returns NonNullable<TSource & TObject>

    The destination object.

  • see

    _.defaults

    Type parameters

    • TObject

    • TSource1

    • TSource2

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2

    Returns NonNullable<TSource2 & TSource1 & TObject>

  • see

    _.defaults

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3

    Returns NonNullable<TSource3 & TSource2 & TSource1 & TObject>

  • see

    _.defaults

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    • TSource4

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • source4: TSource4

    Returns NonNullable<TSource4 & TSource3 & TSource2 & TSource1 & TObject>

  • see

    _.defaults

    Type parameters

    • TObject

    Parameters

    • object: TObject

    Returns NonNullable<TObject>

  • see

    _.defaults

    Parameters

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

    Returns any

defaultsDeep

  • defaultsDeep(object: any, ...sources: any[]): any
  • 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.

defer

  • defer(func: (...args: any[]) => any, ...args: any[]): number
  • 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[]) => any

      The function to defer.

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Rest ...args: any[]

      The arguments to invoke the function with.

    Returns number

    Returns the timer id.

delay

  • delay(func: (...args: any[]) => any, wait: number, ...args: any[]): number
  • Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked.

    Parameters

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

      The function to delay.

        • (...args: any[]): 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.

difference

  • difference<T>(array: undefined | null | List<T>, ...values: List<T>[]): T[]
  • Creates an array of unique array values not included in the other provided arrays using SameValueZero for equality comparisons.

    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.

differenceBy

  • differenceBy<T1, T2>(array: undefined | null | List<T1>, values: List<T2>, iteratee: ValueIteratee<T1 | T2>): T1[]
  • differenceBy<T1, T2, T3>(array: undefined | null | List<T1>, values1: List<T2>, values2: List<T3>, iteratee: ValueIteratee<T1 | T2 | T3>): T1[]
  • differenceBy<T1, T2, T3, T4>(array: undefined | null | List<T1>, values1: List<T2>, values2: List<T3>, values3: List<T4>, iteratee: ValueIteratee<T1 | T2 | T3 | T4>): T1[]
  • differenceBy<T1, T2, T3, T4, T5>(array: undefined | null | List<T1>, values1: List<T2>, values2: List<T3>, values3: List<T4>, values4: List<T5>, iteratee: ValueIteratee<T1 | T2 | T3 | T4 | T5>): T1[]
  • differenceBy<T1, T2, T3, T4, T5, T6>(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>): T1[]
  • differenceBy<T1, T2, T3, T4, T5, T6, T7>(array: undefined | null | List<T1>, values1: List<T2>, values2: List<T3>, values3: List<T4>, values4: List<T5>, values5: List<T6>, ...values: (List<T7> | ValueIteratee<T1 | T2 | T3 | T4 | T5 | T6 | T7>)[]): T1[]
  • differenceBy<T>(array: undefined | null | List<T>, ...values: List<T>[]): T[]
  • 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 uniqueness is computed. 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.

  • see

    _.differenceBy

    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[]

divide

  • divide(dividend: number, divisor: number): number
  • 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.

drop

  • drop<T>(array: undefined | null | List<T>, n?: number): T[]
  • 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.

dropRight

  • dropRight<T>(array: undefined | null | List<T>, n?: number): T[]
  • 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.

dropRightWhile

  • dropRightWhile<T>(array: undefined | null | List<T>, predicate?: ListIteratee<T>): T[]
  • 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.

dropWhile

  • dropWhile<T>(array: undefined | null | List<T>, predicate?: ListIteratee<T>): T[]
  • 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.

endsWith

  • endsWith(string?: string, target?: string, position?: number): boolean
  • 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.

entries

  • entries<T>(object?: Dictionary<T> | NumericDictionary<T>): [string, T][]
  • entries(object?: object): [string, any][]
  • see

    _.toPairs

    Type parameters

    • T

    Parameters

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

    Returns [string, T][]

  • see

    _.entries

    Parameters

    • Optional object: object

    Returns [string, any][]

entriesIn

  • entriesIn<T>(object?: Dictionary<T> | NumericDictionary<T>): [string, T][]
  • entriesIn(object?: object): [string, any][]
  • see

    _.entriesIn

    Type parameters

    • T

    Parameters

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

    Returns [string, T][]

  • see

    _.entriesIn

    Parameters

    • Optional object: object

    Returns [string, any][]

escape

  • escape(string?: string): string
  • 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.

    hough 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.

escapeRegExp

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

    Parameters

    • Optional string: string

      The string to escape.

    Returns string

    Returns the escaped string.

every

  • every<T>(collection: undefined | null | List<T>, predicate?: ListIterateeCustom<T, boolean>): boolean
  • every<T>(collection: undefined | null | T, predicate?: ObjectIterateeCustom<T, boolean>): boolean
  • 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.

  • see

    _.every

    Type parameters

    • T: object

    Parameters

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

    Returns boolean

extend

  • extend<TObject, TSource>(object: TObject, source: TSource): TObject & TSource
  • extend<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2
  • extend<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3): TObject & TSource1 & TSource2 & TSource3
  • extend<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4): TObject & TSource1 & TSource2 & TSource3 & TSource4
  • extend<TObject>(object: TObject): TObject
  • extend<TResult>(object: any, ...otherArgs: any[]): TResult
  • see

    _.extend

    Type parameters

    • TObject

    • TSource

    Parameters

    • object: TObject
    • source: TSource

    Returns TObject & TSource

  • see

    _.extend

    Type parameters

    • TObject

    • TSource1

    • TSource2

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2

    Returns TObject & TSource1 & TSource2

  • see

    _.extend

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3

    Returns TObject & TSource1 & TSource2 & TSource3

  • see

    _.extend

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    • TSource4

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • source4: TSource4

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

  • see

    _.extend

    Type parameters

    • TObject

    Parameters

    • object: TObject

    Returns TObject

  • see

    _.extend

    Type parameters

    • TResult

    Parameters

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

    Returns TResult

extendWith

  • extendWith<TObject, TSource>(object: TObject, source: TSource, customizer: AssignCustomizer): TObject & TSource
  • extendWith<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2, customizer: AssignCustomizer): TObject & TSource1 & TSource2
  • extendWith<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, customizer: AssignCustomizer): TObject & TSource1 & TSource2 & TSource3
  • extendWith<TObject, TSource1, TSource2, TSource3, TSource4>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3, source4: TSource4, customizer: AssignCustomizer): TObject & TSource1 & TSource2 & TSource3 & TSource4
  • extendWith<TObject>(object: TObject): TObject
  • extendWith<TResult>(object: any, ...otherArgs: any[]): TResult
  • see

    _.extendWith

    Type parameters

    • TObject

    • TSource

    Parameters

    • object: TObject
    • source: TSource
    • customizer: AssignCustomizer

    Returns TObject & TSource

  • see

    _.extendWith

    Type parameters

    • TObject

    • TSource1

    • TSource2

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • customizer: AssignCustomizer

    Returns TObject & TSource1 & TSource2

  • see

    _.extendWith

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • customizer: AssignCustomizer

    Returns TObject & TSource1 & TSource2 & TSource3

  • see

    _.extendWith

    Type parameters

    • TObject

    • TSource1

    • TSource2

    • TSource3

    • TSource4

    Parameters

    • object: TObject
    • source1: TSource1
    • source2: TSource2
    • source3: TSource3
    • source4: TSource4
    • customizer: AssignCustomizer

    Returns TObject & TSource1 & TSource2 & TSource3 & TSource4

  • see

    _.extendWith

    Type parameters

    • TObject

    Parameters

    • object: TObject

    Returns TObject

  • see

    _.extendWith

    Type parameters

    • TResult

    Parameters

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

    Returns TResult

fill

  • fill<T>(array: undefined | null | any[], value: T): T[]
  • fill<T>(array: undefined | null | List<any>, value: T): List<T>
  • fill<T, U>(array: undefined | null | U[], value: T, start?: number, end?: number): (T | U)[]
  • fill<T, U>(array: undefined | null | List<U>, value: T, start?: number, end?: number): List<T | U>
  • 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.

  • see

    _.fill

    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>

filter

  • filter(collection: undefined | null | string, predicate?: StringIterator<boolean>): string[]
  • filter<T, S>(collection: undefined | null | List<T>, predicate: ListIteratorTypeGuard<T, S>): S[]
  • filter<T>(collection: undefined | null | List<T>, predicate?: ListIterateeCustom<T, boolean>): T[]
  • filter<T, S>(collection: undefined | null | T, predicate: ObjectIteratorTypeGuard<T, S>): S[]
  • filter<T>(collection: undefined | null | T, predicate?: ObjectIterateeCustom<T, boolean>): T[keyof T][]
  • 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.

  • see

    _.filter

    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: object

    • S

    Parameters

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

    Returns S[]

  • see

    _.filter

    Type parameters

    • T: object

    Parameters

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

    Returns T[keyof T][]

find

  • find<T, S>(collection: undefined | null | List<T>, predicate: ListIteratorTypeGuard<T, S>, fromIndex?: number): undefined | S
  • find<T>(collection: undefined | null | List<T>, predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): undefined | T
  • find<T, S>(collection: undefined | null | T, predicate: ObjectIteratorTypeGuard<T, S>, fromIndex?: number): undefined | S
  • find<T>(collection: undefined | null | T, predicate?: ObjectIterateeCustom<T, boolean>, fromIndex?: number): undefined | T[keyof T]
  • 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.

  • see

    _.find

    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: object

    • S

    Parameters

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

    Returns undefined | S

  • see

    _.find

    Type parameters

    • T: object

    Parameters

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

    Returns undefined | T[keyof T]

findIndex

  • findIndex<T>(array: undefined | null | List<T>, predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): number
  • 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.

findKey

  • findKey<T>(object: undefined | null | T, predicate?: ObjectIteratee<T>): undefined | string
  • 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.

findLast

  • findLast<T, S>(collection: undefined | null | List<T>, predicate: ListIteratorTypeGuard<T, S>, fromIndex?: number): undefined | S
  • findLast<T>(collection: undefined | null | List<T>, predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): undefined | T
  • findLast<T, S>(collection: undefined | null | T, predicate: ObjectIteratorTypeGuard<T, S>, fromIndex?: number): undefined | S
  • findLast<T>(collection: undefined | null | T, predicate?: ObjectIterateeCustom<T, boolean>, fromIndex?: number): undefined | T[keyof T]
  • 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.

  • see

    _.findLast

    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: object

    • S

    Parameters

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

    Returns undefined | S

  • see

    _.findLast

    Type parameters

    • T: object

    Parameters

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

    Returns undefined | T[keyof T]

findLastIndex

  • findLastIndex<T>(array: undefined | null | List<T>, predicate?: ListIterateeCustom<T, boolean>, fromIndex?: number): number
  • 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.

findLastKey

  • findLastKey<T>(object: undefined | null | T, predicate?: ObjectIteratee<T>): undefined | string
  • 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.

flatMap

  • flatMap<T>(collection: undefined | null | Dictionary<Many<T>> | NumericDictionary<Many<T>>): T[]
  • flatMap(collection: undefined | null | object): any[]
  • flatMap<T, TResult>(collection: undefined | null | List<T>, iteratee: ListIterator<T, Many<TResult>>): TResult[]
  • flatMap<T, TResult>(collection: undefined | null | T, iteratee: ObjectIterator<T, Many<TResult>>): TResult[]
  • flatMap(collection: undefined | null | object, iteratee: string): any[]
  • flatMap(collection: undefined | null | object, iteratee: object): boolean[]
  • 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.

  • see

    _.flatMap

    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: 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[]

flatten

  • flatten<T>(array: undefined | null | List<Many<T>>): T[]
  • 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.

flattenDeep

  • flattenDeep<T>(array: undefined | null | ListOfRecursiveArraysOrValues<T>): Flat<T>[]
  • 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.

flattenDepth

  • flattenDepth<T>(array: undefined | null | ListOfRecursiveArraysOrValues<T>, depth?: number): T[]
  • 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.

floor

  • floor(n: number, precision?: number): number
  • 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.

flow

  • flow<A, R1, R2, R3, R4, R5, R6, R7>(f1: (...args: A) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (...args: A) => R7
  • flow<A, R1, R2, R3, R4, R5, R6, R7>(f1: (...args: A) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...func: Many<(a: any) => any>[]): (...args: A) => any
  • flow<A, R1, R2, R3, R4, R5, R6>(f1: (...args: A) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (...args: A) => R6
  • flow<A, R1, R2, R3, R4, R5>(f1: (...args: A) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (...args: A) => R5
  • flow<A, R1, R2, R3, R4>(f1: (...args: A) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (...args: A) => R4
  • flow<A, R1, R2, R3>(f1: (...args: A) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (...args: A) => R3
  • flow<A, R1, R2>(f1: (...args: A) => R1, f2: (a: R1) => R2): (...args: A) => R2
  • flow(...func: Many<(...args: any[]) => any>[]): (...args: any[]) => any
  • 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: any[]

    • R1

    • R2

    • R3

    • R4

    • R5

    • R6

    • R7

    Parameters

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

          • Rest ...args: A

          Returns R1

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

          • a: R1

          Returns R2

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

          • a: R2

          Returns R3

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

          • a: R3

          Returns R4

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

          • a: R4

          Returns R5

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

          • a: R5

          Returns R6

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

          • a: R6

          Returns R7

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

    Returns the new function.

      • (...args: A): R7
      • 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.

        Parameters

        • Rest ...args: A

        Returns R7

        Returns the new function.

  • see

    _.flow

    Type parameters

    • A: any[]

    • R1

    • R2

    • R3

    • R4

    • R5

    • R6

    • R7

    Parameters

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

          • Rest ...args: A

          Returns R1

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

          • a: R1

          Returns R2

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

          • a: R2

          Returns R3

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

          • a: R3

          Returns R4

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

          • a: R4

          Returns R5

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

          • a: R5

          Returns R6

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

          • a: R6

          Returns R7

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

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

      • (...args: A): any
      • see

        _.flow

        Parameters

        • Rest ...args: A

        Returns any

  • see

    _.flow

    Type parameters

    • A: any[]

    • R1

    • R2

    • R3

    • R4

    • R5

    • R6

    Parameters

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

          • Rest ...args: A

          Returns R1

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

          • a: R1

          Returns R2

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

          • a: R2

          Returns R3

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

          • a: R3

          Returns R4

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

          • a: R4

          Returns R5

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

          • a: R5

          Returns R6

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

      • (...args: A): R6
      • see

        _.flow

        Parameters

        • Rest ...args: A

        Returns R6

  • see

    _.flow

    Type parameters

    • A: any[]

    • R1

    • R2

    • R3

    • R4

    • R5

    Parameters

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

          • Rest ...args: A

          Returns R1

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

          • a: R1

          Returns R2

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

          • a: R2

          Returns R3

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

          • a: R3

          Returns R4

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

          • a: R4

          Returns R5

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

      • (...args: A): R5
      • see

        _.flow

        Parameters

        • Rest ...args: A

        Returns R5

  • see

    _.flow

    Type parameters

    • A: any[]

    • R1

    • R2

    • R3

    • R4

    Parameters

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

          • Rest ...args: A

          Returns R1

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

          • a: R1

          Returns R2

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

          • a: R2

          Returns R3

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

          • a: R3

          Returns R4

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

      • (...args: A): R4
      • see

        _.flow

        Parameters

        • Rest ...args: A

        Returns R4

  • see

    _.flow

    Type parameters

    • A: any[]

    • R1

    • R2

    • R3

    Parameters

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

          • Rest ...args: A

          Returns R1

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

          • a: R1

          Returns R2

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

          • a: R2

          Returns R3

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

      • (...args: A): R3
      • see

        _.flow

        Parameters

        • Rest ...args: A

        Returns R3

  • see

    _.flow

    Type parameters

    • A: any[]

    • R1

    • R2

    Parameters

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

          • Rest ...args: A

          Returns R1

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

          • a: R1

          Returns R2

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

      • (...args: A): R2
      • see

        _.flow

        Parameters

        • Rest ...args: A

        Returns R2

  • see

    _.flow

    Parameters

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

    Returns (...args: any[]) => any

      • (...args: any[]): any
      • see

        _.flow

        Parameters

        • Rest ...args: any[]

        Returns any

flowRight

  • flowRight<A, R1, R2, R3, R4, R5, R6, R7>(f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: A) => R1): (...args: A) => R7
  • flowRight<A, R1, R2, R3, R4, R5, R6>(f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: A) => R1): (...args: A) => R6
  • flowRight<A, R1, R2, R3, R4, R5>(f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: A) => R1): (...args: A) => R5
  • flowRight<A, R1, R2, R3, R4>(f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: A) => R1): (...args: A) => R4
  • flowRight<A, R1, R2, R3>(f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: A) => R1): (...args: A) => R3
  • flowRight<A, R1, R2>(f2: (a: R1) => R2, f1: (...args: A) => R1): (...args: A) => R2
  • flowRight(...func: Many<(...args: any[]) => any>[]): (...args: any[]) => any
  • This method is like _.flow except that it creates a function that invokes the provided functions from right to left.

    Type parameters

    • A: any[]

    • R1

    • R2

    • R3

    • R4

    • R5

    • R6

    • R7

    Parameters

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

          • a: R6

          Returns R7

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

          • a: R5

          Returns R6

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

          • a: R4

          Returns R5

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

          • a: R3

          Returns R4

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

          • a: R2

          Returns R3

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

          • a: R1

          Returns R2

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

          • Rest ...args: A

          Returns R1

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

    Returns the new function.

      • (...args: A): R7
      • This method is like _.flow except that it creates a function that invokes the provided functions from right to left.

        Parameters

        • Rest ...args: A

        Returns R7

        Returns the new function.

  • see

    _.flowRight

    Type parameters

    • A: any[]

    • R1

    • R2

    • R3

    • R4

    • R5

    • R6

    Parameters

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

          • a: R5

          Returns R6

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

          • a: R4

          Returns R5

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

          • a: R3

          Returns R4

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

          • a: R2

          Returns R3

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

          • a: R1

          Returns R2

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

          • Rest ...args: A

          Returns R1

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

      • (...args: A): R6
      • see

        _.flowRight

        Parameters

        • Rest ...args: A

        Returns R6

  • see

    _.flowRight

    Type parameters

    • A: any[]

    • R1

    • R2

    • R3

    • R4

    • R5

    Parameters

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

          • a: R4

          Returns R5

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

          • a: R3

          Returns R4

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

          • a: R2

          Returns R3

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

          • a: R1

          Returns R2

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

          • Rest ...args: A

          Returns R1

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

      • (...args: A): R5
      • see

        _.flowRight

        Parameters

        • Rest ...args: A

        Returns R5

  • see

    _.flowRight

    Type parameters

    • A: any[]

    • R1

    • R2

    • R3

    • R4

    Parameters

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

          • a: R3

          Returns R4

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

          • a: R2

          Returns R3

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

          • a: R1

          Returns R2

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

          • Rest ...args: A

          Returns R1

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

      • (...args: A): R4
      • see

        _.flowRight

        Parameters

        • Rest ...args: A

        Returns R4

  • see

    _.flowRight

    Type parameters

    • A: any[]

    • R1

    • R2

    • R3

    Parameters

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

          • a: R2

          Returns R3

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

          • a: R1

          Returns R2

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

          • Rest ...args: A

          Returns R1

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

      • (...args: A): R3
      • see

        _.flowRight

        Parameters

        • Rest ...args: A

        Returns R3

  • see

    _.flowRight

    Type parameters

    • A: any[]

    • R1

    • R2

    Parameters

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

          • a: R1

          Returns R2

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

          • Rest ...args: A

          Returns R1

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

      • (...args: A): R2
      • see

        _.flowRight

        Parameters

        • Rest ...args: A

        Returns R2

  • see

    _.flowRight

    Parameters

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

    Returns (...args: any[]) => any

      • (...args: any[]): any
      • see

        _.flowRight

        Parameters

        • Rest ...args: any[]

        Returns any

forIn

  • forIn<T>(object: T, iteratee?: ObjectIterator<T, any>): T
  • forIn<T>(object: undefined | null | T, iteratee?: ObjectIterator<T, any>): undefined | null | T
  • 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.

  • see

    _.forIn

    Type parameters

    • T

    Parameters

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

    Returns undefined | null | T

forInRight

  • forInRight<T>(object: T, iteratee?: ObjectIterator<T, any>): T
  • forInRight<T>(object: undefined | null | T, iteratee?: ObjectIterator<T, any>): undefined | null | T
  • 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.

  • see

    _.forInRight

    Type parameters

    • T

    Parameters

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

    Returns undefined | null | T

forOwn

  • forOwn<T>(object: T, iteratee?: ObjectIterator<T, any>): T
  • forOwn<T>(object: undefined | null | T, iteratee?: ObjectIterator<T, any>): undefined | null | T
  • 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.

  • see

    _.forOwn

    Type parameters

    • T

    Parameters

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

    Returns undefined | null | T

forOwnRight

  • forOwnRight<T>(object: T, iteratee?: ObjectIterator<T, any>): T
  • forOwnRight<T>(object: undefined | null | T, iteratee?: ObjectIterator<T, any>): undefined | null | T
  • 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.

  • see

    _.forOwnRight

    Type parameters

    • T

    Parameters

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

    Returns undefined | null | T

get

  • get<TObject, TKey>(object: TObject, path: TKey | [TKey]): TObject[TKey]
  • get<TObject, TKey>(object: undefined | null | TObject, path: TKey | [TKey]): undefined | TObject[TKey]
  • get<TObject, TKey, TDefault>(object: undefined | null | TObject, path: TKey | [TKey], defaultValue: TDefault): TDefault | Exclude<TObject[TKey], undefined>
  • get<TObject, TKey1, TKey2>(object: TObject, path: [TKey1, TKey2]): TObject[TKey1][TKey2]
  • get<TObject, TKey1, TKey2>(object: undefined | null | TObject, path: [TKey1, TKey2]): undefined | TObject[TKey1][TKey2]
  • get<TObject, TKey1, TKey2, TDefault>(object: undefined | null | TObject, path: [TKey1, TKey2], defaultValue: TDefault): TDefault | Exclude<TObject[TKey1][TKey2], undefined>
  • get<TObject, TKey1, TKey2, TKey3>(object: TObject, path: [TKey1, TKey2, TKey3]): TObject[TKey1][TKey2][TKey3]
  • get<TObject, TKey1, TKey2, TKey3>(object: undefined | null | TObject, path: [TKey1, TKey2, TKey3]): undefined | TObject[TKey1][TKey2][TKey3]
  • get<TObject, TKey1, TKey2, TKey3, TDefault>(object: undefined | null | TObject, path: [TKey1, TKey2, TKey3], defaultValue: TDefault): TDefault | Exclude<TObject[TKey1][TKey2][TKey3], undefined>
  • get<TObject, TKey1, TKey2, TKey3, TKey4>(object: TObject, path: [TKey1, TKey2, TKey3, TKey4]): TObject[TKey1][TKey2][TKey3][TKey4]
  • get<TObject, TKey1, TKey2, TKey3, TKey4>(object: undefined | null | TObject, path: [TKey1, TKey2, TKey3, TKey4]): undefined | TObject[TKey1][TKey2][TKey3][TKey4]
  • get<TObject, TKey1, TKey2, TKey3, TKey4, TDefault>(object: undefined | null | TObject, path: [TKey1, TKey2, TKey3, TKey4], defaultValue: TDefault): TDefault | Exclude<TObject[TKey1][TKey2][TKey3][TKey4], undefined>
  • get<T>(object: NumericDictionary<T>, path: number): T
  • get<T>(object: undefined | null | NumericDictionary<T>, path: number): undefined | T
  • get<T, TDefault>(object: undefined | null | NumericDictionary<T>, path: number, defaultValue: TDefault): T | TDefault
  • get<TDefault>(object: undefined | null, path: PropertyPath, defaultValue: TDefault): TDefault
  • get(object: undefined | null, path: PropertyPath): undefined
  • get(object: any, path: PropertyPath, defaultValue?: any): any
  • Gets the property value at path of object. If the resolved value is undefined the defaultValue is used in its place.

    Type parameters

    • TObject: object

    • TKey: 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.

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey: string | number | symbol

    Parameters

    • object: undefined | null | TObject
    • path: TKey | [TKey]

    Returns undefined | TObject[TKey]

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey: string | number | symbol

    • TDefault

    Parameters

    • object: undefined | null | TObject
    • path: TKey | [TKey]
    • defaultValue: TDefault

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

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey1: string | number | symbol

    • TKey2: string | number | symbol

    Parameters

    • object: TObject
    • path: [TKey1, TKey2]

    Returns TObject[TKey1][TKey2]

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey1: string | number | symbol

    • TKey2: string | number | symbol

    Parameters

    • object: undefined | null | TObject
    • path: [TKey1, TKey2]

    Returns undefined | TObject[TKey1][TKey2]

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey1: string | number | symbol

    • TKey2: string | number | symbol

    • TDefault

    Parameters

    • object: undefined | null | TObject
    • path: [TKey1, TKey2]
    • defaultValue: TDefault

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

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey1: string | number | symbol

    • TKey2: string | number | symbol

    • TKey3: string | number | symbol

    Parameters

    • object: TObject
    • path: [TKey1, TKey2, TKey3]

    Returns TObject[TKey1][TKey2][TKey3]

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey1: string | number | symbol

    • TKey2: string | number | symbol

    • TKey3: string | number | symbol

    Parameters

    • object: undefined | null | TObject
    • path: [TKey1, TKey2, TKey3]

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

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey1: string | number | symbol

    • TKey2: string | number | symbol

    • TKey3: string | number | symbol

    • TDefault

    Parameters

    • object: undefined | null | TObject
    • path: [TKey1, TKey2, TKey3]
    • defaultValue: TDefault

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

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey1: string | number | symbol

    • TKey2: string | number | symbol

    • TKey3: string | number | symbol

    • TKey4: string | number | symbol

    Parameters

    • object: TObject
    • path: [TKey1, TKey2, TKey3, TKey4]

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

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey1: string | number | symbol

    • TKey2: string | number | symbol

    • TKey3: string | number | symbol

    • TKey4: string | number | symbol

    Parameters

    • object: undefined | null | TObject
    • path: [TKey1, TKey2, TKey3, TKey4]

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

  • see

    _.get

    Type parameters

    • TObject: object

    • TKey1: string | number | symbol

    • TKey2: string | number | symbol

    • TKey3: string | number | symbol

    • TKey4: string | number | symbol

    • TDefault

    Parameters

    • object: undefined | null | TObject
    • path: [TKey1, TKey2, TKey3, TKey4]
    • defaultValue: TDefault

    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

    Parameters

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

    Returns any

groupBy

  • groupBy<T>(collection: undefined | null | List<T>, iteratee?: ValueIteratee<T>): Dictionary<T[]>
  • groupBy<T>(collection: undefined | null | T, iteratee?: ValueIteratee<T[keyof T]>): Dictionary<T[keyof 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 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.

  • see

    _.groupBy

    Type parameters

    • T: object

    Parameters

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

    Returns Dictionary<T[keyof T][]>

gt

  • gt(value: any, other: any): boolean
  • 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.

gte

  • gte(value: any, other: any): boolean
  • 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.

identity

  • identity<T>(value: T): T
  • identity(): undefined
  • This method returns the first argument provided to it.

    Type parameters

    • T

    Parameters

    • value: T

      Any value.

    Returns T

    Returns value.

  • see

    _.identity

    Returns undefined

inRange

  • inRange(n: number, start: number, end?: number): boolean
  • 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.

includes

  • includes<T>(collection: undefined | null | Dictionary<T> | NumericDictionary<T>, target: T, fromIndex?: number): boolean
  • 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.

initial

  • initial<T>(array: undefined | null | List<T>): T[]
  • 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.

intersection

  • intersection<T>(...arrays: (undefined | null | List<T>)[]): T[]
  • 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.

invert

  • invert(object: object): Dictionary<string>
  • 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.

invertBy

  • invertBy<T>(object: undefined | null | Dictionary<T> | NumericDictionary<T>, interatee?: ValueIteratee<T>): Dictionary<string[]>
  • invertBy<T>(object: undefined | null | T, interatee?: ValueIteratee<T[keyof T]>): Dictionary<string[]>
  • 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.

  • see

    _.invertBy

    Type parameters

    • T: object

    Parameters

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

    Returns Dictionary<string[]>

invoke

  • invoke(object: any, path: PropertyPath, ...args: any[]): any
  • 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

invokeMap

  • invokeMap(collection: undefined | null | object, methodName: string, ...args: any[]): any[]
  • invokeMap<TResult>(collection: undefined | null | object, method: (...args: any[]) => TResult, ...args: any[]): TResult[]
  • 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[]

  • see

    _.invokeMap

    Type parameters

    • TResult

    Parameters

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

          • Rest ...args: any[]

          Returns TResult

    • Rest ...args: any[]

    Returns TResult[]

isArguments

  • isArguments(value?: any): value is IArguments
  • 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.

isArray

  • isArray(value?: any): value is any[]
  • isArray<T>(value?: any): value is any[]
  • 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.

  • see

    _.isArray

    Type parameters

    • T

    Parameters

    • Optional value: any

    Returns value is any[]

isArrayBuffer

  • isArrayBuffer(value?: any): value is ArrayBuffer
  • 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.

isBoolean

  • isBoolean(value?: any): value is boolean
  • 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.

isBuffer

  • isBuffer(value?: any): boolean
  • 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.

isDate

  • isDate(value?: any): value is Date
  • 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.

isElement

  • isElement(value?: any): boolean
  • 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.

isEmpty

  • isEmpty(value?: any): boolean
  • 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.

    Parameters

    • Optional value: any

      The value to inspect.

    Returns boolean

    Returns true if value is empty, else false.

isError

  • isError(value: any): value is Error
  • 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.

isFinite

  • isFinite(value?: any): boolean
  • 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.

isFunction

  • isFunction(value: any): value is (...args: any[]) => any
  • Checks if value is a callable function.

    Parameters

    • value: any

      The value to check.

    Returns value is (...args: any[]) => any

    Returns true if value is correctly classified, else false.

isMap

  • isMap(value?: any): value is Map<any, any>
  • 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.

isNaN

  • isNaN(value?: any): boolean
  • 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.

isNative

  • isNative(value: any): value is (...args: any[]) => any
  • Checks if value is a native function.

    retrun

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

    Parameters

    • value: any

      The value to check.

    Returns value is (...args: any[]) => any

isNull

  • isNull(value: any): value is null
  • Checks if value is null.

    Parameters

    • value: any

      The value to check.

    Returns value is null

    Returns true if value is null, else false.

isNumber

  • isNumber(value?: any): value is number
  • 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.

isObject

  • isObject(value?: any): value is object
  • 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.

isPlainObject

  • isPlainObject(value?: any): boolean
  • 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.

isRegExp

  • isRegExp(value?: any): value is RegExp
  • 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.

isSet

  • isSet(value?: any): value is Set<any>
  • 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.

isString

  • isString(value?: any): value is string
  • 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.

isTypedArray

  • isTypedArray(value: any): boolean
  • 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.

isUndefined

  • isUndefined(value: any): value is undefined
  • Checks if value is undefined.

    Parameters

    • value: any

      The value to check.

    Returns value is undefined

    Returns true if value is undefined, else false.

isWeakMap

  • isWeakMap(value?: any): value is WeakMap<object, any>
  • 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.

isWeakSet

  • isWeakSet(value?: any): value is WeakSet<object>
  • 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.

join

  • join(array: undefined | null | List<any>, separator?: string): string
  • 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.

kebabCase

  • kebabCase(string?: string): string
  • Converts string to kebab case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the kebab cased string.

keyBy

  • keyBy<T>(collection: undefined | null | List<T>, iteratee?: ValueIterateeCustom<T, PropertyName>): Dictionary<T>
  • keyBy<T>(collection: undefined | null | T, iteratee?: ValueIterateeCustom<T[keyof T], PropertyName>): Dictionary<T[keyof 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 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.

  • see

    _.keyBy

    Type parameters

    • T: object

    Parameters

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

    Returns Dictionary<T[keyof T]>

keys

  • keys(object?: any): string[]
  • 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.

keysIn

  • keysIn(object?: any): string[]
  • 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.

last

  • last<T>(array: undefined | null | List<T>): undefined | T
  • 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.

lastIndexOf

  • lastIndexOf<T>(array: undefined | null | List<T>, value: T, fromIndex?: number | true): number
  • 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.

lowerCase

  • lowerCase(string?: string): string
  • Converts string, as space separated words, to lower case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the lower cased string.

lowerFirst

  • lowerFirst(string?: string): string
  • Converts the first character of string to lower case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the converted string.

lt

  • lt(value: any, other: any): boolean
  • 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.

lte

  • lte(value: any, other: any): boolean
  • 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.

map

  • map<T, TResult>(collection: undefined | null | T[], iteratee: ArrayIterator<T, TResult>): TResult[]
  • map<T, TResult>(collection: undefined | null | List<T>, iteratee: ListIterator<T, TResult>): TResult[]
  • map<T>(collection: undefined | null | Dictionary<T> | NumericDictionary<T>): T[]
  • map<T, TResult>(collection: undefined | null | T, iteratee: ObjectIterator<T, TResult>): TResult[]
  • map<T, K>(collection: undefined | null | Dictionary<T> | NumericDictionary<T>, iteratee: K): T[K][]
  • map<T>(collection: undefined | null | Dictionary<T> | NumericDictionary<T>, iteratee?: string): any[]
  • map<T>(collection: undefined | null | Dictionary<T> | NumericDictionary<T>, iteratee?: object): boolean[]
  • 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.

  • see

    _.map

    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: object

    • TResult

    Parameters

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

    Returns TResult[]

  • see

    _.map

    Type parameters

    • T

    • K: 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[]

mapKeys

  • mapKeys<T>(object: undefined | null | List<T>, iteratee?: ListIteratee<T>): Dictionary<T>
  • mapKeys<T>(object: undefined | null | T, iteratee?: ObjectIteratee<T>): Dictionary<T[keyof T]>
  • 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.

  • see

    _.mapKeys

    Type parameters

    • T: object

    Parameters

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

    Returns Dictionary<T[keyof T]>

mapValues

  • mapValues<TResult>(obj: undefined | null | string, callback: StringIterator<TResult>): NumericDictionary<TResult>
  • mapValues<T, TResult>(obj: undefined | null | T, callback: ObjectIterator<T, TResult>): { [ P in string | number | symbol]: TResult }
  • mapValues<T>(obj: undefined | null | Dictionary<T> | NumericDictionary<T>, iteratee: object): Dictionary<boolean>
  • mapValues<T>(obj: undefined | null | T, iteratee: object): { [ P in string | number | symbol]: boolean }
  • mapValues<T, TKey>(obj: undefined | null | Dictionary<T> | NumericDictionary<T>, iteratee: TKey): Dictionary<T[TKey]>
  • mapValues<T>(obj: undefined | null | Dictionary<T> | NumericDictionary<T>, iteratee: string): Dictionary<any>
  • mapValues<T>(obj: undefined | null | T, iteratee: string): { [ P in string | number | symbol]: any }
  • mapValues(obj: undefined | null | string): NumericDictionary<string>
  • mapValues<T>(obj: undefined | null | Dictionary<T> | NumericDictionary<T>): Dictionary<T>
  • mapValues<T>(obj: T): T
  • mapValues<T>(obj: undefined | null | T): Partial<T>
  • 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.

  • see

    _.mapValues

    Type parameters

    • T: 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: object

    Parameters

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

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

  • see

    _.mapValues

    Type parameters

    • T

    • TKey: 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: 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: object

    Parameters

    • obj: T

    Returns T

  • see

    _.mapValues

    Type parameters

    • T: object

    Parameters

    • obj: undefined | null | T

    Returns Partial<T>

matches

  • matches<T>(source: T): (value: any) => boolean
  • matches<T, V>(source: T): (value: V) => boolean
  • 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: any) => boolean

    Returns the new function.

      • (value: any): boolean
      • 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.

        Parameters

        • value: any

        Returns boolean

        Returns the new function.

  • see

    _.matches

    Type parameters

    • T

    • V

    Parameters

    • source: T

    Returns (value: V) => boolean

      • (value: V): boolean
      • see

        _.matches

        Parameters

        • value: V

        Returns boolean

matchesProperty

  • matchesProperty<T>(path: PropertyPath, srcValue: T): (value: any) => boolean
  • matchesProperty<T, V>(path: PropertyPath, srcValue: T): (value: V) => boolean
  • 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: any) => boolean

    Returns the new function.

      • (value: any): boolean
      • 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.

        Parameters

        • value: any

        Returns boolean

        Returns the new function.

  • see

    _.matchesProperty

    Type parameters

    • T

    • V

    Parameters

    • path: PropertyPath
    • srcValue: T

    Returns (value: V) => boolean

      • (value: V): boolean
      • see

        _.matchesProperty

        Parameters

        • value: V

        Returns boolean

method

  • method(path: PropertyPath, ...args: any[]): (object: any) => any
  • 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) => any

    Returns the new function.

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

        Parameters

        • object: any

        Returns any

        Returns the new function.

methodOf

  • methodOf(object: object, ...args: any[]): (path: PropertyPath) => 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: PropertyPath) => any

    Returns the new function.

      • (path: PropertyPath): 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

        • path: PropertyPath

        Returns any

        Returns the new function.

mixin

  • mixin<TObject>(object: TObject, source: Dictionary<(...args: any[]) => any>, options?: MixinOptions): TObject
  • mixin<TResult>(source: Dictionary<(...args: any[]) => any>, options?: MixinOptions): LoDashStatic
  • 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[]) => any>

      The object of functions to add.

    • Optional options: MixinOptions

      The options object.

    Returns TObject

    Returns object.

  • see

    _.mixin

    Type parameters

    • TResult

    Parameters

    • source: Dictionary<(...args: any[]) => any>
    • Optional options: MixinOptions

    Returns LoDashStatic

multiply

  • multiply(multiplier: number, multiplicand: number): number
  • 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.

negate

  • negate<T>(predicate: (...args: T) => boolean): (...args: T) => boolean
  • 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: any[]

    Parameters

    • predicate: (...args: T) => boolean

      The predicate to negate.

        • (...args: T): boolean
        • Parameters

          • Rest ...args: T

          Returns boolean

    Returns (...args: T) => boolean

    Returns the new function.

      • (...args: T): boolean
      • 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.

        Parameters

        • Rest ...args: T

        Returns boolean

        Returns the new function.

noop

  • noop(...args: any[]): void
  • A no-operation function that returns undefined regardless of the arguments it receives.

    Parameters

    • Rest ...args: any[]

    Returns void

    undefined

now

  • now(): number
  • Returns number

nth

  • nth<T>(array: undefined | null | List<T>, n?: number): undefined | T
  • 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.

nthArg

  • nthArg(n?: number): (...args: any[]) => any
  • Creates a function that returns its nth argument.

    Parameters

    • Optional n: number

      The index of the argument to return.

    Returns (...args: any[]) => any

    Returns the new function.

      • (...args: any[]): any
      • Creates a function that returns its nth argument.

        Parameters

        • Rest ...args: any[]

        Returns any

        Returns the new function.

once

  • once<T>(func: T): T
  • 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: (...args: any) => any

    Parameters

    • func: T

      The function to restrict.

    Returns T

    Returns the new restricted function.

over

  • over<TResult>(...iteratees: Many<(...args: any[]) => TResult>[]): (...args: any[]) => TResult[]
  • 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: any[]) => TResult>[]

      The iteratees to invoke.

    Returns (...args: any[]) => TResult[]

    Returns the new function.

      • (...args: any[]): TResult[]
      • Creates a function that invokes iteratees with the arguments provided to the created function and returns their results.

        Parameters

        • Rest ...args: any[]

        Returns TResult[]

        Returns the new function.

overArgs

  • overArgs(func: (...args: any[]) => any, ...transforms: Many<(...args: any[]) => any>[]): (...args: any[]) => any
  • Creates a function that runs each argument through a corresponding transform function.

    Parameters

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

      The function to wrap.

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

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

      The functions to transform arguments, specified as individual functions or arrays of functions.

    Returns (...args: any[]) => any

    Returns the new function.

      • (...args: any[]): any
      • Creates a function that runs each argument through a corresponding transform function.

        Parameters

        • Rest ...args: any[]

        Returns any

        Returns the new function.

overEvery

  • overEvery<T, Result1, Result2>(...predicates: [(arg: T) => arg is Result1, (arg: T) => arg is Result2]): (arg: T) => arg is Result1 & Result2
  • overEvery<T>(...predicates: Many<(...args: T[]) => boolean>[]): (...args: T[]) => boolean
  • 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: T) => arg is Result1, (arg: T) => arg is Result2]

      The predicates to check.

    Returns (arg: T) => arg is Result1 & Result2

    Returns the new function.

      • (arg: T): arg is Result1 & Result2
      • Creates a function that checks if all of the predicates return truthy when invoked with the arguments provided to the created function.

        Parameters

        • arg: T

        Returns arg is Result1 & Result2

        Returns the new function.

  • Type parameters

    • T

    Parameters

    • Rest ...predicates: Many<(...args: T[]) => boolean>[]

    Returns (...args: T[]) => boolean

      • (...args: T[]): boolean
      • Parameters

        • Rest ...args: T[]

        Returns boolean

overSome

  • overSome<T, Result1, Result2>(...predicates: [(arg: T) => arg is Result1, (arg: T) => arg is Result2]): (arg: T) => arg is Result1 | Result2
  • overSome<T>(...predicates: Many<(...args: T[]) => boolean>[]): (...args: T[]) => 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: T) => arg is Result1, (arg: T) => arg is Result2]

      The predicates to check.

    Returns (arg: T) => arg is Result1 | Result2

    Returns the new function.

      • (arg: T): arg is Result1 | Result2
      • Creates a function that checks if any of the predicates return truthy when invoked with the arguments provided to the created function.

        Parameters

        • arg: T

        Returns arg is Result1 | Result2

        Returns the new function.

  • Type parameters

    • T

    Parameters

    • Rest ...predicates: Many<(...args: T[]) => boolean>[]

    Returns (...args: T[]) => boolean

      • (...args: T[]): boolean
      • Parameters

        • Rest ...args: T[]

        Returns boolean

pad

  • pad(string?: string, length?: number, chars?: string): string
  • 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.

padEnd

  • padEnd(string?: string, length?: number, chars?: string): 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.

padStart

  • padStart(string?: string, length?: number, chars?: string): 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.

parseInt

  • parseInt(string: string, radix?: number): number
  • 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.

partition

  • partition<T, U>(collection: undefined | null | List<T>, callback: ValueIteratorTypeGuard<T, U>): [U[], Exclude<T, U>[]]
  • partition<T>(collection: undefined | null | List<T>, callback: ValueIteratee<T>): [T[], T[]]
  • partition<T>(collection: undefined | null | T, callback: ValueIteratee<T[keyof T]>): [T[keyof T][], T[keyof T][]]
  • 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.

  • see

    _.partition

    Type parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • callback: ValueIteratee<T>

    Returns [T[], T[]]

  • see

    _.partition

    Type parameters

    • T: object

    Parameters

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

    Returns [T[keyof T][], T[keyof T][]]

property

  • property<TObj, TResult>(path: PropertyPath): (obj: TObj) => TResult
  • 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: TObj) => TResult

    Returns the new function.

      • (obj: TObj): TResult
      • Creates a function that returns the property value at path on a given object.

        Parameters

        • obj: TObj

        Returns TResult

        Returns the new function.

propertyOf

  • propertyOf<T>(object: T): (path: PropertyPath) => any
  • The opposite of _.property; this method creates a function that returns the property value at a given path on object.

    Type parameters

    • T: {}

    Parameters

    • object: T

      The object to query.

    Returns (path: PropertyPath) => any

    Returns the new function.

      • (path: PropertyPath): any
      • The opposite of _.property; this method creates a function that returns the property value at a given path on object.

        Parameters

        • path: PropertyPath

        Returns any

        Returns the new function.

pull

  • pull<T>(array: T[], ...values: T[]): T[]
  • pull<T>(array: List<T>, ...values: T[]): List<T>
  • 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.

  • see

    _.pull

    Type parameters

    • T

    Parameters

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

    Returns List<T>

pullAt

  • pullAt<T>(array: T[], ...indexes: Many<number>[]): T[]
  • pullAt<T>(array: List<T>, ...indexes: Many<number>[]): List<T>
  • 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.

  • see

    _.pullAt

    Type parameters

    • T

    Parameters

    • array: List<T>
    • Rest ...indexes: Many<number>[]

    Returns List<T>

random

  • random(floating?: boolean): number
  • random(max: number, floating?: boolean): number
  • random(min: number, max: number, floating?: boolean): number
  • random(min: number, index: string | number, guard: object): number
  • 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.

  • see

    _.random

    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

range

  • range(start: number, end?: number, step?: number): number[]
  • range(end: number, index: string | number, guard: object): number[]
  • 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.

  • see

    _.range

    Parameters

    • end: number
    • index: string | number
    • guard: object

    Returns number[]

rearg

  • rearg(func: (...args: any[]) => any, ...indexes: Many<number>[]): (...args: any[]) => any
  • 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[]) => any

      The function to rearrange arguments for.

        • (...args: any[]): 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[]) => any

    Returns the new function.

      • (...args: any[]): any
      • 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

        • Rest ...args: any[]

        Returns any

        Returns the new function.

reduce

  • reduce<T, TResult>(collection: undefined | null | T[], callback: MemoListIterator<T, TResult, T[]>, accumulator: TResult): TResult
  • reduce<T, TResult>(collection: undefined | null | List<T>, callback: MemoListIterator<T, TResult, List<T>>, accumulator: TResult): TResult
  • reduce<T, TResult>(collection: undefined | null | T, callback: MemoObjectIterator<T[keyof T], TResult, T>, accumulator: TResult): TResult
  • reduce<T>(collection: undefined | null | T[], callback: MemoListIterator<T, T, T[]>): undefined | T
  • reduce<T>(collection: undefined | null | List<T>, callback: MemoListIterator<T, T, List<T>>): undefined | T
  • reduce<T>(collection: undefined | null | T, callback: MemoObjectIterator<T[keyof T], T[keyof T], T>): undefined | T[keyof T]
  • 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.

  • see

    _.reduce

    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: 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: object

    Parameters

    • collection: undefined | null | T
    • callback: MemoObjectIterator<T[keyof T], T[keyof T], T>

    Returns undefined | T[keyof T]

reduceRight

  • reduceRight<T, TResult>(collection: undefined | null | T[], callback: MemoListIterator<T, TResult, T[]>, accumulator: TResult): TResult
  • reduceRight<T, TResult>(collection: undefined | null | List<T>, callback: MemoListIterator<T, TResult, List<T>>, accumulator: TResult): TResult
  • reduceRight<T, TResult>(collection: undefined | null | T, callback: MemoObjectIterator<T[keyof T], TResult, T>, accumulator: TResult): TResult
  • reduceRight<T>(collection: undefined | null | T[], callback: MemoListIterator<T, T, T[]>): undefined | T
  • reduceRight<T>(collection: undefined | null | List<T>, callback: MemoListIterator<T, T, List<T>>): undefined | T
  • reduceRight<T>(collection: undefined | null | T, callback: MemoObjectIterator<T[keyof T], T[keyof T], T>): undefined | T[keyof T]
  • 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.

  • see

    _.reduceRight

    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: 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: object

    Parameters

    • collection: undefined | null | T
    • callback: MemoObjectIterator<T[keyof T], T[keyof T], T>

    Returns undefined | T[keyof T]

reject

  • reject(collection: undefined | null | string, predicate?: StringIterator<boolean>): string[]
  • reject<T>(collection: undefined | null | List<T>, predicate?: ListIterateeCustom<T, boolean>): T[]
  • reject<T>(collection: undefined | null | T, predicate?: ObjectIterateeCustom<T, boolean>): T[keyof T][]
  • 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.

  • see

    _.reject

    Type parameters

    • T

    Parameters

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

    Returns T[]

  • see

    _.reject

    Type parameters

    • T: object

    Parameters

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

    Returns T[keyof T][]

remove

  • remove<T>(array: List<T>, predicate?: ListIteratee<T>): T[]
  • 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.

repeat

  • repeat(string?: string, n?: number): string
  • 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.

replace

  • replace(string: string, pattern: string | RegExp, replacement: string | ReplaceFunction): string
  • replace(pattern: string | RegExp, replacement: string | ReplaceFunction): 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.

  • see

    _.replace

    Parameters

    • pattern: string | RegExp
    • replacement: string | ReplaceFunction

    Returns string

rest

  • rest(func: (...args: any[]) => any, start?: number): (...args: any[]) => any
  • 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[]) => any

      The function to apply a rest parameter to.

        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional start: number

      The start position of the rest parameter.

    Returns (...args: any[]) => any

    Returns the new function.

      • (...args: any[]): any
      • 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

        • Rest ...args: any[]

        Returns any

        Returns the new function.

result

  • result<TResult>(object: any, path: PropertyPath, defaultValue?: TResult | ((...args: any[]) => TResult)): TResult
  • 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: any[]) => TResult)

      The value returned if the resolved value is undefined.

    Returns TResult

    Returns the resolved value.

round

  • round(n: number, precision?: number): number
  • 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.

sample

  • sample<T>(collection: undefined | null | Dictionary<T> | NumericDictionary<T>): undefined | T
  • sample<T>(collection: undefined | null | T): undefined | T[keyof T]
  • Gets a random element from collection.

    Type parameters

    • T

    Parameters

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

      The collection to sample.

    Returns undefined | T

    Returns the random element.

  • see

    _.sample

    Type parameters

    • T: object

    Parameters

    • collection: undefined | null | T

    Returns undefined | T[keyof T]

sampleSize

  • sampleSize<T>(collection: undefined | null | Dictionary<T> | NumericDictionary<T>, n?: number): T[]
  • sampleSize<T>(collection: undefined | null | T, n?: number): T[keyof T][]
  • 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.

  • see

    _.sampleSize

    Type parameters

    • T: object

    Parameters

    • collection: undefined | null | T
    • Optional n: number

    Returns T[keyof T][]

set

  • set<T>(object: T, path: PropertyPath, value: any): T
  • set<TResult>(object: object, path: PropertyPath, value: any): TResult
  • 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: 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.

  • see

    _.set

    Type parameters

    • TResult

    Parameters

    • object: object
    • path: PropertyPath
    • value: any

    Returns TResult

setWith

  • setWith<T>(object: T, path: PropertyPath, value: any, customizer?: SetWithCustomizer<T>): T
  • setWith<T, TResult>(object: T, path: PropertyPath, value: any, customizer?: SetWithCustomizer<T>): TResult
  • 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: 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.

  • see

    _.setWith

    Type parameters

    • T: object

    • TResult

    Parameters

    • object: T
    • path: PropertyPath
    • value: any
    • Optional customizer: SetWithCustomizer<T>

    Returns TResult

shuffle

  • shuffle<T>(collection: undefined | null | List<T>): T[]
  • shuffle<T>(collection: undefined | null | T): T[keyof T][]
  • 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.

  • see

    _.shuffle

    Type parameters

    • T: object

    Parameters

    • collection: undefined | null | T

    Returns T[keyof T][]

size

  • size(collection: undefined | null | string | object): number
  • 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.

slice

  • slice<T>(array: undefined | null | List<T>, start?: number, end?: number): T[]
  • 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.

snakeCase

  • snakeCase(string?: string): string
  • Converts string to snake case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the snake cased string.

some

  • some<T>(collection: undefined | null | List<T>, predicate?: ListIterateeCustom<T, boolean>): boolean
  • some<T>(collection: undefined | null | T, predicate?: ObjectIterateeCustom<T, boolean>): boolean
  • 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.

  • see

    _.some

    Type parameters

    • T: object

    Parameters

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

    Returns boolean

split

  • split(string: undefined | null | string, separator?: string | RegExp, limit?: number): string[]
  • split(string: undefined | null | string, index: string | number, guard: object): string[]
  • 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.

  • see

    _.split

    Parameters

    • string: undefined | null | string
    • index: string | number
    • guard: object

    Returns string[]

spread

  • spread<TResult>(func: (...args: any[]) => TResult, start?: number): (...args: any[]) => TResult
  • 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: any[]) => TResult

      The function to spread arguments over.

        • (...args: any[]): TResult
        • Parameters

          • Rest ...args: any[]

          Returns TResult

    • Optional start: number

    Returns (...args: any[]) => TResult

    Returns the new function.

      • (...args: any[]): TResult
      • 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.

        Parameters

        • Rest ...args: any[]

        Returns TResult

        Returns the new function.

startCase

  • startCase(string?: string): string
  • Converts string to start case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the start cased string.

startsWith

  • startsWith(string?: string, target?: string, position?: number): boolean
  • 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.

stubArray

  • stubArray(): any[]
  • This method returns a new empty array.

    Returns any[]

    Returns the new empty array.

stubFalse

  • stubFalse(): false
  • stubFalse(): false
  • This method returns false.

    Returns false

    Returns false.

  • This method returns false.

    Returns false

    Returns false.

stubObject

  • stubObject(): any
  • This method returns a new empty object.

    Returns any

    Returns the new empty object.

stubString

  • stubString(): string
  • This method returns an empty string.

    Returns string

    Returns the empty string.

stubTrue

  • stubTrue(): true
  • stubTrue(): true
  • This method returns true.

    Returns true

    Returns true.

  • This method returns true.

    Returns true

    Returns true.

tail

  • tail<T>(array: undefined | null | List<T>): T[]
  • 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.

take

  • take<T>(array: undefined | null | List<T>, n?: number): T[]
  • 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.

takeRight

  • takeRight<T>(array: undefined | null | List<T>, n?: number): T[]
  • 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.

takeRightWhile

  • takeRightWhile<T>(array: undefined | null | List<T>, predicate?: ListIteratee<T>): T[]
  • 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.

takeWhile

  • takeWhile<T>(array: undefined | null | List<T>, predicate?: ListIteratee<T>): T[]
  • 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.

template

  • template(string?: string, options?: TemplateOptions): TemplateExecutor
  • 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.

throttle

  • 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: (...args: any) => 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.

times

  • times<TResult>(n: number, iteratee: (num: number) => TResult): TResult[]
  • times(n: number): number[]
  • 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: number) => TResult

      The function invoked per iteration.

        • (num: number): TResult
        • Parameters

          • num: number

          Returns TResult

    Returns TResult[]

    Returns the array of results.

  • see

    _.times

    Parameters

    • n: number

    Returns number[]

toArray

  • toArray<T>(value: undefined | null | Dictionary<T> | NumericDictionary<T>): T[]
  • toArray<T>(value: T): T[keyof T][]
  • toArray(): any[]
  • 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.

  • see

    _.toArray

    Type parameters

    • T

    Parameters

    • value: T

    Returns T[keyof T][]

  • see

    _.toArray

    Returns any[]

toLower

  • toLower(string?: string): string
  • Converts string, as a whole, to lower case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the lower cased string.

toPairs

  • toPairs<T>(object?: Dictionary<T> | NumericDictionary<T>): [string, T][]
  • toPairs(object?: object): [string, any][]
  • 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.

  • see

    _.toPairs

    Parameters

    • Optional object: object

    Returns [string, any][]

toPairsIn

  • toPairsIn<T>(object?: Dictionary<T> | NumericDictionary<T>): [string, T][]
  • toPairsIn(object?: object): [string, any][]
  • 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.

  • see

    _.toPairsIn

    Parameters

    • Optional object: object

    Returns [string, any][]

toPlainObject

  • toPlainObject(value?: any): any
  • 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.

toUpper

  • toUpper(string?: string): string
  • Converts string, as a whole, to upper case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the upper cased string.

transform

  • transform<T, TResult>(object: readonly T[], iteratee: MemoVoidArrayIterator<T, TResult>, accumulator?: TResult): TResult
  • transform<T, TResult>(object: Dictionary<T>, iteratee: MemoVoidDictionaryIterator<T, string, TResult>, accumulator?: TResult): TResult
  • transform<T, TResult>(object: T, iteratee: MemoVoidDictionaryIterator<T[keyof T], keyof T, TResult>, accumulator?: TResult): TResult
  • transform(object: any[]): any[]
  • transform(object: object): Dictionary<any>
  • 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.

  • see

    _.transform

    Type parameters

    • T

    • TResult

    Parameters

    • object: Dictionary<T>
    • iteratee: MemoVoidDictionaryIterator<T, string, TResult>
    • Optional accumulator: TResult

    Returns TResult

  • see

    _.transform

    Type parameters

    • T: 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>

trim

  • trim(string?: string, chars?: string): string
  • trim(string: string, index: string | number, guard: object): string
  • 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.

  • see

    _.trim

    Parameters

    • string: string
    • index: string | number
    • guard: object

    Returns string

trimEnd

  • trimEnd(string?: string, chars?: string): string
  • trimEnd(string: string, index: string | number, guard: object): string
  • 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.

  • see

    _.trimEnd

    Parameters

    • string: string
    • index: string | number
    • guard: object

    Returns string

trimStart

  • trimStart(string?: string, chars?: string): string
  • trimStart(string: string, index: string | number, guard: object): string
  • 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.

  • see

    _.trimStart

    Parameters

    • string: string
    • index: string | number
    • guard: object

    Returns string

truncate

  • truncate(string?: string, options?: TruncateOptions): string
  • 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.

unescape

  • unescape(string?: string): 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.

union

  • union<T>(...arrays: (undefined | null | List<T>)[]): T[]
  • 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.

unionBy

  • unionBy<T>(arrays: undefined | null | List<T>, iteratee?: ValueIteratee<T>): T[]
  • unionBy<T>(arrays1: undefined | null | List<T>, arrays2: undefined | null | List<T>, iteratee?: ValueIteratee<T>): T[]
  • unionBy<T>(arrays1: undefined | null | List<T>, arrays2: undefined | null | List<T>, arrays3: undefined | null | List<T>, iteratee?: ValueIteratee<T>): T[]
  • unionBy<T>(arrays1: undefined | null | List<T>, arrays2: undefined | null | List<T>, arrays3: undefined | null | List<T>, arrays4: undefined | null | List<T>, iteratee?: ValueIteratee<T>): T[]
  • unionBy<T>(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>, ...iteratee: (undefined | null | List<T> | ValueIteratee<T>)[]): T[]
  • 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.

  • see

    _.unionBy

    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[]

uniqueId

  • uniqueId(prefix?: string): string
  • 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.

unset

  • unset(object: any, path: PropertyPath): boolean
  • 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.

unzip

  • unzip<T>(array: undefined | null | T[][] | List<List<T>>): T[][]
  • 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.

unzipWith

  • unzipWith<T, TResult>(array: undefined | null | List<List<T>>, iteratee: (...values: T[]) => TResult): TResult[]
  • unzipWith<T>(array: undefined | null | List<List<T>>): T[][]
  • 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: T[]) => TResult

      The function to combine regrouped values.

        • (...values: T[]): TResult
        • Parameters

          • Rest ...values: T[]

          Returns TResult

    Returns TResult[]

    Returns the new array of regrouped elements.

  • see

    _.unzipWith

    Type parameters

    • T

    Parameters

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

    Returns T[][]

update

  • update(object: object, path: PropertyPath, updater: (value: any) => any): any
  • 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) => any

      The function to produce the updated value.

        • (value: any): any
        • Parameters

          • value: any

          Returns any

    Returns any

    Returns object.

upperCase

  • upperCase(string?: string): string
  • Converts string, as space separated words, to upper case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the upper cased string.

upperFirst

  • upperFirst(string?: string): string
  • Converts the first character of string to upper case.

    Parameters

    • Optional string: string

      The string to convert.

    Returns string

    Returns the converted string.

values

  • values<T>(object: undefined | null | Dictionary<T> | NumericDictionary<T> | List<T>): T[]
  • values<T>(object: undefined | null | T): T[keyof T][]
  • values(object: any): any[]
  • 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.

  • see

    _.values

    Type parameters

    • T: object

    Parameters

    • object: undefined | null | T

    Returns T[keyof T][]

  • see

    _.values

    Parameters

    • object: any

    Returns any[]

valuesIn

  • valuesIn<T>(object: undefined | null | Dictionary<T> | NumericDictionary<T> | List<T>): T[]
  • valuesIn<T>(object: undefined | null | T): T[keyof T][]
  • 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.

  • see

    _.valuesIn

    Type parameters

    • T: object

    Parameters

    • object: undefined | null | T

    Returns T[keyof T][]

without

  • without<T>(array: undefined | null | List<T>, ...values: T[]): T[]
  • 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.

words

  • words(string?: string, pattern?: string | RegExp): string[]
  • words(string: string, index: string | number, guard: object): string[]
  • 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.

  • see

    _.words

    Parameters

    • string: string
    • index: string | number
    • guard: object

    Returns string[]

wrap

  • wrap<T, TArgs, TResult>(value: T, wrapper: (value: T, ...args: TArgs[]) => TResult): (...args: TArgs[]) => TResult
  • 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: T, ...args: TArgs[]) => TResult

      The wrapper function.

        • (value: T, ...args: TArgs[]): TResult
        • Parameters

          • value: T
          • Rest ...args: TArgs[]

          Returns TResult

    Returns (...args: TArgs[]) => TResult

    Returns the new function.

      • (...args: TArgs[]): TResult
      • 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.

        Parameters

        • Rest ...args: TArgs[]

        Returns TResult

        Returns the new function.

xor

  • xor<T>(...arrays: (undefined | null | List<T>)[]): T[]
  • 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.

zip

  • zip<T1, T2>(arrays1: List<T1>, arrays2: List<T2>): [undefined | T1, undefined | T2][]
  • zip<T1, T2, T3>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>): [undefined | T1, undefined | T2, undefined | T3][]
  • zip<T1, T2, T3, T4>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>): [undefined | T1, undefined | T2, undefined | T3, undefined | T4][]
  • zip<T1, T2, T3, T4, T5>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>, arrays5: List<T5>): [undefined | T1, undefined | T2, undefined | T3, undefined | T4, undefined | T5][]
  • zip<T>(...arrays: (undefined | null | List<T>)[]): (undefined | T)[][]
  • 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.

  • see

    _.zip

    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)[][]

zipObject

  • zipObject<T>(props: List<PropertyName>, values: List<T>): Dictionary<T>
  • zipObject(props?: List<PropertyName>): Dictionary<undefined>
  • 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.

  • see

    _.zipObject

    Parameters

    • Optional props: List<PropertyName>

    Returns Dictionary<undefined>

zipObjectDeep

  • zipObjectDeep(paths?: List<PropertyPath>, values?: List<any>): object
  • 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.

zipWith

  • zipWith<T, TResult>(arrays: List<T>, iteratee: (value1: T) => TResult): TResult[]
  • zipWith<T1, T2, TResult>(arrays1: List<T1>, arrays2: List<T2>, iteratee: (value1: T1, value2: T2) => TResult): TResult[]
  • zipWith<T1, T2, T3, TResult>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, iteratee: (value1: T1, value2: T2, value3: T3) => TResult): TResult[]
  • zipWith<T1, T2, T3, T4, TResult>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>, iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult): TResult[]
  • zipWith<T1, T2, T3, T4, T5, TResult>(arrays1: List<T1>, arrays2: List<T2>, arrays3: List<T3>, arrays4: List<T4>, arrays5: List<T5>, iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult): TResult[]
  • zipWith<T, TResult>(...iteratee: (undefined | null | ((...group: T[]) => TResult) | List<T>)[]): TResult[]
  • 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: T) => TResult

      The function to combine grouped values.

        • (value1: T): TResult
        • Parameters

          • value1: T

          Returns TResult

    Returns TResult[]

    Returns the new array of grouped elements.

  • see

    _.zipWith

    Type parameters

    • T1

    • T2

    • TResult

    Parameters

    • arrays1: List<T1>
    • arrays2: List<T2>
    • iteratee: (value1: T1, value2: T2) => TResult
        • (value1: T1, value2: T2): TResult
        • Parameters

          • value1: T1
          • value2: T2

          Returns TResult

    Returns TResult[]

  • see

    _.zipWith

    Type parameters

    • T1

    • T2

    • T3

    • TResult

    Parameters

    • arrays1: List<T1>
    • arrays2: List<T2>
    • arrays3: List<T3>
    • iteratee: (value1: T1, value2: T2, value3: T3) => TResult
        • (value1: T1, value2: T2, value3: T3): TResult
        • Parameters

          • value1: T1
          • value2: T2
          • value3: T3

          Returns 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: T1, value2: T2, value3: T3, value4: T4) => TResult
        • (value1: T1, value2: T2, value3: T3, value4: T4): TResult
        • Parameters

          • value1: T1
          • value2: T2
          • value3: T3
          • value4: T4

          Returns 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: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult
        • (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5): 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: T[]) => TResult) | List<T>)[]

    Returns TResult[]

Util Functions

cond

  • cond<T, R>(pairs: CondPair<T, R>[]): (Target: T) => R
  • 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.

    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: CondPair<T, R>[]

      The predicate-function pairs.

    Returns (Target: T) => R

    Returns the new composite function.

      • (Target: T): R
      • 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.

        since

        4.0.0

        category

        Util

        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'

        Parameters

        • Target: T

        Returns R

        Returns the new composite function.

iteratee

  • iteratee<TFunction>(func: TFunction): TFunction
  • iteratee(func: string | object): (...args: any[]) => any
  • 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.

    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 }]

    Type parameters

    • TFunction: (...args: any[]) => any

    Parameters

    • func: TFunction

    Returns TFunction

    Returns the callback.

  • see

    _.iteratee

    Parameters

    • func: string | object

    Returns (...args: any[]) => any

      • (...args: any[]): any
      • see

        _.iteratee

        Parameters

        • Rest ...args: any[]

        Returns any

rangeRight

  • rangeRight(start: number, end?: number, step?: number): number[]
  • rangeRight(end: number, index: string | number, guard: object): number[]
  • This method is like _.range except that it populates values in descending order.

    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

    • 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.

  • see

    _.rangeRight

    Parameters

    • end: number
    • index: string | number
    • guard: object

    Returns number[]

toPath

  • toPath(value: any): string[]
  • Converts value to a 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

    Parameters

    • value: any

      The value to convert.

    Returns string[]

    Returns the new property path array.

Generated using TypeDoc