We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Based on the current definition:
function toPairs<T, K extends string | number>(dict: Record<K, T>): Array<readonly [string, T]>
The first element in each pair is a string but it should use the generic type K. For example:
string
K
type Keys = 'foo' | 'bar' | 'baz'; const input: Record<Keys, number> = {foo: 42, bar: 0, baz: -1}; const output = D.toPairs(input);
The definition for output in the .d.ts becomes:
output
.d.ts
declare const output: (readonly [string, number])[];
But I'd expect it to be:
declare const output: (readonly [Keys, number])[];
Typescript Playground Example
By updating the definition to:
function toPairs<T, K extends string | number>(dict: Record<K, T>): Array<readonly [K, T]>;
This seems to fix it (see playground) but I'm not enough across how the gentype rescript stuff works to be able to make a PR.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Based on the current definition:
The first element in each pair is a
string
but it should use the generic typeK
. For example:The definition for
output
in the.d.ts
becomes:But I'd expect it to be:
Typescript Playground Example
By updating the definition to:
This seems to fix it (see playground) but I'm not enough across how the gentype rescript stuff works to be able to make a PR.
The text was updated successfully, but these errors were encountered: