Skip to content

Commit

Permalink
better comment for dissoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Harris-Miller committed Oct 11, 2023
1 parent c6512d9 commit 25c70b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/dissoc.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Placeholder } from './util/tools';

// `string extends keyof U` is to support `Record<string, T>`
// `string extends keyof U` is true only for `Record<string, T>`, where the keys are not known, something that still needs to be supported
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;
export function dissoc<U>(__: Placeholder, obj: U): <K extends keyof U>(prop: string extends keyof U ? K : undefined extends U[K] ? K : never) => U;
export function dissoc<U, K extends keyof U>(prop: string extends keyof U ? K : undefined extends U[K] ? K : never, obj: U): U;

0 comments on commit 25c70b2

Please sign in to comment.