UCD.js Docs

Utils

Architecture notes for @ucdjs/utils

@ucdjs/utils provides the stable public utility facade for a small subset of shared helpers.

Role

  • Re-exports safe public helpers without exposing the full internal helper package.
  • Gives external consumers a semver-respected entrypoint for common checks.
  • Keeps internal helper churn isolated behind a smaller public surface.

Mental Model

@ucdjs/utils is intentionally thin.

It does not try to be a giant utility package. Instead, it selects a few helpers from @ucdjs-internal/shared and republishes them as stable public APIs:

  • isApiError
  • Unicode version classification helpers

Public Facade Model

external consumers / public packages

@ucdjs/utils

@ucdjs-internal/shared

@ucdjs/schemas

@unicode-utils/core

Method Flows

isApiError(value)

unknown valueisApiError()unknown valueisApiError()alt[matches ApiErrorshape][does not match]CallerisApiError(value)check object shapecheck message/status/timestamp keystruefalseCaller

Unicode Version Helpers

@unicode-utils/core metadatashared version helpers@ucdjs/utils@unicode-utils/core metadatashared version helpers@ucdjs/utilsCallerisValidUnicodeVersion() / getLatestStableUnicodeVersion() / isDraftUnicodeVersion()re-exported helper callinspect version metadata / draft version constantmetadata resultboolean or resolved versionfinal resultCaller

Stability Boundary

internal shared helper

candidate for public use

stable public re-export

or remain internal-only

Testing Use

The tests that matter most here are:

  • guard accuracy for isApiError()
  • Unicode version helper correctness against metadata
  • verification that the public facade exports exactly the intended stable helpers

On this page