{"id":16113117,"url":"https://github.com/cuppachino/type-space","last_synced_at":"2025-03-16T08:32:41.329Z","repository":{"id":64126192,"uuid":"570459695","full_name":"cuppachino/type-space","owner":"cuppachino","description":"Typescript type utilities for typing better TypeScript types.","archived":false,"fork":false,"pushed_at":"2025-03-03T02:11:07.000Z","size":304,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T10:01:57.538Z","etag":null,"topics":["generic-types","type-utilities","types","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@cuppachino/type-space","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuppachino.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-11-25T08:43:55.000Z","updated_at":"2024-02-11T04:15:45.000Z","dependencies_parsed_at":"2023-01-14T23:30:19.228Z","dependency_job_id":"c78e0624-956e-4c1e-8172-4ad97e508393","html_url":"https://github.com/cuppachino/type-space","commit_stats":{"total_commits":220,"total_committers":3,"mean_commits":73.33333333333333,"dds":0.09545454545454546,"last_synced_commit":"4ecf008018cbd7391bf83488178df6b1e6246663"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuppachino%2Ftype-space","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuppachino%2Ftype-space/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuppachino%2Ftype-space/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuppachino%2Ftype-space/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuppachino","download_url":"https://codeload.github.com/cuppachino/type-space/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243807404,"owners_count":20350992,"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":["generic-types","type-utilities","types","typescript"],"created_at":"2024-10-09T20:10:20.853Z","updated_at":"2025-03-16T08:32:40.927Z","avatar_url":"https://github.com/cuppachino.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eType Space\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cp\u003e\n  Welcome to Type Space, a suite of utility types for enhancing your TypeScript code. With\n  \u003ccode\u003e@cuppachino/type-space\u003c/code\u003e, you can perform a wide range of type operations,\n  including numeric calculations, string manipulation, tuple operations, and more.\n  \u003c/p\u003e\n  \u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/Cuppachino/type-space/issues\"\u003eReport Problem\u003c/a\u003e\n    🌘🧑‍🚀\n    \u003ca href=\"https://github.com/Cuppachino/type-space/pulls\"\u003eContribute\u003c/a\u003e\n  \u003c/div\u003e\n\u003c/p\u003e\n\n## 📦 Installation\n\nUse your favorite package manager to install `@cuppachino/type-space` as a developer dependency.\n\n[@cuppachino/type-space](https://www.npmjs.com/package/@cuppachino/type-space)\n\n```ps\npnpm add -D @cuppachino/type-space\n```\n\n```ps\nnpm install --save-dev @cuppachino/type-space\n```\n\n# 🔎 Quick Reference\n\nThe source code is fully tsdoc'd, so you can use your IDE's intellisense to reference examples and descriptions at any time. Click any `type` for more documentation.\n\n## 🍎 Base Types\n\n- [`NumberLiteral`](src/number-literal.ts): A stringified number literal.\n- [`Stringifiable`](src/stringifiable.ts): An alias for `string | number | bigint | boolean | null | undefined`.\n- [`UnknownArray`](src/unknown-array.ts): An alias for `unknown[] | readonly unknown[]`,\n  safer than `any`.\n- [`UnknownRecord`](src/unknown-record.ts): An alias for `Record\u003cPropertyKey, unknown\u003e`,\n  safer than `any` or `{}`.\n\n## 🧮 Arithmetic Types\n\n- [`Absolute`](src/math/absolute.ts): Coerces a number literal to a positive `number` of the same magnitude.\n- [`Add`](src/math/add.ts): Return the sum of two number literals.\n- [`Subtract`](src/math/subtract.ts): Return the difference between two number literals.\n\n## 🔢 Numeric Types\n\n- [`IntoNumber`](src/into-number.ts): Coerce a `NumberLike` type to a `number`\n- [`IntoNumberLiteral`](src/into-number-literal.ts): Coerce a `NumberLike` type to a `NumberLiteral`\n- [`IsInteger`](src/math/is-integer.ts): A boolean type that is true if a number literal is an integer.\n- [`IsPositive`](src/math/is-positive.ts): A boolean type that is true if a number literal is positive.\n- [`IsNegative`](src/math/is-negative.ts): A boolean type that is true if a number literal is negative.\n- [`IsWhole`](src/math/is-whole.ts): A boolean type that is true if a number literal is a whole number.\n- [`NumberLike`](src/number-like.ts): Coerce either a `number` or a `NumberLiteral` into a union between the two.\n- [`ParseNumberLiteral`](src/parse-number-literal.ts): Coerce a `NumberLiteral` type to a `number`\n\n## 💭 String Types\n\n- [`Chars`](src/chars.ts): Splits a string literal into a tuple of characters. Reads more clearly than `Split` in some cases.\n- [`ReverseString`](src/strings/reverse-string.ts): Reverse a string literal.\n- [`Split`](src/split.ts): Splits a string literal into a tuple of characters, separated by the given delimiter.\n- [`SplitAt`](src/strings/split-at.ts): Split a string literal into a tuple of two strings, separated by the given index, non-inclusive.\n- [`Stringify`](src/stringify.ts): Converts a type to a string literal type, if possible.\n- [`StringIncludes`](src/string-includes.ts): A boolean type that is true if a string literal includes a given substring (⊆).\n- [`StringIncludesProper`](src/string-includes-proper.ts): A boolean type that is true if a string literal includes a given substring, and the substring is not the entire string (⊂).\n\n## 📜 Tuple Types\n\n- [`CreateTuple`](src/create-tuple.ts): Generate a fixed-length tuple.\n- [`Flat`](src/flat.ts): Recursively flatten a tuple up to a given depth.\n- [`IndexOf`](src/index-of.ts): Return a union of a tuple's indices.\n- [`Indices`](src/indices.ts): Generate a tuple of a tuple's indices.\n- [`Join`](src/join.ts): Joins a tuple of strings into a single string, separated by a delimiter.\n- [`Length`](src/length.ts): Extract the length property from an array or\n  tuple.\n- [`MergeAll`](src/merge-all.ts): Merge all type members of a tuple into a\n  single type.\n- [`PartitionKeys`](src/partition-keys.ts): Extract a union of keys for each member in a tuple into a new tuple; order is preserved.\n- [`PartitionValues`](src/partition-values.ts): Create a tuple of value(s) for the given key(s) in each member of a tuple; order is preserved.\n- [`PartitionPick`](src/partition-pick.ts): Maps picked properties from each member of a tuple into a new tuple; order is preserved.\n- [`Reverse`](src/tuples/reverse.ts): Reverse the order of elements in a tuple type.\n\n### A la Array.prototype\n\n\u003e #### sig\n\u003e\n\u003e ```ts\n\u003e Action :: \u003cTuple\u003e -\u003e NewTuple\n\u003e ```\n\n- [`Pop`](src/tuples/pop.ts): Remove the last element from a tuple. Does not return the removed element.\n- [`PopBy`](src/tuples/pop-by.ts): Remove the last `N` elements from a tuple.\n- [`Push`](src/tuples/push.ts): Adds one element type to the end of a tuple. Does not return the new length of the tuple.\n- [`Shift`](src/tuples/shift.ts): Remove the first element from a tuple type. Does not return the removed element.\n- [`ShiftBy`](src/tuples/shift-by.ts): Remove the first `N` elements from a tuple.\n- [`Unshift`](src/tuples/unshift.ts): Adds one element type to the beginning of a tuple. Does not return the new length of the tuple.\n\n## 🧰 Utility Types\n\n- [`Assert`](src/assert.ts): Assert that a type is assignable to another type; shorthand for `T extends U ? T : never`.\n- [`Combine`](src/combine.ts): Simplify a type by mapping over its properties.\n- [`KeyOf`](src/key-of.ts): Extract all keys from every member of a union type, unlike `keyof` which only preserves shared members' keys.\n- [`Mutable`](src/mutable.ts): Recursively removes the `readonly` modifier from all properties of a type.\n- [`PartialSome`](src/partial-some.ts): Return a new type that allows the specified keys to be undefined.\n- [`PickAll`](src/pick-all.ts): Extract properties from _all_ members in a union, missing properties default to `| undefined`.\n- [`RequireSome`](src/require-some.ts): Return a new type requiring the selected keys.\n- [`Simplify`](src/simplify.ts): Simplify a type by mapping over its inferred properties - use when `Combine` cannot infer a deep type.\n- [`Subset`](src/subset.ts): TypeScript equivalent of `⊆`.\n- [`UnionLiteral`](src/union-literal.ts): Create a union from a literal and primitive type without losing the literal type.\n- [`UnionToIntersection`](src/union-to-intersection.ts): Create an intersection from all members of a union type.\n- [`UnionToTuple`](src/union-to-tuple.ts): Convert a union to a tuple type. The order is not guaranteed.\n- [`Zip`](src/zip.ts): From a tuple of keys and a tuple of values, create a new record.\n\n### Extract\n\n- [`ExtractRequired`](src/extract/extract-required.ts): Extract all non-optional properties from a type; ℹ️[exactOptionalPropertyTypes](https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes).\n- [`ExtractOptional`](src/extract/extract-optional.ts): Extract all optional properties from a type; ℹ️[exactOptionalPropertyTypes](https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes)\n- [`ExtractFunctions`](src/extract/extract-functions.ts): Create a new type of\n  all property functions and methods in a type.\n- [`ExtractSetMembers`](src/extract/extract-set-members.ts): Create a union\n  type of members in a `Set`.\n\n### Extends\n\n\u003e #### | sig\n\u003e\n\u003e ```ts\n\u003e Extends :: \u003cT, R = T\u003e -\u003e boolean\n\u003e ```\n\u003e\n\u003e - `T` is the type to check.\n\u003e - `R` is the type returned when `T` extends the name of the generic.\n\n- [`ExtendsFunction`](src/extends/extends-function.ts): Return a type if the\n  given type extends a function or method.\n\n---\n\nI hope you have fun with these utilities. Thank you for using `type-space`!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuppachino%2Ftype-space","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuppachino%2Ftype-space","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuppachino%2Ftype-space/lists"}