Skip to content

uni-typesTypeScript Type Utilities

A comprehensive collection of type helpers for TypeScript development - 50+ utility types for safer, cleaner code

uni-types

Quick Example

typescript
import type { PickRequired, DeepPartial, IsArray } from 'uni-types'

// Make specific properties required
interface User {
  name?: string
  age?: number
  email: string
}

type RequiredUser = PickRequired<User, 'name' | 'age'>
// { name: string; age: number; email: string }

// Deep partial for nested objects
interface Config {
  database: {
    host: string
    port: number
  }
}

type PartialConfig = DeepPartial<Config>
// { database?: { host?: string; port?: number } }

// Type guards for conditional logic
type Check = IsArray<string[]> // true

Why uni-types?

Zero Dependencies

Lightweight with no external dependencies. Just pure TypeScript type magic.

TypeScript 5+

Built with the latest TypeScript features for the best type inference.

Released under the MIT License.