UNPKG

@xylabs/hex

Version:

Base functionality used throughout XY Labs TypeScript/JavaScript libraries

11 lines 602 B
import type { AssertConfig } from '@xylabs/error'; import { type Hash } from './hash.ts'; /** * Attempts to coerce a value into a Hash type, returning undefined or throwing based on the assert config. * @param value - The value to coerce (must be a string) * @param assert - If provided, throws on failure instead of returning undefined * @returns The value as Hash, or undefined if coercion fails and assert is not set */ export declare function asHash(value: unknown): Hash | undefined; export declare function asHash(value: unknown, assert: AssertConfig): Hash; //# sourceMappingURL=as.d.ts.map