987ff560f5
Import initial monorepo structure for Nebula Core: add packages (@nebula/core, core-glyphs, core-input, core-navigation, core-theme, core-ui, core-utils) with source, dist, tests and assets. Expand README with overview, quick start and API snippets, and add package-level documentation files. Add jsconfig.json for path mapping, package.json and lockfiles to bootstrap the repo. This commit sets up the project layout, docs, and local package links for further development.
23 lines
811 B
Markdown
23 lines
811 B
Markdown
# @nebula/core-utils
|
|
|
|
Small, dependency-free utilities shared across Nebula Core packages. No DOM or platform assumptions.
|
|
|
|
## What it does
|
|
|
|
- Provides tiny, reusable math helpers.
|
|
- Exposes a minimal event emitter for small, decoupled messaging.
|
|
- Stays platform-agnostic so it works in browser, Electron, or Node.
|
|
|
|
## Included utilities
|
|
|
|
- `clamp(value, min, max)` — Clamp a number between bounds.
|
|
- `lerp(from, to, t)` — Linear interpolation between two numbers.
|
|
- `roundTo(value, decimals)` — Round to a fixed decimal precision.
|
|
- `createEmitter()` — Lightweight emitter with `on`, `emit`, and `clear`.
|
|
|
|
## Typical use cases
|
|
|
|
- Input or navigation modules needing small math helpers.
|
|
- App-level messaging without pulling in larger event libraries.
|
|
- Shared helpers across packages in the monorepo.
|