Function filter

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    • R

    Parameters

    • collection: T[]

      the collection to be filtered

    • fn: ((value: T, index: number) => value is R)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, index: number): value is R
        • Parameters

          • value: T
          • index: number

          Returns value is R

    Returns R[]

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    • R

    Parameters

    • collection: Nullable<T[]>

      the collection to be filtered

    • fn: ((value: T, index: number) => value is R)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, index: number): value is R
        • Parameters

          • value: T
          • index: number

          Returns value is R

    Returns Nullable<R[]>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    • R

    Parameters

    • collection: Undefinable<T[]>

      the collection to be filtered

    • fn: ((value: T, index: number) => value is R)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, index: number): value is R
        • Parameters

          • value: T
          • index: number

          Returns value is R

    Returns Undefinable<R[]>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    • R

    Parameters

    • collection: Optional<T[]>

      the collection to be filtered

    • fn: ((value: T, index: number) => value is R)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, index: number): value is R
        • Parameters

          • value: T
          • index: number

          Returns value is R

    Returns Optional<R[]>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    • R

    Parameters

    • collection: Dictionary<T>

      the collection to be filtered

    • fn: ((value: T, key: string) => value is R)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, key: string): value is R
        • Parameters

          • value: T
          • key: string

          Returns value is R

    Returns Dictionary<R>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    • R

    Parameters

    • collection: Nullable<Dictionary<T>>

      the collection to be filtered

    • fn: ((value: T, key: string) => value is R)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, key: string): value is R
        • Parameters

          • value: T
          • key: string

          Returns value is R

    Returns Nullable<Dictionary<R>>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    • R

    Parameters

    • collection: Undefinable<Dictionary<T>>

      the collection to be filtered

    • fn: ((value: T, key: string) => value is R)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, key: string): value is R
        • Parameters

          • value: T
          • key: string

          Returns value is R

    Returns Undefinable<Dictionary<R>>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    • R

    Parameters

    • collection: Optional<Dictionary<T>>

      the collection to be filtered

    • fn: ((value: T, key: string) => value is R)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, key: string): value is R
        • Parameters

          • value: T
          • key: string

          Returns value is R

    Returns Optional<Dictionary<R>>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    Parameters

    • collection: T[]

      the collection to be filtered

    • fn: ((value: T, index: number) => boolean)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, index: number): boolean
        • Parameters

          • value: T
          • index: number

          Returns boolean

    Returns T[]

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    Parameters

    • collection: Nullable<T[]>

      the collection to be filtered

    • fn: ((value: T, index: number) => boolean)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, index: number): boolean
        • Parameters

          • value: T
          • index: number

          Returns boolean

    Returns Nullable<T[]>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    Parameters

    • collection: Undefinable<T[]>

      the collection to be filtered

    • fn: ((value: T, index: number) => boolean)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, index: number): boolean
        • Parameters

          • value: T
          • index: number

          Returns boolean

    Returns Undefinable<T[]>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    Parameters

    • collection: Optional<T[]>

      the collection to be filtered

    • fn: ((value: T, index: number) => boolean)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, index: number): boolean
        • Parameters

          • value: T
          • index: number

          Returns boolean

    Returns Optional<T[]>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    Parameters

    • collection: Dictionary<T>

      the collection to be filtered

    • fn: ((value: T, key: string) => boolean)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns Dictionary<T>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    Parameters

    • collection: Nullable<Dictionary<T>>

      the collection to be filtered

    • fn: ((value: T, key: string) => boolean)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns Nullable<Dictionary<T>>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    Parameters

    • collection: Undefinable<Dictionary<T>>

      the collection to be filtered

    • fn: ((value: T, key: string) => boolean)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns Undefinable<Dictionary<T>>

  • Filters elements from the collection for which the filter function returns true. This function will always return the same type of collection. This means that if you pass nullable dictionary, you will also receive nullable dictionary.

    If the collection is null or undefined, the function will immediately return.

    Returns

    the same type of collection with filtered elements.

    Type Parameters

    • T

    Parameters

    • collection: Optional<Dictionary<T>>

      the collection to be filtered

    • fn: ((value: T, key: string) => boolean)

      predicate that receives the value and index (or key) of the collection element. Function must return true for elements that should appear in the filtered collection, false otherwise.

        • (value: T, key: string): boolean
        • Parameters

          • value: T
          • key: string

          Returns boolean

    Returns Optional<Dictionary<T>>

Generated using TypeDoc