Skip to content

Commit 1fb572f

Browse files
greenkeeper[bot]delvedor
authored andcommitted
Update standard to the latest version 🚀 (#174)
* chore(package): update standard to version 13.0.1 * Fix standard
1 parent ba8749c commit 1fb572f

14 files changed

+442
-440
lines changed

‎build-schema-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const ajv = new Ajv({
1111

1212
const validate = ajv.compile(require('ajv/lib/refs/json-schema-draft-07.json'))
1313

14-
let moduleCode = `// This file is autogenerated by ${path.basename(__filename)}, do not edit
14+
const moduleCode = `// This file is autogenerated by ${path.basename(__filename)}, do not edit
1515
1616
function nop () { return true }
1717

‎example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const stringify = fastJson({
4646
'.*foo$': {
4747
type: 'string'
4848
},
49-
'test': {
49+
test: {
5050
type: 'number'
5151
}
5252
},

‎index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict'
22

3+
/* eslint no-prototype-builtins: 0 */
4+
35
var Ajv = require('ajv')
46
var merge = require('deepmerge')
57
var util = require('util')
@@ -38,7 +40,7 @@ function build (schema, options) {
3840
options = options || {}
3941
isValidSchema(schema)
4042
if (options.schema) {
41-
for (let key of Object.keys(options.schema)) {
43+
for (const key of Object.keys(options.schema)) {
4244
isValidSchema(options.schema[key], key)
4345
}
4446
}

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"long": "^4.0.0",
3838
"pre-commit": "^1.2.2",
3939
"proxyquire": "^2.1.0",
40-
"standard": "^12.0.1",
40+
"standard": "^13.0.1",
4141
"tap": "^12.6.5",
4242
"tap-mocha-reporter": "^3.0.9",
4343
"typescript": "^3.0.0",

‎test/additionalProperties.test.js

Lines changed: 5 additions & 5 deletions
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+
const 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

@@ -177,7 +177,7 @@ test('nested additionalProperties', (t) => {
177177
}
178178
})
179179

180-
let obj = [{ ap: { value: 'string' } }]
180+
const obj = [{ ap: { value: 'string' } }]
181181
t.equal('[{"ap":{"value":"string"}}]', stringify(obj))
182182
})
183183

@@ -214,7 +214,7 @@ test('very nested additionalProperties', (t) => {
214214
}
215215
})
216216

217-
let obj = [{ ap: { nested: { moarNested: { finally: { value: 'str' } } } } }]
217+
const obj = [{ ap: { nested: { moarNested: { finally: { value: 'str' } } } } }]
218218
t.equal('[{"ap":{"nested":{"moarNested":{"finally":{"value":"str"}}}}}]', stringify(obj))
219219
})
220220

@@ -231,7 +231,7 @@ test('nested additionalProperties set to true', (t) => {
231231
}
232232
})
233233

234-
let obj = { ap: { value: 'string', someNumber: 42 } }
234+
const obj = { ap: { value: 'string', someNumber: 42 } }
235235
t.equal('{"ap":{"value":"string","someNumber":42}}', stringify(obj))
236236
})
237237

@@ -248,6 +248,6 @@ test('field passed to fastSafeStringify as undefined should be removed', (t) =>
248248
}
249249
})
250250

251-
let obj = { ap: { value: 'string', someNumber: undefined } }
251+
const obj = { ap: { value: 'string', someNumber: undefined } }
252252
t.equal('{"ap":{"value":"string"}}', stringify(obj))
253253
})

‎test/array.test.js

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ function buildTest (schema, toStringify) {
2323
}
2424

2525
buildTest({
26-
'title': 'string array',
27-
'type': 'object',
28-
'properties': {
29-
'ids': {
30-
'type': 'array',
31-
'items': {
32-
'type': 'string'
26+
title: 'string array',
27+
type: 'object',
28+
properties: {
29+
ids: {
30+
type: 'array',
31+
items: {
32+
type: 'string'
3333
}
3434
}
3535
}
@@ -38,13 +38,13 @@ buildTest({
3838
})
3939

4040
buildTest({
41-
'title': 'number array',
42-
'type': 'object',
43-
'properties': {
44-
'ids': {
45-
'type': 'array',
46-
'items': {
47-
'type': 'number'
41+
title: 'number array',
42+
type: 'object',
43+
properties: {
44+
ids: {
45+
type: 'array',
46+
items: {
47+
type: 'number'
4848
}
4949
}
5050
}
@@ -53,39 +53,39 @@ buildTest({
5353
})
5454

5555
buildTest({
56-
'title': 'mixed array',
57-
'type': 'object',
58-
'properties': {
59-
'ids': {
60-
'type': 'array',
61-
'items': [
56+
title: 'mixed array',
57+
type: 'object',
58+
properties: {
59+
ids: {
60+
type: 'array',
61+
items: [
6262
{
63-
'type': 'null'
63+
type: 'null'
6464
},
6565
{
66-
'type': 'string'
66+
type: 'string'
6767
},
6868
{
69-
'type': 'integer'
69+
type: 'integer'
7070
},
7171
{
72-
'type': 'number'
72+
type: 'number'
7373
},
7474
{
75-
'type': 'boolean'
75+
type: 'boolean'
7676
},
7777
{
78-
'type': 'object',
79-
'properties': {
80-
'a': {
81-
'type': 'string'
78+
type: 'object',
79+
properties: {
80+
a: {
81+
type: 'string'
8282
}
8383
}
8484
},
8585
{
86-
'type': 'array',
87-
'items': {
88-
'type': 'string'
86+
type: 'array',
87+
items: {
88+
type: 'string'
8989
}
9090
}
9191
]
@@ -96,12 +96,12 @@ buildTest({
9696
})
9797

9898
buildTest({
99-
'title': 'repeated types',
100-
'type': 'object',
101-
'properties': {
102-
'ids': {
103-
'type': 'array',
104-
'items': [
99+
title: 'repeated types',
100+
type: 'object',
101+
properties: {
102+
ids: {
103+
type: 'array',
104+
items: [
105105
{
106106
type: 'number'
107107
},
@@ -114,25 +114,25 @@ buildTest({
114114
}, { ids: [1, 2] })
115115

116116
buildTest({
117-
'title': 'pattern properties array',
118-
'type': 'object',
119-
'properties': {
120-
'args': {
121-
'type': 'array',
122-
'items': [
117+
title: 'pattern properties array',
118+
type: 'object',
119+
properties: {
120+
args: {
121+
type: 'array',
122+
items: [
123123
{
124-
'type': 'object',
125-
'patternProperties': {
124+
type: 'object',
125+
patternProperties: {
126126
'.*': {
127-
'type': 'string'
127+
type: 'string'
128128
}
129129
}
130130
},
131131
{
132-
'type': 'object',
133-
'patternProperties': {
132+
type: 'object',
133+
patternProperties: {
134134
'.*': {
135-
'type': 'number'
135+
type: 'number'
136136
}
137137
}
138138
}
@@ -144,16 +144,16 @@ buildTest({
144144
test('invalid items throw', (t) => {
145145
t.plan(1)
146146
const schema = {
147-
'type': 'object',
148-
'properties': {
149-
'args': {
150-
'type': 'array',
151-
'items': [
147+
type: 'object',
148+
properties: {
149+
args: {
150+
type: 'array',
151+
items: [
152152
{
153-
'type': 'object',
154-
'patternProperties': {
153+
type: 'object',
154+
patternProperties: {
155155
'.*': {
156-
'type': 'string'
156+
type: 'string'
157157
}
158158
}
159159
}

0 commit comments

Comments
 (0)