Discover the Power of Advanced TypeScript Types

The future of intelligent types in TypeScript is here — built to simplify your development with precision and clarity.

about us

WeWebuildbuildintelligentintelligentandandscalablescalableTypeScriptTypeScripttypestypesthatthatbringbringsafetysafetyandandclarityclaritytotoyouryourcodebase.codebase.OurOurmissionmissionisistotosimplifysimplifycomplexcomplextypetypescenariosscenariosandandempowerempowerdevelopersdeveloperswithwithrobustrobusttypetyperecognition.recognition.
Star Icon

We combine common and advanced utility types to deliver strong type safety without sacrificing development speed.

Get Started

our service

Explore a suite of advanced TypeScript utilities designed to handle deep logic, boost safety, and streamline development across a wide range of type patterns.

Deep

Dive into powerful TypeScript utilities crafted to simplify and enhance your type system workflows.

1import type { 
2    DeepOmit, 
3    DeepPick, 
4    DeepMerge, 
5    DeepMutable 
6} from "@halvaradop/ts-utility-types/deep"
7import * as validate from "@halvaradop/ts-utility-types/validate"
8
9type Test = DeepMergeAll<[Foo, {}, Bar], true>
10
11type User = {
12    name: string;
13    address: {
14        city: string;
15        zip: number;
16    };
17    age: number;
18}
19
20// Expected: { name: string; address: { zip: number }; age: number }
21type Omitted = DeepOmit<User, "address.city">
22
23// Expected: { name: string; address: { city: string } }
24type Picked = DeepPick<User, "name" | "address.city">
25
26// Expected: { name: string; address: { city: string; zip: number }; age: number }
27type Merged = DeepMerge<User, Partial<User>>
28
29// Expected: { name: string; address: { city: string; zip: number }; age: number }
30type Mapped = DeepMutable<User>

Object

Easily transform object types — extract, map, omit, and reshape structures with real-world utility.

1import type { 
2    GetOptional,
3    GetRequired,
4    Mutable,
5    ObjectEntries 
6} from "@halvaradop/ts-utility-types/objects"
7
8type Address = { city?: string; zip?: number }
9type User = { name?: string; address?: Address }
10
11// Expected: { name?: string; address?: Address }
12type Optionals = GetOptional<User, "name" | "address">
13
14// Expected: { name: string; address: Address }
15type Requireds = GetRequired<User, "name" | "address">
16
17// Expected: { name?: string; address?: Address }
18type Muted = Mutable<User>
19
20// Expected: ["name", string | undefined] | ["address", Address | undefined]
21type Entries = ObjectEntries<User>

Guards

Validate values with precision — confirm types like `never`, `any`, positive numbers, and more.

1import type { 
2    IsPositive,
3    IsNegative,
4    IsString,
5    IsObject,
6    IsFunction,
7} from "@halvaradop/ts-utility-types/type-guards"
8    
9// Expected: true
10type IsPositive = IsPositive<5>
11
12// Expected: true
13type IsNegative = IsNegative<-3>
14
15// Expected: true
16type IsString = IsString<"Hello">
17
18// Expected: true
19type IsObj = IsObject<{ a: 1 }>
20
21// Expected: true
22type IsFunc = IsFunction<() => void>
23
24// Expected: true
25type IsAnyType = IsAny<any>
26
27// Expected: true
28type IsNeverType = IsNever<never>

Array

Use tuple-based utilities to filter, extract, and transform array-like types with confidence and control.

1import type { 
2    Flatten,
3    ToUnion,
4    Filter,
5    Includes
6} from "@halvaradop/ts-utility-types/arrays"
7
8
9type Tuple = [string, number, boolean]
10
11// Expected: string
12type Flattened = Flatten<string[][]>
13
14// Expected: string | number | boolean
15type Union = ToUnion<Tuple>
16
17// Expected: ["str"]
18type Filtered = Filter<[1, 2, 3, "str"], string>
19
20// Expected: true
21type HasString = Includes<Tuple, string>

Utils

Access core utilities for primitives, nullish, falsy values, and more — made to simplify any TypeScript type logic.

1import type { 
2    Prettify, 
3    LiteralUnion, 
4    Discard, 
5    Nullish
6} from "@halvaradop/ts-utility-types/utils" 
7
8// Expected: { a: number; b: string }
9type Pretty = Prettify<{ a: number; b: string }>
10
11// Expected: "foo" | (string & {})
12type Literal = LiteralUnion<"foo", string>
13
14// Expected: string
15type Discarded = Discard<string | number, number>
16
17// Expecteda: null | undefined
18type NullishType = Nullish

Test

Ensure types match your expectations with type-safe testing patterns built for reliability.

1import type { 
2    Equals,
3    Expect,
4    Not,
5} from "@halvaradop/ts-utility-types/test"
6
7// Expected: true
8type IsEqual = Equals<"Hello", "Hello">
9
10// Expected: false
11type IsNotEqual = Not<Equals<"Hello", "World">>
12
13// Expected: true
14type IsEquals = Equals<1, 1>
15
16// Expected: true
17type IsNotEquals = Not<Equals<1, 2>>
18
19// Expected: true
20type IsExpect = Expect<"Hello" extends string ? true : false>

String

Manipulate string types effortlessly — transform, match, and format types just like native JavaScript string methods.

1import type { 
2    Join,
3    FindAll,
4    ParseUrlParams,
5    IndexOfString
6} from "@halvaradop/ts-utility-types/string-mappers"
7
8// Expected: "a-b-c"
9type Joined = Join<["a", "b", "c"], "-">
10
11// Expected: ["foo", "foo"]
12type Found = FindAll<"foo bar foo", "foo">
13
14// Expected: "id" | "section"
15type Params = ParseUrlParams<"/user/:id/profile/:section">
16
17// Expected: 2
18type Index = IndexOfString<"hello", "l">

Validate Types

Assert and validate that types meet strict constraints — from objects and arrays to booleans and primitives.

1import { 
2    isPrimitive,
3    isObject,
4    isArray,
5    isFalsy
6} from "@halvaradop/ts-utility-types/validate"
7
8// Expected: true
9const isPrim = isPrimitive(42)
10
11// Expected: true
12const isObj = isObject({ a: 1 })
13
14// Expected: true
15const isArr = isArray([1, 2, 3])
16
17// Expected: true
18const isFalsyVal = isFalsy(0)

Type Control

EmpowerEmpoweryouryourTypeScriptTypeScriptapplicationsapplicationswithwithprecise,precise,reusable,reusable,andandefficientefficientutilityutilitytypestypesdesigneddesignedtotosimplifysimplifyeveneventhethemostmostadvancedadvancedtypetypescenarios.scenarios.
Star Icon

typing complex data is hard — we make it simple

Get Started