{"id":13847267,"url":"https://github.com/garronej/tsafe","last_synced_at":"2025-05-14T13:09:26.531Z","repository":{"id":42065756,"uuid":"352766502","full_name":"garronej/tsafe","owner":"garronej","description":"🔩 The missing TypeScript utils","archived":false,"fork":false,"pushed_at":"2024-12-12T10:30:47.000Z","size":37059,"stargazers_count":453,"open_issues_count":7,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-11T22:40:36.531Z","etag":null,"topics":["deno","hacktoberfest","node","npm","testing","type-safety","typescript","utilities"],"latest_commit_sha":null,"homepage":"https://docs.tsafe.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garronej.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-29T19:49:47.000Z","updated_at":"2025-04-27T06:27:12.000Z","dependencies_parsed_at":"2024-01-15T19:37:55.298Z","dependency_job_id":"687a10e1-5083-4bfc-9929-c0a75aa46c55","html_url":"https://github.com/garronej/tsafe","commit_stats":{"total_commits":346,"total_committers":8,"mean_commits":43.25,"dds":"0.18208092485549132","last_synced_commit":"6b8b7f477cf5cc2050d9fa03e2d153874fb8a70b"},"previous_names":[],"tags_count":83,"template":false,"template_full_name":"garronej/ts-ci","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Ftsafe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Ftsafe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Ftsafe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Ftsafe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garronej","download_url":"https://codeload.github.com/garronej/tsafe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149975,"owners_count":22022852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","hacktoberfest","node","npm","testing","type-safety","typescript","utilities"],"created_at":"2024-08-04T18:01:15.120Z","updated_at":"2025-05-14T13:09:21.520Z","avatar_url":"https://github.com/garronej.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","typescript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/6702424/117557564-572a0a80-b074-11eb-9d54-4ecfb5fb208f.png\"\u003e  \n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ci\u003eA collection of utilities to take your TypeScript development up a notch\u003c/i\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://github.com/garronej/tsafe/actions\"\u003e\n      \u003cimg src=\"https://github.com/garronej/tsafe/workflows/ci/badge.svg?branch=main\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/tsafe\"\u003e\n      \u003cimg src=\"https://img.shields.io/npm/dw/tsafe\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/tsafe\"\u003e\n      \u003cimg src=\"https://img.shields.io/npm/v/tsafe?logo=npm\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://deno.land/x/tsafe\"\u003e\n        \u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Flatest-version%2Fx%2Ftsafe%2Fmod.ts\"\u003e\n    \u003c/a\u003e    \n    \u003cbr/\u003e\n    \u003ca href=\"https://bundlephobia.com/package/tsafe\"\u003e\n      \u003cimg src=\"https://img.shields.io/bundlephobia/minzip/tsafe\"\u003e\n    \u003c/a\u003e\n    \u003ci\u003eYou can \u003ca href=\"https://docs.tsafe.dev/import\"\u003echerry-pick what you import\u003c/a\u003e\u003c/i\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://docs.tsafe.dev\"\u003eDocumentation\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003ci\u003eMake sure two types are identical\u003c/i\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003cimg width=\"550\" src=\"https://github.com/user-attachments/assets/e4ba75d9-1898-4668-8898-ea60c1e0fcc5\"\u003e  \n    \u003cbr\u003e\n    \u003cimg width=\"550\" src=\"https://github.com/user-attachments/assets/18bd0ca0-7ea3-4f61-8b10-f0407544b3b4\"\u003e\n    \u003cbr\u003e\n    \u003ci\u003e\u003ca href=\"https://stackblitz.com/edit/typescript-rfpzav?file=index.ts\u0026view=editor\"\u003ePlayground\u003c/a\u003e\u003c/i\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003ci\u003eA assertion function that typescript understands\u003c/i\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003cimg width=\"550\" src=\"https://github.com/user-attachments/assets/653ddf17-7caf-4c4b-889f-49a2b9bce18d\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003ci\u003eMake sure your zod schema exactly matches a given type:\u003c/i\u003e \n    \u003cbr\u003e\n    \u003cimg width=\"550\" src=\"https://github.com/user-attachments/assets/11a4a5b4-8c36-4b36-8b02-7df123901e0d\"\u003e\n    \u003cbr\u003e\n    \u003ci\u003e\u003ca href=\"https://stackblitz.com/edit/typescript-rfpzav?file=index.ts\u0026view=editor\"\u003ePlayground\u003c/a\u003e\u003c/i\u003e \n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003ci\u003eMake sure you never forget a case in a switch\u003c/i\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003cimg width=\"550\" src=\"https://github.com/user-attachments/assets/d794da18-3279-42af-9889-6abddc763c40\"\u003e  \n    \u003cbr\u003e\n    \u003ci\u003e\u003ca href=\"https://stackblitz.com/edit/typescript-ryj2ba?file=index.ts\u0026view=editor\"\u003ePlayground\u003c/a\u003e\u003c/i\u003e \n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003ci\u003eMake TypeScript believe whatever you say without having to write \u003ccode\u003econst obj2 = obj as Bar\u003c/code\u003e.\u003c/i\u003e \n    \u003cbr\u003e\n    \u003ci\u003eThe more powerfully is to be able to tell TypeScript that \u003ccode\u003eobj\u003c/code\u003e ist \u003cstrong\u003enot\u003c/strong\u003e of type \u003ccode\u003eBar\u003c/code\u003e:\u003c/i\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003cimg width=\"550\" src=\"https://user-images.githubusercontent.com/6702424/134994590-f01b8aee-a94a-4b4c-8f43-ee5ce8911443.gif\"\u003e\n\u003c/p\u003e\n\n## Motivations\n\nPowerful TypeScript features like [assertion functions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions) or [user-defined type guards](https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards) are only useful if paired with utility functions.\n\nTypeScript, however, only exports type helpers \\(e.g. `Record`, `ReturnType`, etc.\\).\n\nThis module provides _«the missing builtins»_ such as [the assert function](https://docs.tsafe.dev/assert) and other utilities that cannot be just type helpers.\n\n[**Documentation website**](https://docs.tsafe.dev)\n\n## Installation\n\n`tsafe` is both an [NPM](https://www.npmjs.com/package/tsafe) and a [Deno](https://deno.land/x/tsafe) module.\n(Achieved with [denoify](https://github.com/garronej/denoify))\n\n## Import in deno:\n\n```typescript\nimport { assert, type Equals, ... } from \"https://deno.land/x/tsafe/mod.ts\";\n```\n\n## Install elsewhere:\n\n```bash\n$ npm install --save tsafe\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarronej%2Ftsafe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarronej%2Ftsafe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarronej%2Ftsafe/lists"}