Skip to content

Commit

Permalink
Fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienkohlbecker committed Jul 31, 2023
1 parent fee3afb commit a049bc3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
66 changes: 33 additions & 33 deletions lib/render-marks.js
Expand Up @@ -30,46 +30,46 @@ function ticktock (cxt, ref1, ref2, x, dx, y, len) {
if (typeof val === 'string') {
val = val.trim().split(/\s+/);
} else
if (typeof val === 'number' || typeof val === 'boolean') {
offset = Number(val);
val = [];
for (let i = 0; i < len; i += 1) {
val.push(i + offset);
if (typeof val === 'number' || typeof val === 'boolean') {
offset = Number(val);
val = [];
for (let i = 0; i < len; i += 1) {
val.push(i + offset);
}
}
}
if (Array.isArray(val)) {
if (val.length === 0) {
return [];
} else
if (val.length === 1) {
offset = Number(val[0]);
if (isNaN(offset)) {
L = val;
} else {
for (let i = 0; i < len; i += 1) {
L[i] = i + offset;
if (val.length === 1) {
offset = Number(val[0]);
if (isNaN(offset)) {
L = val;
} else {
for (let i = 0; i < len; i += 1) {
L[i] = i + offset;
}
}
}
} else
if (val.length === 2) {
offset = Number(val[0]);
const step = Number(val[1]);
const tmp = val[1].split('.');
let dp = 0;
if (tmp.length === 2) {
dp = tmp[1].length;
}
if (isNaN(offset) || isNaN(step)) {
L = val;
} else {
offset = step * offset;
for (let i = 0; i < len; i += 1) {
L[i] = (step * i + offset).toFixed(dp);
} else
if (val.length === 2) {
offset = Number(val[0]);
const step = Number(val[1]);
const tmp = val[1].split('.');
let dp = 0;
if (tmp.length === 2) {
dp = tmp[1].length;
}
if (isNaN(offset) || isNaN(step)) {
L = val;
} else {
offset = step * offset;
for (let i = 0; i < len; i += 1) {
L[i] = (step * i + offset).toFixed(dp);
}
}
} else {
L = val;
}
}
} else {
L = val;
}
} else {
return [];
}
Expand Down
8 changes: 4 additions & 4 deletions lib/render-over-under.js
Expand Up @@ -52,10 +52,10 @@ function renderOverUnder (el, key, lane) {
if (dot === '0') {
start = undefined;
} else
if (dot !== '.') {
start = i;
color = colors[dot] || colors[1];
}
if (dot !== '.') {
start = i;
color = colors[dot] || colors[1];
}
});
if (start !== undefined) {
res = res.concat(line(arr.length));
Expand Down

0 comments on commit a049bc3

Please sign in to comment.