@@ -271,7 +271,7 @@ api.frame = (state, subjects, frame, parent, property = null) => {
271
271
// skip keywords
272
272
if ( prop === '@type' ) {
273
273
if ( ! types . isObject ( frame [ prop ] [ 0 ] ) ||
274
- ! frame [ prop ] [ 0 ] . hasOwnProperty ( '@default' ) ) {
274
+ ! ( '@default' in frame [ prop ] [ 0 ] ) ) {
275
275
continue ;
276
276
}
277
277
// allow through default types
@@ -344,7 +344,7 @@ api.cleanupNull = (input, options) => {
344
344
345
345
if ( types . isObject ( input ) ) {
346
346
// handle in-memory linked nodes
347
- if ( input . hasOwnProperty ( '@id' ) ) {
347
+ if ( '@id' in input ) {
348
348
const id = input [ '@id' ] ;
349
349
if ( options . link . hasOwnProperty ( id ) ) {
350
350
const idx = options . link [ id ] . indexOf ( input ) ;
@@ -451,7 +451,7 @@ function _validateFrame(frame) {
451
451
'jsonld.SyntaxError' , { frame} ) ;
452
452
}
453
453
454
- if ( frame [ 0 ] . hasOwnProperty ( '@id' ) ) {
454
+ if ( '@id' in frame [ 0 ] ) {
455
455
for ( const id of util . asArray ( frame [ 0 ] [ '@id' ] ) ) {
456
456
// @id must be wildcard or an IRI
457
457
if ( ! ( types . isObject ( id ) || url . isAbsolute ( id ) ) ||
@@ -463,7 +463,7 @@ function _validateFrame(frame) {
463
463
}
464
464
}
465
465
466
- if ( frame [ 0 ] . hasOwnProperty ( '@type' ) ) {
466
+ if ( '@type' in frame [ 0 ] ) {
467
467
for ( const type of util . asArray ( frame [ 0 ] [ '@type' ] ) ) {
468
468
// @id must be wildcard or an IRI
469
469
if ( ! ( types . isObject ( type ) || url . isAbsolute ( type ) ) ||
@@ -720,7 +720,7 @@ function _cleanupPreserve(input, options) {
720
720
}
721
721
722
722
// handle in-memory linked nodes
723
- if ( input . hasOwnProperty ( '@id' ) ) {
723
+ if ( '@id' in input ) {
724
724
const id = input [ '@id' ] ;
725
725
if ( options . link . hasOwnProperty ( id ) ) {
726
726
const idx = options . link [ id ] . indexOf ( input ) ;
0 commit comments