total-typescript / ts-reset

A 'CSS reset' for TypeScript, improving types for common JavaScript API's
https://www.totaltypescript.com/ts-reset
MIT License
7.74k stars 117 forks source link

Improve `WidenLiteral` #170

Closed aswinsvijay closed 10 months ago

mattpocock commented 10 months ago

One thing I'm worried about here is that without a certain target (ESNext works, ES2017 doesn't), bigint doesn't have a valueOf attribute.

aswinsvijay commented 10 months ago

One thing I'm worried about here is that without a certain target (ESNext works, ES2017 doesn't), bigint doesn't have a valueOf attribute.

True, I could keep the bigint part as it was before, but that would affect the elegance of the solution. Well it's not a solution if it doesn't work for everything now, is it? 🤷‍♂️

mattpocock commented 10 months ago

I guess not - I'm more comfortable with the uglier code that we know works. Feels like we could trip ourselves up easily here.