]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(types): ensure that DeepReadonly handles Ref type properly (#4714)
authorThorsten Lünborg <t.luenborg@googlemail.com>
Thu, 7 Oct 2021 22:30:54 +0000 (00:30 +0200)
committerGitHub <noreply@github.com>
Thu, 7 Oct 2021 22:30:54 +0000 (18:30 -0400)
packages/reactivity/src/reactive.ts

index 92fd172707becc66c9077f8ee9f21f60dd676e68..9cce2ea0e640b92c51489bc1876d3270790035a3 100644 (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>