From 8b5a094eb51520b3b4953db2a293b19b04c33932 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Sun, 3 Sep 2023 16:57:36 +0900 Subject: [PATCH] feat(exponential-volume): fix type of WeakMap Co-authored-by: Su-Yong --- plugins/exponential-volume/front.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/exponential-volume/front.ts b/plugins/exponential-volume/front.ts index 3a185cdb..931acb09 100644 --- a/plugins/exponential-volume/front.ts +++ b/plugins/exponential-volume/front.ts @@ -7,14 +7,13 @@ const exponentialVolume = () => { // 0.05 (or 5%) is the lowest you can select in the UI which with an exponent of 3 becomes 0.000125 or 0.0125% const EXPONENT = 3; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const storedOriginalVolumes = new WeakMap(); + const storedOriginalVolumes = new WeakMap(); const propertyDescriptor = Object.getOwnPropertyDescriptor( HTMLMediaElement.prototype, 'volume', ); Object.defineProperty(HTMLMediaElement.prototype, 'volume', { - get() { + get(this: HTMLMediaElement) { const lowVolume = propertyDescriptor?.get?.call(this) as number ?? 0; const calculatedOriginalVolume = lowVolume ** (1 / EXPONENT);