Type Alias ShallowCopiedValue<T>

ShallowCopiedValue<T>: T extends Primitive
    ? T
    : {
        [K in keyof T]: ReadonlyDeep<T[K]>
    }

Transforms a JSON-compatible type T such that top-level properties remain mutable if they were before, but nested arrays or basic objects become read-only.

Warning: This does not fully guarantee immutability. See ReadonlyDeep for more details.

Type Parameters

  • T