Function replaceProperty

  • Replace a property on an objcet with a different type

    Returns

    An object with the property replaced

    Type Parameters

    • T extends {}

    • K extends string | number | symbol

    • P

    Parameters

    • object: T

      The object

    • property: K

      The property to replace

    • replacer: ((value: T[K]) => P)

      Function to take the value and return the new value

        • (value: T[K]): P
        • Parameters

          • value: T[K]

          Returns P

    Returns Omit<T, K> & { [ key in string | number | symbol]: P }

Generated using TypeDoc