@@ -271,7 +271,7 @@ api.frame = (state, subjects, frame, parent, property = null) => {
271271 // skip keywords
272272 if ( prop === '@type' ) {
273273 if ( ! types . isObject ( frame [ prop ] [ 0 ] ) ||
274- ! frame [ prop ] [ 0 ] . hasOwnProperty ( '@default' ) ) {
274+ ! ( '@default' in frame [ prop ] [ 0 ] ) ) {
275275 continue ;
276276 }
277277 // allow through default types
@@ -344,7 +344,7 @@ api.cleanupNull = (input, options) => {
344344
345345 if ( types . isObject ( input ) ) {
346346 // handle in-memory linked nodes
347- if ( input . hasOwnProperty ( '@id' ) ) {
347+ if ( '@id' in input ) {
348348 const id = input [ '@id' ] ;
349349 if ( options . link . hasOwnProperty ( id ) ) {
350350 const idx = options . link [ id ] . indexOf ( input ) ;
@@ -451,7 +451,7 @@ function _validateFrame(frame) {
451451 'jsonld.SyntaxError' , { frame} ) ;
452452 }
453453
454- if ( frame [ 0 ] . hasOwnProperty ( '@id' ) ) {
454+ if ( '@id' in frame [ 0 ] ) {
455455 for ( const id of util . asArray ( frame [ 0 ] [ '@id' ] ) ) {
456456 // @id must be wildcard or an IRI
457457 if ( ! ( types . isObject ( id ) || url . isAbsolute ( id ) ) ||
@@ -463,7 +463,7 @@ function _validateFrame(frame) {
463463 }
464464 }
465465
466- if ( frame [ 0 ] . hasOwnProperty ( '@type' ) ) {
466+ if ( '@type' in frame [ 0 ] ) {
467467 for ( const type of util . asArray ( frame [ 0 ] [ '@type' ] ) ) {
468468 // @id must be wildcard or an IRI
469469 if ( ! ( types . isObject ( type ) || url . isAbsolute ( type ) ) ||
@@ -720,7 +720,7 @@ function _cleanupPreserve(input, options) {
720720 }
721721
722722 // handle in-memory linked nodes
723- if ( input . hasOwnProperty ( '@id' ) ) {
723+ if ( '@id' in input ) {
724724 const id = input [ '@id' ] ;
725725 if ( options . link . hasOwnProperty ( id ) ) {
726726 const idx = options . link [ id ] . indexOf ( input ) ;
0 commit comments