diff --git a/lib/jsonld.js b/lib/jsonld.js index ae8ad2eb..bf29442c 100644 --- a/lib/jsonld.js +++ b/lib/jsonld.js @@ -1045,10 +1045,15 @@ if(_nodejs) { jsonld.useDocumentLoader('xhr'); } -function _setDefaults(options, { - documentLoader = jsonld.documentLoader, - ...defaults -}) { +function _setDefaults(options, additionalOptions) { + const documentLoader = additionalOptions.documentLoader || jsonld.documentLoader + const defaults = {} + for (const key in additionalOptions) { + if (key !== 'documentLoader') { + defaults[key] = additionalOptions[key] + } + } + if(typeof options === 'function') { options = {}; }