Skip to content

Commit

Permalink
Add --context to expand.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBlueHat committed Mar 27, 2024
1 parent fe56c51 commit aa81337
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/jsonld.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,14 @@ _jsonLdCommand(program.command('compact [filename|URL]'))

_jsonLdCommand(program.command('expand [filename|URL|-]'))
.description('expand JSON-LD')
.option('-c, --context <filename|URL>', 'context filename or URL')
.option(' --keep-free-floating-nodes', 'keep free-floating nodes')
.action(async function expand(input, cmd) {
input = input || '-';
const options = _jsonLdOptions(cmd, input);
if(cmd.context) {
options.expandContext = cmd.context;
}
options.keepFreeFloatingNodes = cmd.keepFreeFloatingNodes;

const result = await jsonld.expand(input, options);
Expand Down

0 comments on commit aa81337

Please sign in to comment.