Skip to content

Commit cd77a40

Browse files
update
1 parent b7afc84 commit cd77a40

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ function build (schema, options) {
9393
functionsCounter: 0,
9494
functionsNamesBySchema: new Map(),
9595
options,
96-
wrapObjects: true,
9796
refResolver: new RefResolver(),
9897
rootSchemaId: schema.$id || `__fjs_root_${schemaIdCounter++}`,
9998
validatorSchemasIds: new Set()
@@ -361,10 +360,8 @@ function buildInnerObject (context, location) {
361360

362361
code += `
363362
let addComma = false
364-
let json = '${context.wrapObjects ? '{' : ''}'
363+
let json = '{'
365364
`
366-
const wrapObjects = context.wrapObjects
367-
context.wrapObjects = true
368365

369366
if (schema.properties) {
370367
for (const key of Object.keys(schema.properties)) {
@@ -408,9 +405,8 @@ function buildInnerObject (context, location) {
408405
code += buildExtraObjectPropertiesSerializer(context, location)
409406
}
410407

411-
context.wrapObjects = wrapObjects
412408
code += `
413-
return json${context.wrapObjects ? ' + \'}\'' : ''}
409+
return json + '}'
414410
`
415411
return code
416412
}

0 commit comments

Comments
 (0)