Skip to content

Commit 6c84802

Browse files
committed
Include additional test cases
1 parent de00d90 commit 6c84802

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test-d/unwrap-partial.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,17 @@ type ArrayLikeTestType = {
7474
[index: number]: string;
7575
};
7676

77+
type PlainObjectTestType = {
78+
readonly [key: string]: number | undefined;
79+
};
80+
7781
expectType<ArrayLikeTestType>({} as UnwrapPartial<Partial<ArrayLikeTestType>>);
82+
expectType<PlainObjectTestType>({} as UnwrapPartial<PlainObjectTestType>);
7883
expectType<Record<number, string>>({} as UnwrapPartial<Partial<Record<number, string>>>);
7984
expectType<string[]>({} as UnwrapPartial<Partial<string[]>>);
85+
expectType<Array<string | undefined>>({} as UnwrapPartial<Array<string | undefined>>);
86+
expectNever({} as UnwrapPartial<string[]>);
87+
expectNever({} as UnwrapPartial<{[p: string]: number}>);
8088

8189
// `UnwrapPartial` works with tuples
8290
type TestTuple = [string, number, boolean];

0 commit comments

Comments
 (0)