Utils
Curated stable utility functions
Utils
The @ucdjs/utils package provides a curated stable utility facade for UCD.js consumers.
Installation
npm install @ucdjs/utilsOverview
This package exposes the stable subset of utility helpers that are safe to share with external consumers. More volatile implementation helpers remain in @ucdjs-internal/shared.
[!IMPORTANT]
@ucdjs/utilsis intentionally small. It only exposes helpers that are likely to be useful to external consumers.
Unicode Version Helpers
import {
getLatestStableUnicodeVersion,
isStableUnicodeVersion,
isValidUnicodeVersion,
} from "@ucdjs/utils";
isValidUnicodeVersion("16.0.0");
isStableUnicodeVersion("16.0.0");
getLatestStableUnicodeVersion();API Error Guards
import { isApiError } from "@ucdjs/utils";
const result: unknown = await fetch("/api").then((r) => r.json());
if (isApiError(result)) {
console.error(result.message);
}Package Relationship
consumer code
-> @ucdjs/utils
-> curated public helpers
internal workspace code
-> @ucdjs-internal/shared
-> volatile/internal helper families