Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/rimbu/typical/mod.ts>StrNum.NatNum

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
type alias StrNum.NatNum
import { type StrNum } from "https://deno.land/x/rimbu@1.0.2/typical/mod.ts";
const { NatNum } = StrNum;

Type that will return the incoming type if the value is a valid natural number, or never otherwise.

Examples

Example 1

NatNum<'321'> => '321'
NatNum<'0'> => '0'

Type Parameters

N extends string
definition: N extends "0" ? "0" : PosNum<N>