Type alias ReplaceDeep<T, TCondition, TValue>

ReplaceDeep<T, TCondition, TValue>: T extends TCondition
    ? TValue
    : T extends Record<string, any>
        ? {
            [K in keyof T]: ReplaceDeep<T[K], TCondition, TValue>
        }
        : T

ReplaceDeep<T, TCondition, TValue> Recursively replaces values in type T that match TCondition with TValue.

See SpreadDeepObject for more details on recursive behavior.

Type Parameters

  • T

    The type to be modified.

  • TCondition

    The condition to match for replacement.

  • TValue

    The type to replace with.

Returns

The modified type.

Generated using TypeDoc