Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Aug 18, 2023
1 parent c826a14 commit 5c357fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/non-empty-object.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ const update2: UpdateRequest<User> = {}; // that's a bug!
*/
export type NonEmptyObject<T> = {
[K in keyof T]-?: Pick<Required<T>, K>
}[keyof T]
}[keyof T];
4 changes: 2 additions & 2 deletions test-d/non-empty-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ declare const test3: NonEmptyObject3;
declare const test4: NonEmptyObject4;

expectType<TestType1>(test1);
expectType<{a: string; b?: boolean}|{a?: string; b: boolean}>(test2);
expectType<TestType3|{a?: string; b: boolean}>(test3);
expectType<{a: string; b?: boolean} | {a?: string; b: boolean}>(test2);
expectType<TestType3 | {a?: string; b: boolean}>(test3);
expectType<never>(test4);

0 comments on commit 5c357fc

Please sign in to comment.