Skip to content

Commit 6dcc3b3

Browse files
Merge pull request JavaScriptSolidServer#60 from melvincarvalho/fix/support-top-level-arrays
fix: support top-level JSON-LD arrays in ACL parser
2 parents 854a71c + c7c4e03 commit 6dcc3b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wac/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export async function parseAcl(content, aclUrl) {
5555
const authorizations = [];
5656

5757
// Handle @graph array or single object
58-
const nodes = doc['@graph'] || [doc];
58+
const nodes = Array.isArray(doc) ? doc : (doc['@graph'] || [doc]);
5959

6060
for (const node of nodes) {
6161
if (isAuthorization(node)) {

0 commit comments

Comments
 (0)