Add linting
This commit is contained in:
parent
76282a4cf7
commit
40a660b7cb
49 changed files with 237 additions and 334 deletions
|
|
@ -12,37 +12,37 @@ declare global {
|
|||
|
||||
export const applyArrayPlugins = () => {
|
||||
Object.defineProperty(Array.prototype, 'x', {
|
||||
get: function () {
|
||||
get() {
|
||||
return this[0];
|
||||
},
|
||||
set: function (value) {
|
||||
set(value) {
|
||||
this[0] = value;
|
||||
},
|
||||
});
|
||||
|
||||
Object.defineProperty(Array.prototype, 'y', {
|
||||
get: function () {
|
||||
get() {
|
||||
return this[1];
|
||||
},
|
||||
set: function (value) {
|
||||
set(value) {
|
||||
this[1] = value;
|
||||
},
|
||||
});
|
||||
|
||||
Object.defineProperty(Float32Array.prototype, 'x', {
|
||||
get: function () {
|
||||
get() {
|
||||
return this[0];
|
||||
},
|
||||
set: function (value) {
|
||||
set(value) {
|
||||
this[0] = value;
|
||||
},
|
||||
});
|
||||
|
||||
Object.defineProperty(Float32Array.prototype, 'y', {
|
||||
get: function () {
|
||||
get() {
|
||||
return this[1];
|
||||
},
|
||||
set: function (value) {
|
||||
set(value) {
|
||||
this[1] = value;
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -36,9 +36,7 @@ export class Autoscaler {
|
|||
|
||||
const previousTarget = this.targets[floor];
|
||||
const nextTarget =
|
||||
floor + 1 == this.targets.length
|
||||
? previousTarget
|
||||
: this.targets[floor + 1];
|
||||
floor + 1 == this.targets.length ? previousTarget : this.targets[floor + 1];
|
||||
|
||||
this.setters.forEach((setter, i) =>
|
||||
setter(mix(previousTarget[i], nextTarget[i], fract))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
export const clamp = (value: number, min: number, max: number): number =>
|
||||
Math.min(max, Math.max(min, value));
|
||||
|
||||
export const clamp01 = (value: number): number =>
|
||||
Math.min(1, Math.max(0, value));
|
||||
export const clamp01 = (value: number): number => Math.min(1, Math.max(0, value));
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
export const getCombinations = (
|
||||
values: Array<Array<number>>
|
||||
): Array<Array<number>> => {
|
||||
export const getCombinations = (values: Array<Array<number>>): Array<Array<number>> => {
|
||||
if (!values.every((a) => a.length > 0)) {
|
||||
return [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
export const mix = (from: number, to: number, q: number) =>
|
||||
from + (to - from) * q;
|
||||
export const mix = (from: number, to: number, q: number) => from + (to - from) * q;
|
||||
|
|
|
|||
|
|
@ -18,9 +18,11 @@ export function timeIt(interval = 60) {
|
|||
if (i++ % interval == 0) {
|
||||
previousTimes = previousTimes.sort();
|
||||
|
||||
const text = `Max: ${last(previousTimes).toFixed(2)} ms\n\tMedian: ${previousTimes[
|
||||
Math.floor(previousTimes.length / 2)
|
||||
].toFixed(2)} ms`;
|
||||
const text = `Max: ${last(previousTimes).toFixed(
|
||||
2
|
||||
)} ms\n\tMedian: ${previousTimes[Math.floor(previousTimes.length / 2)].toFixed(
|
||||
2
|
||||
)} ms`;
|
||||
|
||||
InfoText.modifyRecord(propertyKey, text);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue