{"id":13725385,"url":"https://github.com/ksxnodemodules/static-type-assert","last_synced_at":"2025-09-11T23:08:41.613Z","repository":{"id":32962917,"uuid":"147960046","full_name":"ksxnodemodules/static-type-assert","owner":"ksxnodemodules","description":"Asserting type with help of TypeScript compiler","archived":false,"fork":false,"pushed_at":"2024-05-13T01:03:03.000Z","size":120,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-29T04:35:05.500Z","etag":null,"topics":["assertions","types","typescipt"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/static-type-assert","language":"JavaScript","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/ksxnodemodules.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":null,"patreon":"khai96_","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-09-08T18:37:41.000Z","updated_at":"2024-05-13T01:02:59.000Z","dependencies_parsed_at":"2023-01-14T22:51:04.718Z","dependency_job_id":"74f2858d-0266-4cfa-9a60-cda88bad4d4a","html_url":"https://github.com/ksxnodemodules/static-type-assert","commit_stats":{"total_commits":106,"total_committers":3,"mean_commits":"35.333333333333336","dds":"0.41509433962264153","last_synced_commit":"88ca6f9c81ae6b6a2c9fc7dab827d14e9454f097"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksxnodemodules%2Fstatic-type-assert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksxnodemodules%2Fstatic-type-assert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksxnodemodules%2Fstatic-type-assert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksxnodemodules%2Fstatic-type-assert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksxnodemodules","download_url":"https://codeload.github.com/ksxnodemodules/static-type-assert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227707762,"owners_count":17807513,"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":["assertions","types","typescipt"],"created_at":"2024-08-03T01:02:21.277Z","updated_at":"2024-12-02T10:12:52.920Z","avatar_url":"https://github.com/ksxnodemodules.png","language":"JavaScript","funding_links":["https://patreon.com/khai96_"],"categories":["JavaScript"],"sub_categories":[],"readme":"# Static Type Assert\n\nAsserting type with help of TypeScript compiler\n\n## Requirements\n\n* Node.js ≥ 8.9.0\n* TypeScript ≥ 3.0.0\n\n## Usage\n\n### 1. Create TypeScript files\n\nExample: `pass.ts`\n\n```typescript\nimport assert from 'static-type-assert'\n\n// Comma-separated parameters\nassert\u003cstring\u003e('hello', 'world')\nassert\u003cnumber\u003e(123, 456, 789)\n\n// Curry function calls\nassert\u003c'abc' | 'def' | 123 | 456\u003e('abc')(123)('def')(456)\n\n// Combine\nassert\u003cstring | number\u003e('a', 0)('c', 'd')(1, 2)\n```\n\nExample: `fail.ts`\n\n```typescript\nimport assert from 'static-type-assert'\nassert\u003cnumber\u003e('abc') // Expected Error: Argument of type '\"abc\"' is not assignable to type 'number'\n```\n\n### 2. Use TypeScript compiler to check types\n\n```sh\ntsc --noEmit\n```\n\nExample: `pass.ts`\n\n```sh\ntsc --noEmit pass.ts # Expects to pass (no errors)\n```\n\nExample: `fail.ts`\n\n```sh\ntsc --noEmit fail.ts # Expects errors\n```\n\n## License\n\n[MIT](https://git.io/fA2Ff) © [Hoàng Văn Khải](https://ksxgithub.github.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksxnodemodules%2Fstatic-type-assert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksxnodemodules%2Fstatic-type-assert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksxnodemodules%2Fstatic-type-assert/lists"}