@pegzkit/utils
v0.0.4
Published
pegzkit 运行时工具函数包(零依赖,仅 ESM,完整 Tree-shaking)
Downloads
222
Maintainers
Readme
@pegzkit/utils
中文
@pegzkit/utils 是 pegzkit 的运行时工具函数子包。零依赖,仅 ESM,支持完整 Tree-shaking。
安装
pnpm add @pegzkit/utils使用方式
import { debounce, group, clamp } from "@pegzkit/utils";函数分类
- array — 排序、分组、筛选、转换、集合运算等 34 个函数
- async — 并发控制、重试、延迟 Promise 等 5 个函数
- function — 防抖、节流、缓存、组合、柯里化等 10 个函数
- number — 范围限制、四舍五入、安全除法等 7 个函数
- object — 深度操作、键值映射、类型安全合并等 23 个函数
- random — 随机数、随机字符串、随机采样 3 个函数
- string — 大小写转换、填充、截断、模板替换等 16 个函数
- typed — 完整的
is*类型守卫函数集合及narrow断言
English
@pegzkit/utils is the runtime utility sub-package of pegzkit. Zero dependencies, ESM-only, fully tree-shakeable.
Installation
pnpm add @pegzkit/utilsUsage
import { debounce, group, clamp } from "@pegzkit/utils";Categories
- array — Sorting, grouping, filtering, set operations and more (34 functions)
- async — Concurrency control, retry, deferred Promise (5 functions)
- function — Debounce, throttle, memoize, compose, currying and more (10 functions)
- number — Clamping, rounding, safe division and more (7 functions)
- object — Deep operations, key/value mapping, type-safe merge and more (23 functions)
- random — Random number, random string, random sampling (3 functions)
- string — Case conversion, padding, truncation, template substitution and more (16 functions)
- typed — Complete
is*type guard collection andnarrowassertion
