Function toPlainObjectOf

Creates an object from x with keys k if f(x[k]) returns true. If x is not a plain object, or there's no passed props, returns undefined.

  • Type Parameters

    • T

    Parameters

    • x: unknown
    • f: ((v: unknown) => v is T)
        • (v): v is T
        • Parameters

          • v: unknown

          Returns v is T

    Returns undefined | {
        [key: PropertyKey]: T;
    }