From: Jérôme Benoit Date: Sun, 27 Aug 2023 19:50:56 +0000 (+0200) Subject: refactor: remove unused code X-Git-Tag: v2.6.37~25 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=728b7bbdfbaf327a620aae50beb974b15a0a33d2;p=poolifier.git refactor: remove unused code Signed-off-by: Jérôme Benoit --- 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 *