From: Jérôme Benoit Date: Mon, 1 Jan 2024 14:14:25 +0000 (+0100) Subject: build: fix mnemonist bundling as external X-Git-Tag: v1.2.32~78 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a7d26b50a4e78fdad0da2f02c32b889fd82c94f0;p=e-mobility-charging-stations-simulator.git build: fix mnemonist bundling as external Signed-off-by: Jérôme Benoit --- diff --git a/bundle.js b/bundle.js index 27c9b953..5543d9cb 100644 --- a/bundle.js +++ b/bundle.js @@ -25,8 +25,7 @@ import { copy } from 'esbuild-plugin-copy' 'http-status-codes', 'just-merge', 'logform', - 'mnemonist', - 'mnemonist/*', + // 'mnemonist', 'mongodb', 'node:*', 'poolifier', diff --git a/src/utils/AsyncLock.ts b/src/utils/AsyncLock.ts index d1141972..b58e3a77 100644 --- a/src/utils/AsyncLock.ts +++ b/src/utils/AsyncLock.ts @@ -1,6 +1,6 @@ // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved. -import Queue from 'mnemonist/queue.js' +import { Queue } from 'mnemonist' import { Constants } from './Constants.js' @@ -18,7 +18,6 @@ export class AsyncLock { private constructor () { this.acquired = false - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment this.resolveQueue = new Queue() } @@ -37,22 +36,19 @@ export class AsyncLock { return } await new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access asyncLock.resolveQueue.enqueue(resolve) }) } private static async release (type: AsyncLockType): Promise { const asyncLock = AsyncLock.getAsyncLock(type) - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (asyncLock.resolveQueue.size === 0 && asyncLock.acquired) { asyncLock.acquired = false return } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const queuedResolve = asyncLock.resolveQueue.dequeue()! await new Promise((resolve) => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-call queuedResolve() resolve() })