Skip to content

Commit ba478eb

Browse files
davidlehndlongley
andcommitted
Fix brace style.
Co-Authored-By: Dave Longley <dlongley@digitalbazaar.com>
1 parent a5d4fb3 commit ba478eb

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

lib/frame.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,15 @@ api.frame = (state, subjects, frame, parent, property = null) => {
146146
// `@link` as the above check will short-circuit before reaching this point
147147
if(state.embedded &&
148148
(flags.embed === '@never' ||
149-
_createsCircularReference(subject, state.graph, state.subjectStack)))
150-
{
149+
_createsCircularReference(subject, state.graph, state.subjectStack))) {
151150
_addFrameOutput(parent, property, output);
152151
continue;
153152
}
154153

155154
// if only the first (or once) should be embedded
156155
if(state.embedded &&
157156
(flags.embed == '@first' || flags.embed == '@once') &&
158-
state.uniqueEmbeds[state.graph].hasOwnProperty(id))
159-
{
157+
state.uniqueEmbeds[state.graph].hasOwnProperty(id)) {
160158
_addFrameOutput(parent, property, output);
161159
continue;
162160
}
@@ -273,8 +271,7 @@ api.frame = (state, subjects, frame, parent, property = null) => {
273271
// skip keywords
274272
if(prop === '@type') {
275273
if(!types.isObject(frame[prop][0]) ||
276-
!frame[prop][0].hasOwnProperty('@default'))
277-
{
274+
!frame[prop][0].hasOwnProperty('@default')) {
278275
continue;
279276
}
280277
// allow through default types
@@ -433,8 +430,7 @@ function _getFrameFlag(frame, options, name) {
433430
} else if(rval === false) {
434431
rval = '@never';
435432
} else if(rval !== '@always' && rval !== '@never' && rval !== '@link' &&
436-
rval !== '@first' && rval !== '@last' && rval !== '@once')
437-
{
433+
rval !== '@first' && rval !== '@last' && rval !== '@once') {
438434
throw new JsonLdError(
439435
'Invalid JSON-LD syntax; invalid value of @embed.',
440436
'jsonld.SyntaxError', {code: 'invalid @embed value', frame});
@@ -459,8 +455,7 @@ function _validateFrame(frame) {
459455
for(const id of util.asArray(frame[0]['@id'])) {
460456
// @id must be wildcard or an IRI
461457
if(!(types.isObject(id) || url.isAbsolute(id)) ||
462-
(types.isString(id) && id.indexOf('_:') === 0))
463-
{
458+
(types.isString(id) && id.indexOf('_:') === 0)) {
464459
throw new JsonLdError(
465460
'Invalid JSON-LD syntax; invalid @id in frame.',
466461
'jsonld.SyntaxError', {code: 'invalid frame', frame});
@@ -472,8 +467,7 @@ function _validateFrame(frame) {
472467
for(const type of util.asArray(frame[0]['@type'])) {
473468
// @id must be wildcard or an IRI
474469
if(!(types.isObject(type) || url.isAbsolute(type)) ||
475-
(types.isString(type) && type.indexOf('_:') === 0))
476-
{
470+
(types.isString(type) && type.indexOf('_:') === 0)) {
477471
throw new JsonLdError(
478472
'Invalid JSON-LD syntax; invalid @type in frame.',
479473
'jsonld.SyntaxError', {code: 'invalid frame', frame});
@@ -611,8 +605,7 @@ function _filterSubject(state, subject, frame, flags) {
611605
// match on any matching value
612606
matchThis = nodeValues.some(nv => _valueMatch(thisFrame, nv));
613607
} else if(graphTypes.isSubject(thisFrame) ||
614-
graphTypes.isSubjectReference(thisFrame))
615-
{
608+
graphTypes.isSubjectReference(thisFrame)) {
616609
matchThis =
617610
nodeValues.some(nv => _nodeMatch(state, thisFrame, nv, flags));
618611
} else if(graphTypes.isList(thisFrame)) {

lib/util.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ api.validateTypeValue = (v, isFrame) => {
162162
case 1:
163163
// default entry is all strings
164164
if('@default' in v &&
165-
api.asArray(v['@default']).every(vv => types.isString(vv)))
166-
{
165+
api.asArray(v['@default']).every(vv => types.isString(vv))) {
167166
return;
168167
}
169168
}

0 commit comments

Comments
 (0)