Skip to content

Commit

Permalink
refactor: replace var statements (#742)
Browse files Browse the repository at this point in the history
* refactor: replace `var` statements

* chore: lint
  • Loading branch information
Fdawgs authored Oct 25, 2024
1 parent 517a7bf commit 81d7b36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
12 changes: 4 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,16 @@ const numberKeywords = [
* https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-6
*/
function inferTypeByKeyword (schema) {
// eslint-disable-next-line
for (var keyword of objectKeywords) {
for (const keyword of objectKeywords) {
if (keyword in schema) return 'object'
}
// eslint-disable-next-line
for (var keyword of arrayKeywords) {
for (const keyword of arrayKeywords) {
if (keyword in schema) return 'array'
}
// eslint-disable-next-line
for (var keyword of stringKeywords) {
for (const keyword of stringKeywords) {
if (keyword in schema) return 'string'
}
// eslint-disable-next-line
for (var keyword of numberKeywords) {
for (const keyword of numberKeywords) {
if (keyword in schema) return 'number'
}
return schema.type
Expand Down
3 changes: 1 addition & 2 deletions lib/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ module.exports = class Serializer {
let result = ''
let last = -1
let point = 255
// eslint-disable-next-line
for (var i = 0; i < len; i++) {
for (let i = 0; i < len; i++) {
point = str.charCodeAt(i)
if (
point === 0x22 || // '"'
Expand Down

0 comments on commit 81d7b36

Please sign in to comment.