Skip to content

Commit

Permalink
no nested ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed Aug 21, 2022
1 parent 6a733f2 commit 5d843a4
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/util/misc/svgParsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,16 @@ type TPreserveArParsed = {
// align can be either none or undefined or a combination of mid/max
const parseAlign = (align: string): MinMidMax[] => {
//divide align in alignX and alignY
if (align) {
if (align !== MinMidMax.none) {
return [
align.slice(1, 4) as MinMidMax,
align.slice(5, 8) as MinMidMax,
];
}
return [MinMidMax.none, MinMidMax.none];
} else {
return [MinMidMax.mid, MinMidMax.mid]
if (align !== MinMidMax.none) {
return [
align.slice(1, 4) as MinMidMax,
align.slice(5, 8) as MinMidMax,
];
}
else if (align === MinMidMax.none) {
return [align, align];
}
return [MinMidMax.mid, MinMidMax.mid];
};

/**
Expand Down

0 comments on commit 5d843a4

Please sign in to comment.