From 2cfade71286840ec496276bbba1a00f3b9b19244 Mon Sep 17 00:00:00 2001 From: TheBlindHawk Date: Thu, 11 Apr 2024 19:51:09 +0900 Subject: [PATCH] formattign --- dprint.json | 2 ++ src/index.ts | 22 ++++++++++++++++------ tests/async-roll.test.js | 4 +++- vitest.config.ts | 2 +- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/dprint.json b/dprint.json index ac2a930..85f0b52 100644 --- a/dprint.json +++ b/dprint.json @@ -7,6 +7,8 @@ "markdown": { }, "excludes": [ + "**/coverage", + "**/dist", "**/node_modules", "**/*-lock.json", "**/.expo", diff --git a/src/index.ts b/src/index.ts index 732be78..4d90882 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,13 +35,21 @@ export default class Roulette { // getters - get isRolling() { return this._isRolling } + get isRolling() { + return this._isRolling + } - get degrees() { return this._degrees } + get degrees() { + return this._degrees + } - get history() { return this._history } + get history() { + return this._history + } - get sections() { return this._sections.get() } + get sections() { + return this._sections.get() + } // setters @@ -108,7 +116,8 @@ export default class Roulette { const sections = this._sections.length const point = (360 * index) / this._sections.length + 360 / this._sections.length / 2 - this.arrow.shift const loosen = this.settings.roll.landing === 'random' - ? Math.round((Math.random() * 320) / sections - 320 / sections / 2) : 0 + ? Math.round((Math.random() * 320) / sections - 320 / sections / 2) + : 0 const sprint = Math.floor(this.settings.roll.duration / 360 / 3) * 360 + point + loosen const audio_distance = 360 / this._sections.length @@ -161,7 +170,8 @@ export default class Roulette { const defaultIncrease = 12 const sections = this._sections.length const loosen = this.settings.roll.landing === 'random' - ? Math.round((Math.random() * 320) / sections - 320 / sections / 2) : 0 + ? Math.round((Math.random() * 320) / sections - 320 / sections / 2) + : 0 let sprint = Math.floor(this.settings.roll.duration / 360 / 3) * 360 + loosen const audio_distance = 360 / this._sections.length diff --git a/tests/async-roll.test.js b/tests/async-roll.test.js index 4692566..b8c2085 100644 --- a/tests/async-roll.test.js +++ b/tests/async-roll.test.js @@ -9,7 +9,9 @@ vi.spyOn(window.HTMLMediaElement.prototype, 'play').mockImplementation(() => {}) document.body.innerHTML = `
` Promise.withResolvers = () => { let resolve, reject - const promise = new Promise((res, rej) => { resolve = res, reject = rej }) + const promise = new Promise((res, rej) => { + resolve = res, reject = rej + }) return { promise, resolve, reject } } diff --git a/vitest.config.ts b/vitest.config.ts index 2490375..7713e88 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -8,6 +8,6 @@ export default defineConfig({ coverage: { include: ['src/index.ts', 'src/builders'], }, - reporters: ['verbose'] + reporters: ['verbose'], }, })