variable / @typed/id

isCuid

Tests whether a string is a valid branded CUID.

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

Import

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

Signatures

export declare const isCuid: (value: string) => value is Cuid;

Why

Runtime refinement restores trust after JSON, structured clone, or other transport has erased the TypeScript brand.

Ownership and lifetime

This pure predicate acquires no resources and retains no input.

Examples

import { isCuid } from "@typed/id/Cuid"
isCuid("a00000000000000000000000")

Other public imports

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

Source