• Creates an object composed of the object properties predicate returns truthy for.

    Differences from lodash:

    • does not treat sparse arrays as dense

    Contribution to minified bundle size, when it is the only function imported:

    • Lodash: 17,091 bytes
    • Micro-dash: 346 bytes

    Type Parameters

    • T
    • O

    Parameters

    • object: Nil | readonly T[]
    • predicate: ValueNarrowingIteratee<T[], O>

    Returns Record<number, Narrow<T, O>>

  • Type Parameters

    • T

    Parameters

    • object: Nil | readonly T[]
    • predicate: ObjectIteratee<T, boolean>

    Returns Record<number, T>

  • Type Parameters

    • I
    • T extends {}
    • O

    Parameters

    • object: I
    • predicate: ValueNarrowingIteratee<T, O>

    Returns Evaluate<IfCouldBe<I, Nil, {}> | {
        [K in KeysWithMaybeIncludedValues<T, O>]?: Narrow<T[K], O>
    } & {
        [K in KeysWithDefinitelyIncludedValues<T, O>]: Narrow<T[K], O>
    }>

  • Type Parameters

    • I
    • T extends {}
    • O

    Parameters

    • object: I
    • predicate: KeyNarrowingIteratee<T, O>

    Returns Evaluate<IfCouldBe<I, Nil, {}> | {
        [K in DefinitelyIncludedKeys<T, O>]: T[K]
    } & {
        [K in MaybeIncludedKeys<T, O>]?: T[K]
    }>

  • Type Parameters

    • T

    Parameters

    • object: T
    • predicate: ObjectIteratee<T, boolean>

    Returns Evaluate<PartialExceptIndexes<NonNullable<T>>>