mobily / ts-belt

🔧 Fast, modern, and practical utility library for FP in TypeScript.
https://mobily.github.io/ts-belt
MIT License
1.1k stars 30 forks source link

fix(Dict): D.keys correct type #47

Closed Nodonisko closed 1 year ago

Nodonisko commented 1 year ago

This should fix issue with wrong types of D.keys. All keys are now converted to string in types:

const k = keys({
  a: 'hello',
  b: 'badw',
  c: 'gas',
  1: 'sadwd',
  2: 'dadw',
  3: 'dawdw',
})

before fix readonly ("a" | "b" | "c" | 1 | 2 | 3)[]

after fix readonly ("a" | "b" | "c" | "1" | "2" | "3")[]

I am not sure if I contributed correctly, I was not able to find guide how to do it, so I edited TS files directly, but they seems kind of autogenerated because Dict/Dict.ts and Dict/index.ts are nearly same, only index is without comments.

Closes #46 Related to https://github.com/microsoft/TypeScript/issues/39543

mobily commented 1 year ago

@Nodonisko this looks great! thanks for your contribution 🎉