Skip to content

Commit 844eba5

Browse files
committed
Rebase to #510 (use hasOwnProperty from Object.prototype)
1 parent ca1357d commit 844eba5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ function buildValue (location, input) {
932932
switch (type) {
933933
case 'string': {
934934
code += `
935-
${statement}(${input} === null || typeof ${input} === "${type}" || ${input} instanceof RegExp || (typeof ${input} === "object" && Object.hasOwnProperty.call(${input}, "toString")))
935+
${statement}(${input} === null || typeof ${input} === "${type}" || ${input} instanceof RegExp || (typeof ${input} === "object" && Object.prototype.hasOwnProperty.call(${input}, "toString")))
936936
${nestedResult}
937937
`
938938
break
@@ -1018,7 +1018,10 @@ function extendDateTimeType (schema) {
10181018
function isEmpty (schema) {
10191019
// eslint-disable-next-line
10201020
for (var key in schema) {
1021-
if (schema.hasOwnProperty(key) && schema[key] !== undefined) {
1021+
if (
1022+
Object.prototype.hasOwnProperty.call(schema, key) &&
1023+
schema[key] !== undefined
1024+
) {
10221025
return false
10231026
}
10241027
}

0 commit comments

Comments
 (0)