build: fix import error
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 1 Jan 2024 14:09:07 +0000 (15:09 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 1 Jan 2024 14:09:07 +0000 (15:09 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
bundle.js
src/utils/AsyncLock.ts

index 9821a48d6377a8266eb71250f07039343ebedf9c..27c9b953fbafb348f9faafc136604f4b01c5cfbf 100644 (file)
--- a/bundle.js
+++ b/bundle.js
@@ -26,6 +26,7 @@ import { copy } from 'esbuild-plugin-copy'
       'just-merge',
       'logform',
       'mnemonist',
+      'mnemonist/*',
       'mongodb',
       'node:*',
       'poolifier',
index b58e3a77eb780a8e4836f7150658ad8268dd6233..d11419723c010fef52739b53f4ce86009103cb08 100644 (file)
@@ -1,6 +1,6 @@
 // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
 
-import { Queue } from 'mnemonist'
+import Queue from 'mnemonist/queue.js'
 
 import { Constants } from './Constants.js'
 
@@ -18,6 +18,7 @@ export class AsyncLock {
 
   private constructor () {
     this.acquired = false
+    // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
     this.resolveQueue = new Queue<ResolveType>()
   }
 
@@ -36,19 +37,22 @@ export class AsyncLock {
       return
     }
     await new Promise<void>((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<void> {
     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
+    // 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
     const queuedResolve = asyncLock.resolveQueue.dequeue()!
     await new Promise<void>((resolve) => {
+      // eslint-disable-next-line @typescript-eslint/no-unsafe-call
       queuedResolve()
       resolve()
     })