From 64a9892ee20e3440e42dbb1028cacdca004c07f7 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 17 Nov 2021 19:44:19 +0530 Subject: [PATCH] Use generic T in LockMap --- src/utils/LockMap.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/LockMap.ts b/src/utils/LockMap.ts index 5952f031..4c7cba13 100644 --- a/src/utils/LockMap.ts +++ b/src/utils/LockMap.ts @@ -16,10 +16,10 @@ limitations under the License. import {Lock} from "./Lock"; -export class LockMap { - private readonly _map: Map = new Map(); +export class LockMap { + private readonly _map: Map = new Map(); - async takeLock(key: unknown): Promise { + async takeLock(key: T): Promise { let lock = this._map.get(key); if (lock) { await lock.take();