Comparing version 8.2.0 to 8.2.1
@@ -711,3 +711,3 @@ /* | ||
!mapping._termHasColon && | ||
id.match(/[:\/\?#\[\]@]$/)); | ||
id.match(/[:\/\?#\[\]@]$/) !== null); | ||
} | ||
@@ -714,0 +714,0 @@ } |
@@ -389,2 +389,8 @@ /* | ||
* Drop empty object, top-level @value/@list, or object with only @id | ||
* | ||
* @param value Value to check. | ||
* @param count Number of properties in object. | ||
* @param options The expansion options. | ||
* | ||
* @return null if dropped, value otherwise. | ||
*/ | ||
@@ -952,11 +958,13 @@ function _dropUnsafeObject({ | ||
!container.some(key => key === '@id' || key === '@index')) { | ||
// ensure expanded values are arrays | ||
// ensure an array | ||
// ensure expanded values are in an array | ||
expandedValue = _asArray(expandedValue); | ||
// check if needs to be dropped | ||
const count = Object.keys(expandedValue[0]).length; | ||
if(!options.isFrame && _dropUnsafeObject({ | ||
value: expandedValue[0], count, options | ||
}) === null) { | ||
// skip adding and continue | ||
if(!options.isFrame) { | ||
// drop items if needed | ||
expandedValue = expandedValue.filter(v => { | ||
const count = Object.keys(v).length; | ||
return _dropUnsafeObject({value: v, count, options}) !== null; | ||
}); | ||
} | ||
if(expandedValue.length === 0) { | ||
// all items dropped, skip adding and continue | ||
continue; | ||
@@ -963,0 +971,0 @@ } |
@@ -31,3 +31,3 @@ /* | ||
/* eslint-disable-next-line max-len */ | ||
regex: /^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/ | ||
regex: /^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/ | ||
} | ||
@@ -34,0 +34,0 @@ }; |
{ | ||
"name": "jsonld", | ||
"version": "8.2.0", | ||
"version": "8.2.1", | ||
"description": "A JSON-LD Processor and API implementation in JavaScript.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/digitalbazaar/jsonld.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
21479
2805537