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

x/arktype/utils/numericLiterals.ts>wellFormedNumberMatcher

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

Matches a well-formatted numeric expression according to the following rules:

  1. Must include an integer portion (i.e. '.321' must be written as '0.321')
  2. The first digit of the value must not be 0, unless the entire integer portion is 0
  3. If the value includes a decimal, its last digit may not be 0
  4. The value may not be "-0"

type

RegExp