@fluixi/utils
v1.0.0-alpha.57
Published
Zero-dependency, strongly-typed utilities for everyday TypeScript.
Readme
@fluixi/utils
Zero-dependency, strongly-typed utilities for everyday TypeScript.
✨ Overview
@fluixi/utils is the foundational layer of Fluixi Core: a collection of small, tree-shakeable, fully-typed helpers with no runtime dependencies. Every module is exported under its own subpath so you only ship what you import.
🧩 Modules
| Import | What it provides |
| --- | --- |
| @fluixi/utils/primitive | String, number, boolean, and date helpers. |
| @fluixi/utils/object | Deep get/set, clone, diff, merge, immutable path updates. |
| @fluixi/utils/array | Array transforms, grouping, and set operations. |
| @fluixi/utils/maths | Vectors, interpolation, clamping, constants, and guards. |
| @fluixi/utils/color | Color parsing and conversion. |
| @fluixi/utils/dom | Lightweight DOM helpers. |
| @fluixi/utils/functions | Composition, debounce/throttle, memoization. |
| @fluixi/utils/compare | Deep equality and comparison utilities. |
📦 Installation
pnpm add @fluixi/utils🚀 Usage
import { set, get } from '@fluixi/utils/object';
const state = { users: [{ name: 'Alice' }] };
// Immutable update — returns a new object, leaves `state` untouched
const next = set(state, 'users', 0, 'name', 'Alice Updated');
get(next, 'users[0].name'); // → 'Alice Updated'
get(state, 'users[0].name'); // → 'Alice' (original is unchanged)import { lerp, clamp } from '@fluixi/utils/maths/fn';
lerp(0, 100, 0.25); // → 25
clamp(150, 0, 100); // → 100📋 Requirements
- TypeScript ≥ 5.8 (ships its own
.d.tsdeclarations) - Node.js ≥ 20 / any modern bundler (ESM + CJS builds included)
