Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/arktype/utils/numericLiterals.ts>tryParseWellFormedNumber

TypeScript's 1:1 validator, optimized from editor to runtime
Latest
type alias tryParseWellFormedNumber
import { type tryParseWellFormedNumber } from "https://deno.land/x/arktype@v1.0.10-alpha/utils/numericLiterals.ts";

Type Parameters

token extends string
messageOnFail extends string
definition: token extends NumberLiteral<infer value> ? value : messageOnFail
variable tryParseWellFormedNumber
import { tryParseWellFormedNumber } from "https://deno.land/x/arktype@v1.0.10-alpha/utils/numericLiterals.ts";

type

<ErrorOnFail extends boolean | string>(token: string, errorOnFail?: ErrorOnFail) => unknown