Skip to content

Commit 81d7b36

Browse files
authored
refactor: replace var statements (#742)
* refactor: replace `var` statements * chore: lint
1 parent 517a7bf commit 81d7b36

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

Diff for: index.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -252,20 +252,16 @@ const numberKeywords = [
252252
* https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-6
253253
*/
254254
function inferTypeByKeyword (schema) {
255-
// eslint-disable-next-line
256-
for (var keyword of objectKeywords) {
255+
for (const keyword of objectKeywords) {
257256
if (keyword in schema) return 'object'
258257
}
259-
// eslint-disable-next-line
260-
for (var keyword of arrayKeywords) {
258+
for (const keyword of arrayKeywords) {
261259
if (keyword in schema) return 'array'
262260
}
263-
// eslint-disable-next-line
264-
for (var keyword of stringKeywords) {
261+
for (const keyword of stringKeywords) {
265262
if (keyword in schema) return 'string'
266263
}
267-
// eslint-disable-next-line
268-
for (var keyword of numberKeywords) {
264+
for (const keyword of numberKeywords) {
269265
if (keyword in schema) return 'number'
270266
}
271267
return schema.type

Diff for: lib/serializer.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ module.exports = class Serializer {
102102
let result = ''
103103
let last = -1
104104
let point = 255
105-
// eslint-disable-next-line
106-
for (var i = 0; i < len; i++) {
105+
for (let i = 0; i < len; i++) {
107106
point = str.charCodeAt(i)
108107
if (
109108
point === 0x22 || // '"'

0 commit comments

Comments
 (0)