ts-reset icon indicating copy to clipboard operation
ts-reset copied to clipboard

A 'CSS reset' for TypeScript, improving types for common JavaScript API's

Results 91 ts-reset issues
Sort by recently updated
recently updated
newest added

#182 I'll change the tests if you think this is worth merging

Currently calling the filter(Boolean) method on a tuple turns it into an array of union: ```ts let tuple = ["foo", undefined, "bar", 0] as const; tuple.filter(Boolean) // ("foo" | "bar")[]...

Please let me know if I missed anything in this. Fixes: https://github.com/total-typescript/ts-reset/issues/173

Hi, ```ts // you need to save/refresh page in playground to get rid of effect after (un)comment // import '@total-typescript/ts-reset'; const isPropTruthy = (propName: K) => { return (item: T):...

`new Array()` returns `any[]`, so filling it with given value doesn't narrow the array type. Maybe this could be improved here. ![image](https://user-images.githubusercontent.com/24491503/233929781-92fc27d8-831d-40db-995b-c486e2992b97.png) https://www.typescriptlang.org/play?#code/MYewdgzgLgBAhgJwTAvDMBTA7jAgkuATwAoBGABgEoA6AMwEsAbR4qgWACgB6LmPmAHoB+IA

KeyboardEvent.key is typed as a string, even though it's a union of string literals. ```tsx window.addEventListener('keydown', (e)=>{ // string type e.key }) ``` Would be really nice to get autocomplete...

Just setup ts-reset for my monorepo and found this was the most painless way to do it, updated the README to reflect how I set this up for my monorepo,...

This PR adds improved typings to `Array.every` when using the `Boolean` constructor, in a way that's very similar to what's already being done for `Array.filter`. After extensive testing, these types...

Would anyone else find it useful to add the string type to the number passed to a NumberFormat.format call? I've been using this with a decimal math library, and am...

As discussed in #49 a simple `: searchElement is T` won't do, because the assertion is too strong and produces wrong types, especially in the "opposite" cases (e.g. else blocks)....