Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
6 lines
841 B
Plaintext
6 lines
841 B
Plaintext
import { Builtin } from "../built-in";
|
|
import { IsUnknown } from "../is-unknown";
|
|
export type DeepWritable<Type> = Type extends Exclude<Builtin, Error> ? Type : Type extends Map<infer Key, infer Value> ? Map<DeepWritable<Key>, DeepWritable<Value>> : Type extends ReadonlyMap<infer Key, infer Value> ? Map<DeepWritable<Key>, DeepWritable<Value>> : Type extends WeakMap<infer Key, infer Value> ? WeakMap<DeepWritable<Key>, DeepWritable<Value>> : Type extends Set<infer Values> ? Set<DeepWritable<Values>> : Type extends ReadonlySet<infer Values> ? Set<DeepWritable<Values>> : Type extends WeakSet<infer Values> ? WeakSet<DeepWritable<Values>> : Type extends Promise<infer Value> ? Promise<DeepWritable<Value>> : Type extends {} ? {
|
|
-readonly [Key in keyof Type]: DeepWritable<Type[Key]>;
|
|
} : IsUnknown<Type> extends true ? unknown : Type;
|