• Safely removes a property from an object and infers new signature

    Example

    const fruit: Fruit = { color: 'yellow', kind: 'banana' }
    const withoutKind = removeProperty(fruit, 'color') // { kind: 'banana' }

    Type Parameters

    • T extends { [ K in string | number | symbol]: unknown }

    • U extends string | number | symbol

    Parameters

    • object: T
    • key: U

    Returns Omit<T, U>

Generated using TypeDoc