fix(types): ensure that DeepReadonly handles Ref type properly (#4714)

This commit is contained in:
Thorsten Lünborg 2021-10-08 00:30:54 +02:00 committed by GitHub
parent 1779ff8eb0
commit ed0071ac1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,6 +132,8 @@ export type DeepReadonly<T> = T extends Builtin
? WeakSet<DeepReadonly<U>>
: T extends Promise<infer U>
? Promise<DeepReadonly<U>>
: T extends Ref<infer U>
? Ref<DeepReadonly<U>>
: T extends {}
? { readonly [K in keyof T]: DeepReadonly<T[K]> }
: Readonly<T>