File tree Expand file tree Collapse file tree 1 file changed +2
-24
lines changed Expand file tree Collapse file tree 1 file changed +2
-24
lines changed Original file line number Diff line number Diff line change @@ -146,13 +146,8 @@ function build (schema, options) {
146146 return ${ main }
147147 `
148148
149- const dependencies = [ ]
150- const dependenciesName = [ ]
151- if ( dependsOnAjv ( schema ) ) {
152- dependencies . push ( new Ajv ( options . ajv ) )
153- dependenciesName . push ( 'ajv' )
154- }
155-
149+ const dependencies = [ new Ajv ( options . ajv ) ]
150+ const dependenciesName = [ 'ajv' ]
156151 dependenciesName . push ( code )
157152
158153 if ( options . debugMode ) {
@@ -223,23 +218,6 @@ function inferTypeByKeyword (schema) {
223218 return schema . type
224219}
225220
226- function dependsOnAjv ( schema ) {
227- const str = JSON . stringify ( schema )
228- switch ( true ) {
229- case / " i f " : { .* " t h e n " : { / . test ( str ) :
230- case / " ( a n y O f | o n e O f ) " : \[ / . test ( str ) :
231- case / " c o n s t " / . test ( str ) :
232- case / " \$ r e f " / . test ( str ) :
233- {
234- return true
235- }
236-
237- default : {
238- return false
239- }
240- }
241- }
242-
243221const stringSerializerMap = {
244222 'date-time' : '$asDatetime' ,
245223 date : '$asDate' ,
You can’t perform that action at this time.
0 commit comments