@wopjs/cast - v0.1.12
    Preparing search index...

    Function inertFilterMap

    • Lazy filterMap that avoids creating a new array when possible.

      Type Parameters

      • T
      • U = T

      Parameters

      • arr: T[]
      • callbackfn: (value: T, index: number, arr: T[]) => U | undefined

        Return undefined to filter out the item, or return a value to map the item.

      • OptionalthisArg: any

      Returns Defined<U>[]

      the original array if callbackfn returns the same value for all items, otherwise a new array with the mapped items.

    • Lazy filterMap that avoids creating a new array when possible.

      Type Parameters

      • T
      • U = T

      Parameters

      • arr: T[] | undefined
      • callbackfn: (value: T, index: number, arr: T[]) => U | undefined

        Return undefined to filter out the item, or return a value to map the item.

      • OptionalthisArg: any

      Returns Defined<U>[] | undefined

      the original array if callbackfn returns the same value for all items, otherwise a new array with the mapped items.

    • Lazy filterMap that avoids creating a new array when possible.

      Type Parameters

      • T
      • U = T

      Parameters

      • arr: readonly T[]
      • callbackfn: (value: T, index: number, arr: readonly T[]) => U | undefined

        Return undefined to filter out the item, or return a value to map the item.

      • OptionalthisArg: any

      Returns readonly Defined<U>[]

      the original array if callbackfn returns the same value for all items, otherwise a new array with the mapped items.

    • Lazy filterMap that avoids creating a new array when possible.

      Type Parameters

      • T
      • U = T

      Parameters

      • arr: readonly T[] | undefined
      • callbackfn: (value: T, index: number, arr: readonly T[]) => U | undefined

        Return undefined to filter out the item, or return a value to map the item.

      • OptionalthisArg: any

      Returns readonly Defined<U>[] | undefined

      the original array if callbackfn returns the same value for all items, otherwise a new array with the mapped items.