Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/jsonld/jsonld-spec.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ContextDefinition, JsonLdDocument, NodeObject } from "./jsonld";

// Some aliases and placeholders for better readability
export type JsonLdObj = NodeObject;
export type JsonLdArray = [JsonLdObj];
export type JsonLdArray = JsonLdObj[];
export type JsonLd = JsonLdObj | JsonLdArray;

type DOMString = string;
Expand Down
6 changes: 6 additions & 0 deletions types/jsonld/jsonld-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,15 @@ jsonld.compact(doc, context, { graph: false })
* expand() test
*/
jsonld.expand(doc, (err, res) => {
res
log(res);
});

jsonld.expand(doc, (err, res) => {
const result = res.filter(item => item)
log(result);
});

jsonld.expand(doc, { keepFreeFloatingNodes: false }, (err, res) => {
log(res);
});
Expand Down