From a76db553075af58d79bc908ef487d9403daa1ab7 Mon Sep 17 00:00:00 2001 From: yatsuna827 Date: Wed, 24 Jan 2024 02:04:35 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20uuid=E3=83=A2=E3=82=B8=E3=83=A5?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=81=AE=E4=BB=A3=E3=82=8F=E3=82=8A=E3=81=AB?= =?UTF-8?q?crypto.randomUUID=E3=82=92=E4=BD=BF=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - src/frontend/lib/memory.ts | 5 ++--- src/frontend/pages/SimpleTimer.vue | 3 +-- yarn.lock | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 4fb2852..f38cb93 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "muse-ui": "^2.1.0", "tslib": "^1.8.1", "typescript": "^4.0.2", - "uuid": "^8.3.0", "vue": "^2.6.12", "vue-router": "^2.7.0", "vue-snotify": "^3.0.4", diff --git a/src/frontend/lib/memory.ts b/src/frontend/lib/memory.ts index 9964ad3..2dfee88 100644 --- a/src/frontend/lib/memory.ts +++ b/src/frontend/lib/memory.ts @@ -1,5 +1,4 @@ import * as Bowser from 'bowser' -import { v4 as uuidv4 } from 'uuid' export const INITIAL_CONFIG = { duration: 10 * 1000, @@ -71,7 +70,7 @@ class AppStateManager { configInUse: { ...INITIAL_CONFIG }, state: { ...INTIAL_STATE }, count: INITIAL_COUNT, - countdownId: uuidv4(), + countdownId: crypto.randomUUID(), } } @@ -100,7 +99,7 @@ class AppStateManager { } export const appStateManager = new AppStateManager() -const CONTEXT_ID = uuidv4() +const CONTEXT_ID = crypto.randomUUID() class MemoryMeasurementScheduler { appStateManager: AppStateManager; diff --git a/src/frontend/pages/SimpleTimer.vue b/src/frontend/pages/SimpleTimer.vue index 048b564..78c4abf 100644 --- a/src/frontend/pages/SimpleTimer.vue +++ b/src/frontend/pages/SimpleTimer.vue @@ -42,7 +42,6 @@ import ModeView from '../components/ModeView.vue' import SoundEffector from '../lib/sound-effector' import 'vue-snotify' import { INITIAL_CONFIG, INTIAL_STATE, appStateManager } from '../lib/memory' -import { v4 as uuidv4 } from 'uuid' const genListener = (fn: () => void) => (e: KeyboardEvent) => { if (e.key === ' ') { // スペースが入力された場合 @@ -119,7 +118,7 @@ export default Vue.extend({ this.state.counting = true this.state.loop = 0 this.initForTimer0() - appStateManager.updateState({ countdownId: uuidv4() }) + appStateManager.updateState({ countdownId: crypto.randomUUID() }) }, stop (): void { this.state.counting = false diff --git a/yarn.lock b/yarn.lock index 0651dba..3746094 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8890,7 +8890,7 @@ utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" -uuid@^8.0.0, uuid@^8.3.0: +uuid@^8.0.0: version "8.3.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.0.tgz#ab738085ca22dc9a8c92725e459b1d507df5d6ea" integrity sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==