variable / @typed/id

isKsuid

Tests whether a string has the KSUID encoding shape.

Package version
1.0.0-beta.7
Category
ID validation
Since
1.0.0

Import

import { isKsuid } from "@typed/id";

Signatures

export declare const isKsuid: (value: string) => value is Ksuid;

Why

Runtime refinement restores trust after serialization has erased the TypeScript brand.

Ownership and lifetime

This pure predicate acquires no resources and retains no input.

Examples

import { isKsuid } from "@typed/id/Ksuid"
isKsuid("0ujtsYcgvSTl8PAuAdqWYSMnLOv")

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source