File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 7
7
TDate ,
8
8
TUnsafe ,
9
9
TypeRegistry ,
10
- TInteger
10
+ TInteger ,
11
+ IntegerOptions
11
12
} from '@sinclair/typebox'
12
13
import { TypeSystem } from '@sinclair/typebox/system'
13
14
import {
@@ -265,7 +266,7 @@ if (!FormatRegistry.Has('numeric'))
265
266
if ( ! FormatRegistry . Has ( 'integer' ) )
266
267
FormatRegistry . Set (
267
268
'integer' ,
268
- ( value ) => ! ! value && ! isNaN ( + value ) && Number . isInteger ( + value )
269
+ ( value ) => ! ! value && Number . isInteger ( + value )
269
270
)
270
271
271
272
if ( ! FormatRegistry . Has ( 'boolean' ) )
@@ -361,7 +362,7 @@ export const ElysiaType = {
361
362
} )
362
363
. Encode ( ( value ) => value ) as any as TNumber
363
364
} ,
364
- Integer : ( property ?: NumberOptions ) : TInteger => {
365
+ Integer : ( property ?: IntegerOptions ) : TInteger => {
365
366
const schema = Type . Integer ( property )
366
367
367
368
return t
@@ -379,7 +380,6 @@ export const ElysiaType = {
379
380
)
380
381
. Decode ( ( value ) => {
381
382
const number = + value
382
- if ( isNaN ( number ) ) return value
383
383
384
384
if ( ! Value . Check ( schema , number ) )
385
385
throw new ValidationError ( 'property' , schema , number )
You can’t perform that action at this time.
0 commit comments