GuobaGuoba Utils

@guoba-ai/utils

@guoba-ai/utils

npm License: MIT

Pure TypeScript utility functions — ESM-only, zero dependencies, fully typed.

Installation

pnpm add @guoba-ai/utils
# or: npm i @guoba-ai/utils / yarn add @guoba-ai/utils

Usage

import { capitalize, chunk, deepMerge, toArray } from '@guoba-ai/utils'

toArray(1) // [1]
capitalize('hello') // 'Hello'
chunk([1, 2, 3, 4, 5], 2) // [[1, 2], [3, 4], [5]]
deepMerge({ a: { x: 1 } }, { a: { y: 2 } }) // { a: { x: 1, y: 2 } }

Modules

  • arraychunk, flattenDeep, group, toArray, uniq, zip, …
  • guardisString, isObject, isEmpty, notNullish, …
  • objectdeepMerge, pick, omit, get, set, mapValues, …
  • stringcamel, snake, capitalize, template, …
  • typesArrayable, Nullable, DeepPartial, …

📖 Full API referenceguoba-ai.vercel.app/docs/utils

License

MIT

On this page