Skip to content

Commit

Permalink
chore: use Object.prototype.hasOwnProperty in compileSchemasForValida…
Browse files Browse the repository at this point in the history
…tion (#4692)

Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
  • Loading branch information
Uzlopak and Fdawgs committed Apr 25, 2023
1 parent a92a40c commit b36fd26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,25 @@ function compileSchemasForValidation (context, compile, isCustom) {
})
}
context[headersSchema] = compile({ schema: headersSchemaLowerCase, method, url, httpPart: 'headers' })
} else if (Object.hasOwnProperty.call(schema, 'headers')) {
} else if (Object.prototype.hasOwnProperty.call(schema, 'headers')) {
warning.emit('FSTWRN001', 'headers', method, url)
}

if (schema.body) {
context[bodySchema] = compile({ schema: schema.body, method, url, httpPart: 'body' })
} else if (Object.hasOwnProperty.call(schema, 'body')) {
} else if (Object.prototype.hasOwnProperty.call(schema, 'body')) {
warning.emit('FSTWRN001', 'body', method, url)
}

if (schema.querystring) {
context[querystringSchema] = compile({ schema: schema.querystring, method, url, httpPart: 'querystring' })
} else if (Object.hasOwnProperty.call(schema, 'querystring')) {
} else if (Object.prototype.hasOwnProperty.call(schema, 'querystring')) {
warning.emit('FSTWRN001', 'querystring', method, url)
}

if (schema.params) {
context[paramsSchema] = compile({ schema: schema.params, method, url, httpPart: 'params' })
} else if (Object.hasOwnProperty.call(schema, 'params')) {
} else if (Object.prototype.hasOwnProperty.call(schema, 'params')) {
warning.emit('FSTWRN001', 'params', method, url)
}
}
Expand Down

0 comments on commit b36fd26

Please sign in to comment.