Definitions#

These TypeScript definitions document server validation. check.object rejects unknown fields. Custom functions and refinements specify additional checks.

Imported definitions#

This module has no local contract dependencies.

BinaryInput#

export type BinaryInput = {
    byteLength: number;
    chunks: AsyncIterable<Uint8Array>;
};

utf8#

utf8 = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true })

decodeUtf8#

export function decodeUtf8(bytes: Uint8Array): string {
    return utf8.decode(bytes);
}

Related definitions:

binaryBytes#

export function binaryBytes(bytes: Uint8Array): BinaryInput {
    return { byteLength: bytes.byteLength, chunks: { async *[Symbol.asyncIterator]() { yield bytes; } } };
}

Related definitions: