• Pick Properties from an Object

    Type Parameters

    • Object extends Record<any, any>
    • Keys extends string | number | symbol

    Parameters

    Returns Pick<Object, Keys>

    Example

    import { object } from "@rjweb/utils"

    object.pick({ ok: true, e: 0 }, ['ok']) // { ok: true }
    object.pick({ ok: true, e: 0 }, ['ok', 'e']) // { ok: true, e: 0 }

    Since

    1.12.15

    Supports

    nodejs, browser