File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -346,12 +346,12 @@ function buildCode (location) {
346346 schema . properties [ key ] = propertyLocation . schema
347347 }
348348
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-
352349 const sanitized = JSON . stringify ( key )
353350 const asString = JSON . stringify ( sanitized )
354351
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+
355355 code += `
356356 if (obj[${ sanitized } ] !== undefined) {
357357 ${ addComma }
@@ -901,7 +901,7 @@ function buildValue (location, input) {
901901 switch ( type ) {
902902 case 'string' : {
903903 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")))
905905 ${ nestedResult }
906906 `
907907 break
@@ -987,7 +987,7 @@ function extendDateTimeType (schema) {
987987function isEmpty ( schema ) {
988988 // eslint-disable-next-line
989989 for ( var key in schema ) {
990- if ( schema . hasOwnProperty ( key ) && schema [ key ] !== undefined ) {
990+ if ( Object . prototype . hasOwnProperty . call ( schema , key ) && schema [ key ] !== undefined ) {
991991 return false
992992 }
993993 }
You can’t perform that action at this time.
0 commit comments