# uttype

> Tiny helper library with some useful functions / types.

Latest version **0.12.2** (published 2026-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install uttype
pnpm add uttype
yarn add uttype
bun add uttype
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.12.2 |
| Published | 2026-08-10 |
| First published | 2023-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | alexzhang1030 |
| Maintainers | alexzzz |
| Keywords | types, utility, tiny, helper |

## Links

- npm: https://www.npmjs.com/package/uttype
- Repository: https://github.com/alexzhang1030/uttype
- Homepage: https://github.com/alexzhang1030/uttype#readme
- Issues: https://github.com/alexzhang1030/uttype/issues
- npm.io page: https://npm.io/package/uttype

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.12.2 (latest) — 2026-08-10
- 0.12.1 — 2025-02-12
- 0.12.0 — 2024-12-31
- 0.11.0 — 2024-05-23
- 0.10.2 — 2024-05-22
- 0.10.1 — 2024-05-14
- 0.10.0 — 2024-05-14
- 0.9.0 — 2024-05-14
- 0.8.0 — 2024-03-08
- 0.7.5 — 2024-01-17
- 0.7.4 — 2023-11-02
- 0.7.3 — 2023-11-01
- 0.7.2 — 2023-10-31
- 0.7.1 — 2023-10-27
- 0.7.0 — 2023-10-13
- … 17 more at https://npm.io/package/uttype/versions

## README

# uttype

Tiny helper library with some useful functions / types.

## Types

assert

- `AssertTrue`
- `AssertFalse`

built-in extra

- `OmitByType`
- `PickByType`

- `PickReadonly`
- `OmitReadonly`

- `PartialByKey`
- `RequiredByKey`

- `DeepPartial`
- `DeepRequired`

- `ExtractOptional`
- `ExtractNonNullable`

- `OmitKeys`

union

- `RecordValues`

utilities

- `MaybePromise`
- `Prettify`
- `Recordable`
- `Nullable`

## Functions

- `entries`

```ts
function entries<T extends Recordable>(obj: T): [keyof T, T[keyof T]][]
```

- `entriesFind`

```ts
function entriesFind<T extends Recordable = Recordable>(obj: T, predicate: (item: [keyof T, T[keyof T]]) => boolean): [keyof T, T[keyof T]] | undefined
```

- `oneOf`

```ts
function oneOf<T extends unknown[] = unknown[]>(value: T[number], values: T): value is T[number]
```

- `debounce`

```ts
function debounce<F extends (...args: any[]) => any>(func: F, wait: number): F
```

- `throttle`

```ts
function throttle<F extends (...args: any[]) => any>(func: F, limit: number): F
```

- `loop`

```ts
function loop<T>(arr: T[], callback: (item: T, index: number) => void): void
```

- `rangeLoop`

```ts
function rangeLoop(start: number, end: number, callback: (index: number) => void): void
```

- `loopAsync`

```ts
function loopAsync<T>(arr: T[], callback: (item: T, index: number) => Promise<void>): void
```

- `mapObject`

```ts
function mapObject<T extends Recordable, V>(obj: T, cb: (value: T[keyof T], key: keyof T) => V): { [key in keyof T]: V; }
```

- `omitKeys`

```ts
function omitKeys<T extends object, K extends keyof T>(obj: T, keys: K[]): Prettify<OmitKeys<T, K>>
```

- `removeNullishFields`

```ts
function removeNullishFields<T extends object>(obj: T): ExtractNonNullable<T>
```

- `must`

```ts
function must<T>(value: T | null | undefined): T
```

## License

MIT

---
_Source: https://npm.io/package/uttype · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
