Skip to content

Commit

Permalink
Merge branch 'sritchie/last_warnings' into 'master'
Browse files Browse the repository at this point in the history
Fix last eslint warnings

See merge request unconed/mathbox!14
  • Loading branch information
Sam Ritchie committed Feb 17, 2022
2 parents d97df0c + 6a8ead7 commit 0c13279
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
17 changes: 9 additions & 8 deletions build/mathbox-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -46205,9 +46205,9 @@ const formatPrimes = [
];

const prettyNumber = function (options) {
let cache, compact, e, pi, precision, tau, threshold;
let cache, compact, e, pi, tau;
if (options) {
({ cache, compact, tau, pi, e, threshold, precision } = options);
({ cache, compact, tau, pi, e } = options);
}

compact = +!!(compact != null ? compact : true);
Expand Down Expand Up @@ -46454,7 +46454,8 @@ const prettyFormat = function (str) {

str = escapeHTML(str);

for (let arg of Array.from(args)) {
// eslint-disable-next-line no-unused-vars
for (let _arg of Array.from(args)) {
str = str.replace(/%([a-z])/, function (_, f) {
const v = args.shift();
switch (f) {
Expand Down Expand Up @@ -68062,7 +68063,7 @@ class TextAtlas extends Atlas {
}

draw(text) {
let data, i, imageData, j;
let data, i, j;
let w = this.width;
const h = this.lineHeight;
const o = this.outline;
Expand All @@ -68086,7 +68087,7 @@ class TextAtlas extends Atlas {
// Alpha sprite (fast)
let asc, end;
ctx.fillText(text, x, y);
({ data } = imageData = ctx.getImageData(0, 0, w, h));
({ data } = ctx.getImageData(0, 0, w, h));
j = 3; // Skip to alpha channel
for (
i = 0, end = data.length / 4, asc = 0 <= end;
Expand Down Expand Up @@ -68124,7 +68125,7 @@ class TextAtlas extends Atlas {
ctx.fillText(text, x, y);

// Pull image data
({ data } = imageData = ctx.getImageData(0, 0, w, h));
({ data } = ctx.getImageData(0, 0, w, h));
j = 0;
const { gamma } = this;

Expand Down Expand Up @@ -72880,7 +72881,7 @@ class Animation {
invalid = true;
return null;
});
if (value !== undefined) {
if (value !== undefined && !invalid) {
target = value;
}

Expand Down Expand Up @@ -73655,7 +73656,7 @@ Context.initClass();



const version = "2.0.0";
const version = "2.1.0";

// Just because
const π = Math.PI;
Expand Down
2 changes: 1 addition & 1 deletion build/mathbox-bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/mathbox.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/mathbox.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/render/buffer/textatlas.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class TextAtlas extends Atlas {
}

draw(text) {
let data, i, imageData, j;
let data, i, j;
let w = this.width;
const h = this.lineHeight;
const o = this.outline;
Expand All @@ -188,7 +188,7 @@ export class TextAtlas extends Atlas {
// Alpha sprite (fast)
let asc, end;
ctx.fillText(text, x, y);
({ data } = imageData = ctx.getImageData(0, 0, w, h));
({ data } = ctx.getImageData(0, 0, w, h));
j = 3; // Skip to alpha channel
for (
i = 0, end = data.length / 4, asc = 0 <= end;
Expand Down Expand Up @@ -226,7 +226,7 @@ export class TextAtlas extends Atlas {
ctx.fillText(text, x, y);

// Pull image data
({ data } = imageData = ctx.getImageData(0, 0, w, h));
({ data } = ctx.getImageData(0, 0, w, h));
j = 0;
const { gamma } = this;

Expand Down
2 changes: 1 addition & 1 deletion src/stage/animator.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class Animation {
invalid = true;
return null;
});
if (value !== undefined) {
if (value !== undefined && !invalid) {
target = value;
}

Expand Down
7 changes: 4 additions & 3 deletions src/util/pretty.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ const formatPrimes = [
];

const prettyNumber = function (options) {
let cache, compact, e, pi, precision, tau, threshold;
let cache, compact, e, pi, tau;
if (options) {
({ cache, compact, tau, pi, e, threshold, precision } = options);
({ cache, compact, tau, pi, e } = options);
}

compact = +!!(compact != null ? compact : true);
Expand Down Expand Up @@ -315,7 +315,8 @@ const prettyFormat = function (str) {

str = escapeHTML(str);

for (let arg of Array.from(args)) {
// eslint-disable-next-line no-unused-vars
for (let _arg of Array.from(args)) {
str = str.replace(/%([a-z])/, function (_, f) {
const v = args.shift();
switch (f) {
Expand Down

0 comments on commit 0c13279

Please sign in to comment.