import { type StrNum } from "https://deno.land/x/rimbu@1.1.0/typical/index.ts";
const { PosNum } = StrNum;
Type that will return the incoming type if the value is a valid positive integer,
or never
otherwise.
Examples
Example 1
Example 1
PosNum<'321'> => '321'
PosNum<'0'> => never
definition: N extends Str.Append<PosDigit, infer Rest> ? Rest extends Str.TakeWhile<Rest, Digit> ? N : never : never