Type-safe utility types for TypeScript. Deep types, string manipulation, function helpers, and React integration.
npm install ts-deep-typesA comprehensive collection of type-safe utility types for TypeScript.


![Test Status]()
---
Provides missing TypeScript utility types that should exist in the standard library but don't:
- Deep types — Recursive transformations on nested objects
- String types — Case conversion (camelCase, snake_case, kebab-case)
- Function types — Parameter/return type extraction
- Type guards — Runtime type checking
- Object utilities — Key/value manipulation
---
``bashnpm
npm install ts-deep-types
---
Usage
`typescript
import { DeepPartial, CamelCase, Parameters, IsAny } from 'ts-deep-types'// Deep types
type PartialConfig = DeepPartial<{
database: { host: string; port: number }
}>
// { database?: { host?: string; port?: number } | undefined }
// String types
type CamelStr = CamelCase<'hello_world'>
// 'helloWorld'
// Function types
type FnParams = Parameters<(a: string, b: number) => void>
// [string, number]
// Type guards
type TestAny = IsAny // true
type TestNever = IsAny // false
`---
Features
$3
- DeepPartial - Recursive partial types
- DeepRequired - Recursive required types
- DeepReadonly - Deep readonly for nested objects
- PickDeep - Deep pick with nested paths
- OmitDeep - Deep omit with nested paths
- Merge - Merge two object types
- UnionToIntersection - Convert union to intersection$3
- CamelCase - Convert to camelCase
- KebabCase - Convert to kebab-case
- SnakeCase - Convert to snake_case
- PascalCase - Convert to PascalCase
- Trim - Trim strings in templates$3
- Parameters - Function parameters
- ReturnType - Return type
- ThisParameterType - this parameter type
- AsyncReturnType - Async version of ReturnType$3
- IsAny - Check if type is any
- IsNever - Check if type is never
- IsUnknown - Check if type is unknown
- IsUnion - Check if type is a union
- IsTuple - Check if type is a tuple
- IsArray - Check if type is an array
- IsPlainObject - Check if type is a plain object
- IsFunction - Check if type is a function
- IsConstructor - Check if type is a constructor$3
- KeysOfType - Keys matching a type
- ValueOf - Values of a union type
- EntryOf - Key-value entries
- RequiredKeys - Keys that are required
- OptionalKeys - Keys that are optional
- ReadonlyKeys - Keys that are readonly
- WritableKeys - Keys that are mutable---
Why ts-deep-types?
TypeScript's standard utility types (
Partial, Pick, Omit) only work at one level. When you need recursive transformations, you're on your own.ts-deep-types provides the missing utilities:
`typescript
// Standard library (one level)
type A = Partial<{ a: { b: { c: string } } }>
// { a?: { b?: { c?: string } } | undefined } | undefined// ts-deep-types (recursive)
type B = DeepPartial<{ a: { b: { c: string } } }>
// { a?: { b?: { c?: string } } | undefined } | undefined }
// All levels are partial!
`---
Development
`bash
Install dependencies
pnpm installRun tests
pnpm testBuild for production
pnpm build
``---
MIT © Peter W.
---
Issues and PRs welcome!