File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -510,13 +510,16 @@ describe('resolveType', () => {
510
510
type Foo = Record<symbol | string, any>
511
511
type Bar = { [key: string]: any }
512
512
type AnyRecord = Record<keyof any, any>
513
+ type Baz = { a: 1, ${ 1 } : 2, b: 3}
513
514
514
515
defineProps<{
515
516
record: keyof Foo,
516
517
anyRecord: keyof AnyRecord
517
518
partial: keyof Partial<Bar>,
518
519
required: keyof Required<Bar>,
519
520
readonly: keyof Readonly<Bar>,
521
+ pick: keyof Pick<Baz, 'a' | 1>
522
+ extract: keyof Extract<keyof Baz, 'a' | 1>
520
523
}>()
521
524
` ,
522
525
)
@@ -527,6 +530,8 @@ describe('resolveType', () => {
527
530
partial : [ 'String' ] ,
528
531
required : [ 'String' ] ,
529
532
readonly : [ 'String' ] ,
533
+ pick : [ 'String' , 'Number' ] ,
534
+ extract : [ 'String' , 'Number' ] ,
530
535
} )
531
536
} )
532
537
Original file line number Diff line number Diff line change @@ -1559,6 +1559,16 @@ export function inferRuntimeType(
1559
1559
)
1560
1560
}
1561
1561
break
1562
+ case 'Pick' :
1563
+ case 'Extract' :
1564
+ if ( node . typeParameters && node . typeParameters . params [ 1 ] ) {
1565
+ return inferRuntimeType (
1566
+ ctx ,
1567
+ node . typeParameters . params [ 1 ] ,
1568
+ scope ,
1569
+ )
1570
+ }
1571
+ break
1562
1572
1563
1573
case 'Function' :
1564
1574
case 'Object' :
You can’t perform that action at this time.
0 commit comments