File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -490,14 +490,25 @@ export type UnwrapRef<T> = T extends ShallowRef<infer V>
490
490
? UnwrapRefSimple < V >
491
491
: UnwrapRefSimple < T >
492
492
493
+ type UnwrapRefCollection < T extends CollectionTypes > = T extends Set < infer V >
494
+ ? Set < UnwrapRefSimple < V > >
495
+ : T extends Map < infer K , infer V >
496
+ ? Map < K , UnwrapRefSimple < V > >
497
+ : T extends WeakSet < infer V >
498
+ ? WeakSet < UnwrapRefSimple < V > >
499
+ : T extends WeakMap < infer K , infer V >
500
+ ? WeakMap < K , UnwrapRefSimple < V > >
501
+ : T
502
+
493
503
export type UnwrapRefSimple < T > = T extends
494
504
| Function
495
- | CollectionTypes
496
505
| BaseTypes
497
506
| Ref
498
507
| RefUnwrapBailTypes [ keyof RefUnwrapBailTypes ]
499
508
| { [ RawSymbol ] ?: true }
500
509
? T
510
+ : T extends CollectionTypes
511
+ ? UnwrapRefCollection < T >
501
512
: T extends ReadonlyArray < any >
502
513
? { [ K in keyof T ] : UnwrapRefSimple < T [ K ] > }
503
514
: T extends object & { [ ShallowReactiveMarker ] ?: never }
You can’t perform that action at this time.
0 commit comments