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.IsNatNum

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

Returns true if the given string is a valid natural number, false otherwise.

Examples

Example 1

IsNatNum<5> => true
IsNatNum<0> => true
IsNatNum<-5> => false

Type Parameters

N extends string
definition: N extends "0" ? true : IsPosNum<N>