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

x/rimbu/typical/strnum.ts>NatNum

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

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>