Skip to content

Commit

Permalink
test(dts-test): fix OptionalKeys utility type declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
DrJume committed Dec 6, 2023
1 parent f4458ec commit b98875f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/dts-test/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export type IsAny<T> = 0 extends 1 & T ? true : false
export type Prettify<T> = { [K in keyof T]: T[K] } & {}

// https://github.com/unional/type-plus/blob/a89e140ca7c0ce6b744fbd1b157686cdfa4332c7/type-plus/ts/object/optional_key.ts#L29C1-L31C9
https: export type OptionalKeys<T> = T extends unknown
export type OptionalKeys<T> = T extends unknown
? {
[k in keyof T]-?: Record<KeyTypes, any> extends Pick<T, k> ? k : never
[k in keyof T]-?: Record<keyof any, any> extends Pick<T, k> ? k : never
}[keyof T]
: never

0 comments on commit b98875f

Please sign in to comment.