@ucdjs/utils
v0.2.1
Published
[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href]
Downloads
66
Readme
@ucdjs/utils
Curated stable utilities for UCD.js consumers.
This package exposes a small, consumer-safe facade over selected helpers used across the UCD.js ecosystem. More volatile implementation details remain in @ucdjs-internal/shared.
Installation
npm install @ucdjs/utilsIncluded utility groups
- Unicode version helpers
- API error guards
Usage
Unicode version helpers
import {
getLatestStableUnicodeVersion,
isStableUnicodeVersion,
isValidUnicodeVersion,
} from "@ucdjs/utils";
isValidUnicodeVersion("16.0.0"); // true
isStableUnicodeVersion("16.0.0"); // true
getLatestStableUnicodeVersion(); // e.g. "16.0.0"API error guard
import { isApiError } from "@ucdjs/utils";
const result: unknown = await fetch("/api").then((r) => r.json());
if (isApiError(result)) {
console.error(result.message);
}Relationship
consumer code
-> @ucdjs/utils
-> curated public helpers
internal workspace code
-> @ucdjs-internal/shared
-> volatile/internal helper familiesLicense
Published under MIT License.
