Skip to content

Commit 65fb744

Browse files
committed
Updated dependencies
1 parent 5cedf58 commit 65fb744

9 files changed

+24
-24
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ function addIfThenElse (schema, name, externalSchema, fullSchema) {
503503
var merged = merge(copy, then)
504504

505505
code += `
506-
valid = ajv.validate(${require('util').inspect(i, {depth: null})}, obj)
506+
valid = ajv.validate(${require('util').inspect(i, { depth: null })}, obj)
507507
if (valid) {
508508
`
509509
if (merged.if && merged.then) {
@@ -587,7 +587,7 @@ function buildArray (schema, code, name, externalSchema, fullSchema) {
587587
schema.items = refFinder(schema.items['$ref'], fullSchema, externalSchema)
588588
}
589589

590-
var result = {code: '', laterCode: ''}
590+
var result = { code: '', laterCode: '' }
591591
if (Array.isArray(schema.items)) {
592592
result = schema.items.reduce((res, item, i) => {
593593
var accessor = '[i]'
@@ -722,7 +722,7 @@ function nested (laterCode, name, key, schema, externalSchema, fullSchema, subKe
722722
schema.anyOf.forEach((s, index) => {
723723
var nestedResult = nested(laterCode, name, key, s, externalSchema, fullSchema, subKey)
724724
code += `
725-
${index === 0 ? 'if' : 'else if'}(ajv.validate(${require('util').inspect(s, {depth: null})}, obj${accessor}))
725+
${index === 0 ? 'if' : 'else if'}(ajv.validate(${require('util').inspect(s, { depth: null })}, obj${accessor}))
726726
${nestedResult.code}
727727
`
728728
laterCode = nestedResult.laterCode
@@ -743,7 +743,7 @@ function nested (laterCode, name, key, schema, externalSchema, fullSchema, subKe
743743
const nullIndex = type.indexOf('null')
744744
const sortedTypes = nullIndex !== -1 ? [type[nullIndex]].concat(type.slice(0, nullIndex)).concat(type.slice(nullIndex + 1)) : type
745745
sortedTypes.forEach((type, index) => {
746-
var tempSchema = Object.assign({}, schema, {type})
746+
var tempSchema = Object.assign({}, schema, { type })
747747
var nestedResult = nested(laterCode, name, key, tempSchema, externalSchema, fullSchema, subKey)
748748
if (type === 'string') {
749749
code += `

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
"homepage": "https://github.com/fastify/fast-json-stringify#readme",
2929
"devDependencies": {
3030
"benchmark": "^2.1.4",
31-
"is-my-json-valid": "^2.17.2",
31+
"is-my-json-valid": "^2.19.0",
3232
"long": "^4.0.0",
3333
"pre-commit": "^1.2.2",
34-
"proxyquire": "^2.0.0",
35-
"standard": "^11.0.1",
34+
"proxyquire": "^2.1.0",
35+
"standard": "^12.0.1",
3636
"tap": "^12.0.0",
3737
"uglify-es": "^3.3.9"
3838
},
3939
"dependencies": {
40-
"ajv": "^6.5.1",
40+
"ajv": "^6.5.3",
4141
"deepmerge": "^2.1.1"
4242
}
4343
}

test/additionalProperties.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test('additionalProperties', (t) => {
1818
}
1919
})
2020

21-
let obj = { str: 'test', foo: 42, ofoo: true, foof: 'string', objfoo: {a: true} }
21+
let obj = { str: 'test', foo: 42, ofoo: true, foof: 'string', objfoo: { a: true } }
2222
t.equal('{"foo":"42","ofoo":"true","foof":"string","objfoo":"[object Object]","str":"test"}', stringify(obj))
2323
})
2424

test/anyof.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ test('object with field of type object or null', (t) => {
7474

7575
try {
7676
const value = stringify({
77-
prop: {str: 'string'}
77+
prop: { str: 'string' }
7878
})
7979
t.is(value, '{"prop":{"str":"string"}}')
8080
} catch (e) {

test/array.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function buildTest (schema, toStringify) {
1010

1111
const validate = validator(schema)
1212
const stringify = build(schema)
13-
const stringifyUgly = build(schema, {uglify: true})
13+
const stringifyUgly = build(schema, { uglify: true })
1414
const output = stringify(toStringify)
1515
const outputUglify = stringifyUgly(toStringify)
1616

@@ -92,7 +92,7 @@ buildTest({
9292
}
9393
}
9494
}, {
95-
ids: [null, 'test', 1, 1.1, true, {a: 'test'}, ['test']]
95+
ids: [null, 'test', 1, 1.1, true, { a: 'test' }, ['test']]
9696
})
9797

9898
buildTest({
@@ -111,7 +111,7 @@ buildTest({
111111
]
112112
}
113113
}
114-
}, {ids: [1, 2]})
114+
}, { ids: [1, 2] })
115115

116116
buildTest({
117117
'title': 'pattern properties array',
@@ -139,7 +139,7 @@ buildTest({
139139
]
140140
}
141141
}
142-
}, {args: [{a: 'test'}, {b: 1}]})
142+
}, { args: [{ a: 'test' }, { b: 1 }] })
143143

144144
test('invalid items throw', (t) => {
145145
t.plan(1)
@@ -162,5 +162,5 @@ test('invalid items throw', (t) => {
162162
}
163163
}
164164
const stringify = build(schema)
165-
t.throws(() => stringify({args: ['invalid']}))
165+
t.throws(() => stringify({ args: ['invalid'] }))
166166
})

test/basic.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function buildTest (schema, toStringify) {
1010

1111
const validate = validator(schema)
1212
const stringify = build(schema)
13-
const stringifyUgly = build(schema, {uglify: true})
13+
const stringifyUgly = build(schema, { uglify: true })
1414
const output = stringify(toStringify)
1515
const outputUglify = stringifyUgly(toStringify)
1616

test/defaults.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function buildTest (schema, toStringify, expected) {
99

1010
const stringify = build(schema)
1111

12-
const stringifyUgly = build(schema, {uglify: true})
12+
const stringifyUgly = build(schema, { uglify: true })
1313
const output = stringify(toStringify)
1414
const outputUglify = stringifyUgly(toStringify)
1515

test/if-then-else.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const schema = {
2222
'items': {
2323
'type': 'object',
2424
'properties': {
25-
'name': {'type': 'string'},
26-
'value': {'type': 'string'}
25+
'name': { 'type': 'string' },
26+
'value': { 'type': 'string' }
2727
}
2828
}
2929
}
@@ -62,8 +62,8 @@ const nestedIfSchema = {
6262
'items': {
6363
'type': 'object',
6464
'properties': {
65-
'name': {'type': 'string'},
66-
'value': {'type': 'string'}
65+
'name': { 'type': 'string' },
66+
'value': { 'type': 'string' }
6767
}
6868
}
6969
}
@@ -104,8 +104,8 @@ const nestedElseSchema = {
104104
'items': {
105105
'type': 'object',
106106
'properties': {
107-
'name': {'type': 'string'},
108-
'value': {'type': 'string'}
107+
'name': { 'type': 'string' },
108+
'value': { 'type': 'string' }
109109
}
110110
}
111111
}

test/patternProperties.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test('patternProperties', (t) => {
2020
}
2121
})
2222

23-
let obj = { str: 'test', foo: 42, ofoo: true, foof: 'string', objfoo: {a: true}, notMe: false }
23+
let obj = { str: 'test', foo: 42, ofoo: true, foof: 'string', objfoo: { a: true }, notMe: false }
2424
t.equal(stringify(obj), '{"foo":"42","ofoo":"true","foof":"string","objfoo":"[object Object]","str":"test"}')
2525
})
2626

0 commit comments

Comments
 (0)