{"id":20327061,"url":"https://github.com/webneat/just-types","last_synced_at":"2025-08-02T08:40:29.779Z","repository":{"id":43049127,"uuid":"430875478","full_name":"webNeat/just-types","owner":"webNeat","description":"A collection of handy Typescript types.","archived":false,"fork":false,"pushed_at":"2024-04-30T21:57:54.000Z","size":174,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T20:07:08.228Z","etag":null,"topics":["custom-types","types","typescript","utility-library","utility-types"],"latest_commit_sha":null,"homepage":"","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/webNeat.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-11-22T21:51:18.000Z","updated_at":"2024-04-30T21:57:33.000Z","dependencies_parsed_at":"2024-06-20T21:57:11.371Z","dependency_job_id":"62e04f4d-efe2-4a00-bab2-95007baff9ca","html_url":"https://github.com/webNeat/just-types","commit_stats":{"total_commits":36,"total_committers":2,"mean_commits":18.0,"dds":0.2222222222222222,"last_synced_commit":"adf9a1409c668f2170fee71a867e907873d88001"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webNeat%2Fjust-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webNeat%2Fjust-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webNeat%2Fjust-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webNeat%2Fjust-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webNeat","download_url":"https://codeload.github.com/webNeat/just-types/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248473129,"owners_count":21109628,"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":["custom-types","types","typescript","utility-library","utility-types"],"created_at":"2024-11-14T19:46:25.559Z","updated_at":"2025-04-11T20:07:15.864Z","avatar_url":"https://github.com/webNeat.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Just types\n\nA collection of handy Typescript types.\n\n[![Version](https://img.shields.io/npm/v/just-types?style=flat-square)](https://www.npmjs.com/package/just-types)\n[![Tests Status](https://img.shields.io/github/actions/workflow/status/webneat/just-types/tests.yml?branch=main\u0026style=flat-square)](https://github.com/webneat/just-types/actions?query=workflow:\"Tests\")\n[![MIT](https://img.shields.io/npm/l/just-types?style=flat-square)](LICENSE)\n\n# Contents\n\n- [Installation](#installation)\n- [Types Reference](#types-reference)\n- [Testing Types](#testing-your-types-with-just-types)\n- [Contributing](#contributing)\n- [Changelog](#changelog)\n\n# Installation\n\nInstall using `npm`\n\n```\nnpm install -D just-types\n```\n\nOr using `yarn`\n\n```\nyarn add --dev just-types\n```\n\n# Types Reference\n\n- [common](https://github.com/webNeat/just-types/blob/main/docs/common.md)\n  - [Mutable](https://github.com/webNeat/just-types/blob/main/docs/common.md#mutable)\n  - [Normalize](https://github.com/webNeat/just-types/blob/main/docs/common.md#normalize)\n\n- [number](https://github.com/webNeat/just-types/blob/main/docs/number.md)\n  - [Decrement](https://github.com/webNeat/just-types/blob/main/docs/number.md#decrement)\n  - [Increment](https://github.com/webNeat/just-types/blob/main/docs/number.md#increment)\n  - [Range](https://github.com/webNeat/just-types/blob/main/docs/number.md#range)\n\n- [object](https://github.com/webNeat/just-types/blob/main/docs/object.md)\n  - [ExcludeKeys](https://github.com/webNeat/just-types/blob/main/docs/object.md#excludekeys)\n  - [ExcludeValues](https://github.com/webNeat/just-types/blob/main/docs/object.md#excludevalues)\n  - [ExtractKeys](https://github.com/webNeat/just-types/blob/main/docs/object.md#extractkeys)\n  - [ExtractValues](https://github.com/webNeat/just-types/blob/main/docs/object.md#extractvalues)\n  - [FieldPath](https://github.com/webNeat/just-types/blob/main/docs/object.md#fieldpath)\n  - [GetField](https://github.com/webNeat/just-types/blob/main/docs/object.md#getfield)\n  - [Merge](https://github.com/webNeat/just-types/blob/main/docs/object.md#merge)\n  - [PartialKeys](https://github.com/webNeat/just-types/blob/main/docs/object.md#partialkeys)\n  - [PartialValues](https://github.com/webNeat/just-types/blob/main/docs/object.md#partialvalues)\n  - [RequiredKeys](https://github.com/webNeat/just-types/blob/main/docs/object.md#requiredkeys)\n  - [RequiredValues](https://github.com/webNeat/just-types/blob/main/docs/object.md#requiredvalues)\n\n- [string](https://github.com/webNeat/just-types/blob/main/docs/string.md)\n  - [Split](https://github.com/webNeat/just-types/blob/main/docs/string.md#split)\n  - [Tail](https://github.com/webNeat/just-types/blob/main/docs/string.md#tail)\n\n- [tuple](https://github.com/webNeat/just-types/blob/main/docs/tuple.md)\n  - [Exclude](https://github.com/webNeat/just-types/blob/main/docs/tuple.md#exclude)\n  - [Extract](https://github.com/webNeat/just-types/blob/main/docs/tuple.md#extract)\n  - [Flatten](https://github.com/webNeat/just-types/blob/main/docs/tuple.md#flatten)\n  - [Insert](https://github.com/webNeat/just-types/blob/main/docs/tuple.md#insert)\n  - [Join](https://github.com/webNeat/just-types/blob/main/docs/tuple.md#join)\n  - [Permutation](https://github.com/webNeat/just-types/blob/main/docs/tuple.md#permutation)\n  - [Slice](https://github.com/webNeat/just-types/blob/main/docs/tuple.md#slice)\n  - [SubArray](https://github.com/webNeat/just-types/blob/main/docs/tuple.md#subarray)\n  - [SubSequence](https://github.com/webNeat/just-types/blob/main/docs/tuple.md#subsequence)\n  - [Tail](https://github.com/webNeat/just-types/blob/main/docs/tuple.md#tail)\n\n# Testing Your Types with just-types\n\n`just-types` allows you to test your own types using `Is`, `Equal` and other testing utils. These utils are used internally to test `just-types` types. For Example, here is the source file of the `Split` type:\n\n```ts\nimport {Equal, Is} from '../test'\n\nexport type Split\u003c\n  Text extends string,\n  Separator extends string\n\u003e = Text extends `${infer First}${Separator}${infer Rest}` ? [First, ...Split\u003cRest, Separator\u003e] : [Text]\n\ntype Tests = [\n  Is\u003cEqual\u003cSplit\u003c'foo', '-'\u003e, ['foo']\u003e\u003e,\n  Is\u003cEqual\u003cSplit\u003c'foo-bar-baz', '-'\u003e, ['foo', 'bar', 'baz']\u003e\u003e,\n  Is\u003cEqual\u003cSplit\u003c'foo--', '-'\u003e, ['foo', '', '']\u003e\u003e\n]\n```\n\nAs you see, we define the type, then we declare a `Tests` type (can be named anything) and assign a list of assertions types to it. These types are evaluated in realtime by Typescript, so we have instant feedback if something is wrong.\n\n## List of assertions\n\n```ts\nimport {Is, Equal, Not, Extends, StartsWith} from 'just-types/test'\n\nIs\u003cEqual\u003cA, B\u003e\u003e // asserts that types `A` and `B` are the same.\nIs\u003cNot\u003cEqual\u003cA, B\u003e\u003e\u003e // asserts that types `A` and `B` are different.\nIs\u003cStartsWith\u003cA, B\u003e\u003e // where `A` and `B` extend `string`: asserts that all elements of `A` start with with an element of `B`.\nIs\u003cExtends\u003cA, B\u003e\u003e // asserts that type `A` extends type `B`\n```\n\n# Contributing\n\nYou can contribute to this library in many ways, including:\n\n- **Reporting bugs**: Simply open an issue and describe the bug. Please include a code snippet to reproduce the bug, it really helps to solve the problem quickly.\n\n- **Suggesting new types**: If you have a common use case that you think worth having its own custom type, open an issue and we will discuss it. Do you already have an implementation for it? great, make a pull request and I will review it.\n\nThose are just examples, any issue or pull request is welcome :)\n\n# Changelog\n\n**2.0.0-alpha.2 (April 13th 2023)**\n\n- Add types:\n  - In `common` module: `Normalize`\n  - In `object` module: `PartialKeys`, `PartialValues`, `RequiredKeys` and `RequiredValues`\n\n**2.0.0-alpha.1 (April 11th 2023)**\n\n- Full rewrite of the library.\n- Rewrite some types to use less recursion and be more efficient.\n- Separate types into modules: `tuple`, `string`, `object`, ...\n- Generate docs directly from source code.\n- Drop Parcel and use `tsc` instead.\n- Rename some types for better naming convention `FilterOut =\u003e tuple.Exclude`, `FilterProps =\u003e object.ExtractValues`, `FilterPropsOut =\u003e object.ExcludeValues`, ...\n\n**1.6.0 (Sptember 24th 2022)**\n\n- Add `FilterOut`, `FilterProps`, `FilterOutProps` and `Merge`.\n- Add assertion type `Extends`.\n- Improve `Tail` to support `string` types.\n- Fix `Filter` to correctly handle union types.\n\n**1.5.0 (September 2nd 2022)**\n\n- Export testing types: `Is`, `Not`, `Equal`, `StartsWith` \n\n**1.4.2 (March 21th 2022)**\n\n- Add `repository` and `homepage` to `package.json` (forgot to add them on `1.4.1` :P).\n\n**1.4.1 (March 21th 2022)**\n\n- Fix issue [Tail type gives wrong results in specific recursive scenarios](https://github.com/webNeat/just-types/issues/1)\n\n**1.4.0 (January 29th 2022)**\n\n- Add [Split](#split)\n\n**1.3.1 (January 9th 2022)**\n\n- Export missing types\n\n**1.3.0 (January 9th 2022)**\n\n- Add [Filter](#filter)\n- Add [FiledPath](#fieldpath)\n- Add [GetField](#getfield)\n\n**1.2.0 (January 2nd 2022)**\n\n- Add [Increment](#increment)\n- Add [Decrement](#decrement)\n- Add depth parameter to [Flatten](#flatten)\n\n**1.1.0 (December 01, 2021)**\n\n- Add [MutableTuple](#mutabletuple)\n\n**1.0.0 (November 22, 2021)**\n\nThe first release containing the 7 types:\n  - [Flatten](#flatten)\n  - [InsertAt](#insertat)\n  - [Join](#join)\n  - [Permutation](#permutation)\n  - [Range](#range)\n  - [SubArray](#subarray)\n  - [Tail](#tail)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebneat%2Fjust-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebneat%2Fjust-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebneat%2Fjust-types/lists"}