@demicodes/utils
v0.3.2
Published
Shared zero-dependency utilities for Demi (type guards, errors, async, bytes, strings, paths, JSON).
Downloads
1,083
Readme
@demicodes/utils
Zero-dependency, platform-neutral utilities shared across the Demi toolkit. Every generic helper lives here so nothing is re-implemented per package (a boundary test enforces this).
Modules
- guards —
isRecord,asRecord,asString,stringOrNull,nonEmptyString,numberOrZero,numberOrNull - errors —
AbortError,asError,errorMessage,isAbortError,throwIfAborted,abortable - async —
noop,deferred,delay,withTimeout,waitFor - bytes —
encodeUtf8,decodeUtf8,utf8Bytes,utf8Slice,concatBytes - strings —
clamp,truncate,tail,shortHash,normalizeBaseUrl - json —
parseJsonOrString,parseJsonObject - paths —
normalizePath,dirnamePath,isAbsolutePath - id —
createId
import { errorMessage, truncate, parseJsonObject } from '@demicodes/utils'Part of Demi. Apache-2.0.
