lint(curly): consistent use of curly brackets in codebase (#3584)

This commit is contained in:
Alireza authored and GitHub committed 2023-08-09 10:07:33 -04:00
1 parent 9ae3d9f769
commit 5d435424e2
113 files changed
+1501 -1056

No files matched your search

@@ -1 +1,4 @@
export default (study, extraData) => Math.max(...(extraData?.displaySets?.map?.(ds => (ds.numImageFrames ?? 0))) || [0]);
export default (study, extraData) =>
Math.max(
...(extraData?.displaySets?.map?.(ds => ds.numImageFrames ?? 0) || [0])
);
@@ -1 +1 @@
export default (study, extraData) => extraData?.displaySets?.length;
export default (study, extraData) => extraData?.displaySets?.length;
@@ -4,30 +4,37 @@
* From 'this', it uses:
* `sameAttribute` as the attribute name to look for
* `sameDisplaySetId` as the display set id to look for
* From `options`, it looks for
* From `options`, it looks for
*/
export default function (displaySet, options) {
export default function(displaySet, options) {
const { sameAttribute, sameDisplaySetId } = this;
if( !sameAttribute ) {
console.log("sameAttribute not defined in", this);
if (!sameAttribute) {
console.log('sameAttribute not defined in', this);
return `sameAttribute not defined in ${this.id}`;
}
if( !sameDisplaySetId ) {
console.log("sameDisplaySetId not defined in", this);
if (!sameDisplaySetId) {
console.log('sameDisplaySetId not defined in', this);
return `sameDisplaySetId not defined in ${this.id}`;
}
const { displaySetMatchDetails, displaySets } = options;
const match = displaySetMatchDetails.get(sameDisplaySetId);
if( !match ) {
console.log("No match for display set", sameDisplaySetId);
if (!match) {
console.log('No match for display set', sameDisplaySetId);
return false;
}
const { displaySetInstanceUID } = match;
const altDisplaySet = displaySets.find(it => it.displaySetInstanceUID==displaySetInstanceUID);
if( !altDisplaySet ) {
console.log("No display set found with", displaySetInstanceUID, "in", displaySets);
const altDisplaySet = displaySets.find(
it => it.displaySetInstanceUID == displaySetInstanceUID
);
if (!altDisplaySet) {
console.log(
'No display set found with',
displaySetInstanceUID,
'in',
displaySets
);
return false;
}
const testValue = altDisplaySet[sameAttribute];
return testValue===displaySet[sameAttribute];
}
return testValue === displaySet[sameAttribute];
}