Skip to content

Commit

Permalink
Tweaked readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Feb 19, 2023
1 parent 8fa21fc commit d86040f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# `ts-reset`

`ts-reset` acts like a CSS reset for TypeScript. It improves typings for JavaScript API's like `fetch`, `JSON.parse` and `.filter()`, making them safer and smarter.
Whenever you add TypeScript to a project, you're opting into over tens of thousands of lines of declaration files. These files help describe JavaScript itself - `lib.dom.d.ts` describes the DOM, and `lib.d.ts` describes JavaScript itself.

These typings are not perfect.

- `.json` (in `fetch`) and `JSON.parse` both return `any`
- `.filter(Boolean)` doesn't behave how you expect
- `array.includes` often breaks

`ts-reset` smooths over these hard edges, just like a CSS reset does in the browser.

```ts
// Import in a single file, then across your whole project...
Expand Down

0 comments on commit d86040f

Please sign in to comment.