@@ -312,4 +312,4 @@ import { Memory } from '../../system/memory/index.mjs'; | ||
| export declare function PatternStringMapping(input: '.*'): unknown; | ||
| export type TPatternNumberMapping<Input extends '-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?'> = (T.TNumber); | ||
| export declare function PatternNumberMapping(input: '-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?'): unknown; | ||
| export type TPatternNumberMapping<Input extends '-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?'> = (T.TNumber); | ||
| export declare function PatternNumberMapping(input: '-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?'): unknown; | ||
| export type TPatternIntegerMapping<Input extends '-?(?:0|[1-9][0-9]*)'> = (T.TInteger); | ||
@@ -316,0 +316,0 @@ export declare function PatternIntegerMapping(input: '-?(?:0|[1-9][0-9]*)'): unknown; |
@@ -113,6 +113,6 @@ // deno-fmt-ignore-file | ||
| export const PatternString = (input) => If(Token.Const('.*', input), ([_0, input]) => [S.PatternStringMapping(_0), input]); | ||
| export const PatternNumber = (input) => If(Token.Const('-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?', input), ([_0, input]) => [S.PatternNumberMapping(_0), input]); | ||
| export const PatternNumber = (input) => If(Token.Const('-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?', input), ([_0, input]) => [S.PatternNumberMapping(_0), input]); | ||
| export const PatternInteger = (input) => If(Token.Const('-?(?:0|[1-9][0-9]*)', input), ([_0, input]) => [S.PatternIntegerMapping(_0), input]); | ||
| export const PatternNever = (input) => If(Token.Const('(?!)', input), ([_0, input]) => [S.PatternNeverMapping(_0), input]); | ||
| export const PatternText = (input) => If(Token.Until_1(['-?(?:0|[1-9][0-9]*)n', '.*', '-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?', '-?(?:0|[1-9][0-9]*)', '(?!)', '(', ')', '$', '|'], input), ([_0, input]) => [S.PatternTextMapping(_0), input]); | ||
| export const PatternText = (input) => If(Token.Until_1(['-?(?:0|[1-9][0-9]*)n', '.*', '-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?', '-?(?:0|[1-9][0-9]*)', '(?!)', '(', ')', '$', '|'], input), ([_0, input]) => [S.PatternTextMapping(_0), input]); | ||
| export const PatternBase = (input) => If(If(PatternBigInt(input), ([_0, input]) => [_0, input], () => If(PatternString(input), ([_0, input]) => [_0, input], () => If(PatternNumber(input), ([_0, input]) => [_0, input], () => If(PatternInteger(input), ([_0, input]) => [_0, input], () => If(PatternNever(input), ([_0, input]) => [_0, input], () => If(PatternGroup(input), ([_0, input]) => [_0, input], () => If(PatternText(input), ([_0, input]) => [_0, input], () => []))))))), ([_0, input]) => [S.PatternBaseMapping(_0), input]); | ||
@@ -119,0 +119,0 @@ export const PatternGroup = (input) => If(If(Token.Const('(', input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Token.Const(')', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.PatternGroupMapping(_0), input]); |
| import { type TSchema, type TNumberOptions } from './schema.mjs'; | ||
| export declare const NumberPattern = "-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?"; | ||
| export declare const NumberPattern = "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?"; | ||
| export type StaticNumber = number; | ||
@@ -4,0 +4,0 @@ /** Represents a Number type. */ |
@@ -7,3 +7,3 @@ // deno-fmt-ignore-file | ||
| // ------------------------------------------------------------------ | ||
| export const NumberPattern = '-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?'; | ||
| export const NumberPattern = '-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?'; | ||
| // ------------------------------------------------------------------ | ||
@@ -10,0 +10,0 @@ // Factory |
@@ -17,3 +17,3 @@ import { type TSchema, type TObjectOptions } from './schema.mjs'; | ||
| export declare const IntegerKey = "^-?(?:0|[1-9][0-9]*)$"; | ||
| export declare const NumberKey = "^-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?$"; | ||
| export declare const NumberKey = "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"; | ||
| export declare const StringKey = "^.*$"; | ||
@@ -20,0 +20,0 @@ export interface TRecord<Key extends string = string, Value extends TSchema = TSchema> extends TSchema { |
+1
-1
| { | ||
| "name": "typebox", | ||
| "description": "Json Schema Type Builder with Static Type Resolution for TypeScript", | ||
| "version": "1.2.0", | ||
| "version": "1.2.1", | ||
| "keywords": [ | ||
@@ -6,0 +6,0 @@ "typescript", |
Sorry, the diff of this file is too big to display
1486374
0