Skip to content

Commit c52e183

Browse files
committed
ld: allow the list of objects as '@graph': [...]
1 parent 360004a commit c52e183

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,11 @@ export function parseLDSource(ld, decode, uri) {
428428
}
429429

430430
if (!(ld instanceof Array)) {
431-
ld = [ld];
431+
if (!ld['@type'] && ld['@graph'] && Array.isArray(ld['@graph'])) {
432+
ld = ld['@graph'];
433+
} else {
434+
ld = [ld];
435+
}
432436
}
433437

434438
const addObject = function(obj) {

0 commit comments

Comments
 (0)