Skip to content

Commit

Permalink
fix: minor linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tplooker authored and davidlehn committed Jun 16, 2021
1 parent 3222641 commit 20e2286
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions lib/expand.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ async function _expandObject({
const isJsonType = element[typeKey] &&
_expandIri(activeCtx,
(_isArray(element[typeKey]) ? element[typeKey][0] : element[typeKey]),
{vocab: true}, { ...options, typeExpansion: true }) === '@json';
{vocab: true}, {...options, typeExpansion: true}) === '@json';

for(const key of keys) {
let value = element[key];
Expand Down Expand Up @@ -527,7 +527,8 @@ async function _expandObject({
value = Object.fromEntries(Object.entries(value).map(([k, v]) => [
_expandIri(typeScopedContext, k, {vocab: true}),
_asArray(v).map(vv =>
_expandIri(typeScopedContext, vv, {base: true, vocab: true}, { ...options, typeExpansion: true })
_expandIri(typeScopedContext, vv, {base: true, vocab: true},
{...options, typeExpansion: true})
)
]));
}
Expand All @@ -537,7 +538,8 @@ async function _expandObject({
_asArray(value).map(v =>
_isString(v) ?
_expandIri(typeScopedContext, v,
{base: true, vocab: true}, { ...options, typeExpansion: true }) : v),
{base: true, vocab: true},
{...options, typeExpansion: true}) : v),
{propertyIsArray: options.isFrame});
continue;
}
Expand Down Expand Up @@ -937,7 +939,8 @@ function _expandValue({activeCtx, activeProperty, value, options}) {
if(expandedProperty === '@id') {
return _expandIri(activeCtx, value, {base: true}, options);
} else if(expandedProperty === '@type') {
return _expandIri(activeCtx, value, {vocab: true, base: true}, { ...options, typeExpansion: true });
return _expandIri(activeCtx, value, {vocab: true, base: true},
{...options, typeExpansion: true});
}

// get type definition from context
Expand Down
3 changes: 2 additions & 1 deletion tests/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,8 @@ describe('expansionMap', () => {
assert.equal(expansionMapCalled, true);
});

it('should be called on relative iri for type term in scoped context', async () => {
it('should be called on relative iri for type\
term in scoped context', async () => {
const docWithRelativeIriId = {
'@context': {
'definedType': {
Expand Down

0 comments on commit 20e2286

Please sign in to comment.