variable / @typed/id

isNanoId

Tests whether a string has the NanoId alphabet and brandable shape.

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

Import

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

Signatures

export declare const isNanoId: (value: string) => value is NanoId;

Why

Refinement is the lightweight boundary check when full schema decoding is unnecessary.

Ownership and lifetime

This pure predicate acquires no resources and retains no input.

Examples

import { isNanoId } from "@typed/id/NanoId"
isNanoId("V1StGXR8_Z5jdHi6B-myT")

Other public imports

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

Source