From 728b7bbdfbaf327a620aae50beb974b15a0a33d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 27 Aug 2023 21:50:56 +0200 Subject: [PATCH] refactor: remove unused code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils.ts | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 54d0d8d6..38e15eb6 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -265,30 +265,6 @@ export const updateMeasurementStatistics = ( } } -/** - * Executes a function once at a time. - * - * @param fn - The function to execute. - * @param context - The context to bind the function to. - * @returns The function to execute. - */ -export const once = ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - fn: (...args: any[]) => void, - context: unknown - // eslint-disable-next-line @typescript-eslint/no-explicit-any -): ((...args: any[]) => void) => { - let called = false - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function (...args: any[]): void { - if (!called) { - called = true - fn.apply(context, args) - called = false - } - } -} - /** * Generate a cryptographically secure random number in the [0,1[ range * -- 2.34.1