Skip to content

Commit 6dad5ac

Browse files
committed
Only throw errors if options are actually defined
1 parent 19d55bd commit 6dad5ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/jsonld.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,12 +1040,12 @@ function _setDefaults(options, {
10401040
...defaults
10411041
}) {
10421042
// fail if obsolete options present
1043-
if(options && 'compactionMap' in options) {
1043+
if(options?.compactionMap !== undefined) {
10441044
throw new JsonLdError(
10451045
'"compactionMap" not supported.',
10461046
'jsonld.OptionsError');
10471047
}
1048-
if(options && 'expansionMap' in options) {
1048+
if(options?.expansionMap !== undefined) {
10491049
throw new JsonLdError(
10501050
'"expansionMap" not supported.',
10511051
'jsonld.OptionsError');

0 commit comments

Comments
 (0)