{"id":27874572,"url":"https://github.com/reececomo/primitive-types","last_synced_at":"2026-01-24T16:05:57.848Z","repository":{"id":288050879,"uuid":"966661224","full_name":"reececomo/primitive-types","owner":"reececomo","description":"Expressive low-level TypeScript types for integers, UUIDs, characters, etc.","archived":false,"fork":false,"pushed_at":"2025-04-20T08:47:11.000Z","size":331,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-23T17:17:20.785Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npmjs.com/primitive-types","language":null,"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/reececomo.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,"zenodo":null}},"created_at":"2025-04-15T09:05:11.000Z","updated_at":"2025-04-20T08:47:14.000Z","dependencies_parsed_at":"2025-04-15T10:32:34.531Z","dependency_job_id":"070c0b73-0be7-465e-ae43-219ccb07a462","html_url":"https://github.com/reececomo/primitive-types","commit_stats":null,"previous_names":["reececomo/primitive-types"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/reececomo/primitive-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reececomo%2Fprimitive-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reececomo%2Fprimitive-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reececomo%2Fprimitive-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reececomo%2Fprimitive-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reececomo","download_url":"https://codeload.github.com/reececomo/primitive-types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reececomo%2Fprimitive-types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28730888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-05-05T01:36:21.784Z","updated_at":"2026-01-24T16:05:57.830Z","avatar_url":"https://github.com/reececomo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔌 primitive-types \u0026nbsp;[![NPM version](https://img.shields.io/npm/v/primitive-types.svg)](https://www.npmjs.com/package/primitive-types) [![Minzipped](https://img.shields.io/badge/minzipped_size-0_KB!-blue)](https://bundlephobia.com/package/primitive-types) [![Downloads per month](https://img.shields.io/npm/dm/primitive-types.svg)](https://www.npmjs.com/package/primitive-types) [![License](https://badgen.net/npm/license/primitive-types)](https://github.com/reececomo/primitive-types/blob/main/LICENSE)\n\n⚡ Expressive low-level TypeScript type narrowing for integers, UUIDs, characters, etc.\n\n| | |\n| ------ | ------ |\n| 🏋️ No casting necessary | 🚀 Type-narrowing for built-ins |\n| 🍃 Zero dependencies | 🔮 0kB (fully erased at build time) |\n\n```ts\nlet age: int = 22;\nage = 10.25;\n  // ^ ❌ tsc(2322): Type '10.25' is not assignable to type 'int'.\n\nlet id: uuid = \"01964bbf-a8b9-7710-9cea-3d6691b15689\";\nid = \"abc-123\";\n  // ^ ❌ tsc(2322): Type '\"abc-123\"' is not assignable to type 'uuid\u003cv\u003e'.\n```\n\n\u003e [!TIP]\n\u003e Includes overloads and type-narrowing for built-ins like Math, Array, Date,\n\u003e Number, TypedArrays, and more.\n\n## 💿 Install\n\nAdd package:\n\n```sh\nnpm install primitive-types --save-dev\n```\n\nAdd types in `tsconfig.json`:\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\n      \"primitive-types\"\n    ]\n  }\n}\n```\n\n## Types\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003e\u003c/th\u003e\n      \u003cth\u003etype\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n      \u003cth\u003eMethod\u003c/th\u003e\n      \u003cth\u003eBase type\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003c!-- Unsigned integers --\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003euint8\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 8-bit unsigned integer (0 to 255).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003euint16\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 16-bit unsigned integer (0 to 65,535).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅*\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003euint32\u003c/b\u003e or \u003cb\u003euint\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 32-bit unsigned integer (0 to 4,294,967,295).\u003c/td\u003e\n      \u003ctd\u003e\n        \u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\n        \u003cbr/\u003e\n        \u003ci\u003e⚠️ *partial constants support beyond `uint16` range.\u003c/i\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003c!-- Integers --\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003eint8\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 8-bit signed integer (-128 to 127).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003eint16\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 16-bit signed integer (-32,768 to 32,767).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅*\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003eint32\u003c/b\u003e or \u003cb\u003eint\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 32-bit signed integer (-2,147,483,648 to 2,147,483,647).\u003c/td\u003e\n      \u003ctd\u003e\n        \u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\n        \u003cbr/\u003e\n        \u003ci\u003e⚠️ *partial constants support beyond `int16` range.\u003c/i\u003e\n      \u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003c!-- Bitfields --\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003ebit8\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny individual 8-bit bitmask value (e.g. 1, 2, 4, 8, …).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003ebit16\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny individual 16-bit bitmask value (e.g. 1, 2, …, 256, 512, …).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003ebit32\u003c/b\u003e or \u003cb\u003ebit\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny individual 32-bit bitmask value, excluding the int32 sign bit (e.g. 1, 2, …, 16777216, …).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003ebit32_unsafe\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny individual 32-bit bitmask value, including the int32 sign bit (e.g. 1, 2, …, -2147483648).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003ebitfield\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAlias for \u003ccode\u003e0b01111111111111111111111111111111\u003c/code\u003e (or \u003ccode\u003e2147483647\u003c/code\u003e).\u003c/td\u003e\n      \u003ctd\u003e\u003ci\u003eAlias\u003c/i\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e2147483647\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003ebitfield_unsafe\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAlias for \u003ccode\u003e0b11111111111111111111111111111111\u003c/code\u003e (or \u003ccode\u003e-1\u003c/code\u003e).\u003c/td\u003e\n      \u003ctd\u003e\u003ci\u003eAlias\u003c/i\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e-1\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003c!-- Floats --\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003efloat32\u003c/b\u003e or \u003cb\u003efloat\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 32-bit single-precision floating-point number.\u003c/td\u003e\n      \u003ctd\u003e\u003ci\u003eAlias\u003c/i\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003efloat64\u003c/b\u003e or \u003cb\u003edouble\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 64-bit single-precision floating-point number.\u003c/td\u003e\n      \u003ctd\u003e\u003ci\u003eAlias\u003c/i\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003c!-- Chars --\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003echar8\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny ASCII range character (e.g. \u003ccode\u003e'e'\u003c/code\u003e, \u003ccode\u003e'3'\u003c/code\u003e).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003echar16\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny UTF-16 range character (e.g. \u003ccode\u003e'ѐ'\u003c/code\u003e, \u003ccode\u003e'϶'\u003c/code\u003e).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003c!-- Strings --\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003estr8\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny string containing up to 1 byte.\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html\"\u003eTemplate literal type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003estr16\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny string containing up to 2 bytes.\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html\"\u003eTemplate literal type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003c!-- UUID --\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003euuid\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny UUID (e.g. \u003ccode\u003e\"0196382e-cc57-43ce-88c7-a3e427bc2713\"\u003c/code\u003e).\u003cbr/\u003eStrict UUID versions may be enforced using generics (e.g. \u003ccode\u003euuid\u003c4\u003e\u003c/code\u003e).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html\"\u003eTemplate literal type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003c!-- Hex --\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003ehex\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eA single hexadecimal character (e.g. \u003ccode\u003e'0'\u003c/code\u003e, \u003ccode\u003e'5'\u003c/code\u003e, \u003ccode\u003e'a'\u003c/code\u003e, \u003ccode\u003e'A'\u003c/code\u003e).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html#union-types\"\u003eUnion type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003eoctet\u003c/b\u003e or \u003cb\u003ebytestr\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eA 1-byte hexadecimal string representation (e.g. \u003ccode\u003e\"00\"\u003c/code\u003e, \u003ccode\u003e\"cb\"\u003c/code\u003e, \u003ccode\u003e\"F7\"\u003c/code\u003e).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html\"\u003eTemplate literal type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003estring\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003ebyte\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 1-byte integer or string (ASCII characters, code units in the UTF-8 character encoding).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html\"\u003eTemplate literal type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber | string\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003eubyte\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 1-byte unsigned integer or string (ASCII characters, code units in the UTF-8 character encoding).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html\"\u003eTemplate literal type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber | string\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003eword\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 2-byte integer or string (UCS-2 characters, code units in the UTF-16 character encoding).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html\"\u003eTemplate literal type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber | string\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e✅\u003c/td\u003e\n      \u003ctd\u003e\u003cb\u003euword\u003c/b\u003e\u003c/td\u003e\n      \u003ctd\u003eAny 2-byte unsigned integer or string (UCS-2 characters, code units in the UTF-16 character encoding).\u003c/td\u003e\n      \u003ctd\u003e\u003ca href=\"https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html\"\u003eTemplate literal type\u003c/a\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003enumber | string\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Arithmetic operations\n\nIn JavaScript all numbers are stored as 64-bit floating-point numbers or a 32-bit\nintegers, and then represented as the dynamic `number` type.\n\nThe benefit of these opaque types is arithemetic is completely interchangable:\n\n```ts\nlet a: uint8 = 10;\nlet b: int16 = -21_374;\nlet c: float64 = 4274.80;\n\nlet result = a * b / c;\n// -50\n```\n\nAnd in-place arithmetic will naturally coerce variables to the `number` type too:\n\n```ts\nfunction isOver18(value: int8) {\n    return value \u003e= 18;\n}\n\nlet age: int8 = 125;\n\nisOver18(age)\n\nage *= 2;\n  // 'age' is coerced to 'number'\n\nisOver18(age);\n  // ^ ❌ tsc(2345): Argument of type 'number' is not assignable to parameter of type 'int8'.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freececomo%2Fprimitive-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freececomo%2Fprimitive-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freececomo%2Fprimitive-types/lists"}