File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 11import { t } from 'elysia'
22import { createAccelerator } from '../src/index'
33
4- const v = t . Module ( {
5- a : t . Object ( {
6- name : t . String ( ) ,
7- job : t . Optional ( t . Ref ( 'job' ) ) ,
8- trait : t . Optional ( t . String ( ) )
9- } ) ,
10- job : t . Number ( )
4+ const shape = t . Object ( {
5+ name : t . String ( ) ,
6+ playing : t . Nullable ( t . Integer ( { default : 1 } ) )
117} )
128
13- const shape = v . Import ( 'a' )
9+ console . log ( t . Optional ( t . String ( ) ) )
1410
1511const value = {
16- name : 'Jane Doe' ,
17- job : 'Software Engineer' ,
18- trait : 'Friendly'
12+ name : 'saltyaom' ,
13+ playing : null
1914} satisfies typeof shape . static
2015
2116const mirror = createAccelerator ( shape )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ const isInteger = (schema: TAnySchema) => {
3636 continue
3737 }
3838
39- if ( ! hasNumberType && type . type === 'number' ) {
39+ if ( ! hasNumberType && ( type . type === 'number' || type . type === 'integer' ) ) {
4040 hasNumberType = true
4141 continue
4242 }
You can’t perform that action at this time.
0 commit comments