Skip to content

Commit cfb5391

Browse files
committed
better comment for dissoc
1 parent 8c36fba commit cfb5391

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

types/dissoc.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Placeholder } from './util/tools';
22

3-
// `string extends keyof U` is to support `Record<string, T>`
3+
// `string extends keyof U` is true only for `Record<string, T>`, where the keys are not known, something that still needs to be supported
44
export function dissoc<K extends PropertyKey>(prop: K extends Placeholder ? never : K): <U extends { [P in K]?: any}>(obj: string extends keyof U ? U : undefined extends U[K] ? U : never) => U;
55
export function dissoc<U>(__: Placeholder, obj: U): <K extends keyof U>(prop: string extends keyof U ? K : undefined extends U[K] ? K : never) => U;
66
export function dissoc<U, K extends keyof U>(prop: string extends keyof U ? K : undefined extends U[K] ? K : never, obj: U): U;

0 commit comments

Comments
 (0)