File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -346,12 +346,12 @@ function buildCode (location) {
346
346
schema . properties [ key ] = propertyLocation . schema
347
347
}
348
348
349
- // Using obj['key'] !== undefined instead of obj.hasOwnProperty(prop) for perf reasons,
350
- // see https://github.com/mcollina/fast-json-stringify/pull/3 for discussion.
351
-
352
349
const sanitized = JSON . stringify ( key )
353
350
const asString = JSON . stringify ( sanitized )
354
351
352
+ // Using obj['key'] !== undefined instead of obj.hasOwnProperty(prop) for perf reasons,
353
+ // see https://github.com/mcollina/fast-json-stringify/pull/3 for discussion.
354
+
355
355
code += `
356
356
if (obj[${ sanitized } ] !== undefined) {
357
357
${ addComma }
@@ -901,7 +901,7 @@ function buildValue (location, input) {
901
901
switch ( type ) {
902
902
case 'string' : {
903
903
code += `
904
- ${ statement } (${ input } === null || typeof ${ input } === "${ type } " || ${ input } instanceof RegExp || (typeof ${ input } === "object" && Object.hasOwnProperty.call(${ input } , "toString")))
904
+ ${ statement } (${ input } === null || typeof ${ input } === "${ type } " || ${ input } instanceof RegExp || (typeof ${ input } === "object" && Object.prototype. hasOwnProperty.call(${ input } , "toString")))
905
905
${ nestedResult }
906
906
`
907
907
break
@@ -987,7 +987,7 @@ function extendDateTimeType (schema) {
987
987
function isEmpty ( schema ) {
988
988
// eslint-disable-next-line
989
989
for ( var key in schema ) {
990
- if ( schema . hasOwnProperty ( key ) && schema [ key ] !== undefined ) {
990
+ if ( Object . prototype . hasOwnProperty . call ( schema , key ) && schema [ key ] !== undefined ) {
991
991
return false
992
992
}
993
993
}
You can’t perform that action at this time.
0 commit comments