@sapphire/async-queue 1.3.2-next.fca7a80.0 โ†’ 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,35 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ # [@sapphire/async-queue@1.4.0](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.3.1...@sapphire/async-queue@1.4.0) - (2022-08-07)
6
+
7
+ ## ๐Ÿ› Bug Fixes
8
+
9
+ - **deps:** Update all non-major dependencies ([84af0db](https://github.com/sapphiredev/utilities/commit/84af0db2db749223b036aa99fe19a2e9af5681c6))
10
+ - **deps:** Update all non-major dependencies ([50cd8de](https://github.com/sapphiredev/utilities/commit/50cd8dea593b6f5ae75571209456b3421e2ca59a))
11
+
12
+ ## ๐Ÿ“ Documentation
13
+
14
+ - Add @muchnameless as a contributor ([a1221fe](https://github.com/sapphiredev/utilities/commit/a1221fea68506e99591d5d00ec552a07c26833f9))
15
+ - Add @enxg as a contributor ([d2382f0](https://github.com/sapphiredev/utilities/commit/d2382f04e3909cb4ad11798a0a10e683f6cf5383))
16
+ - Add @EvolutionX-10 as a contributor ([efc3a32](https://github.com/sapphiredev/utilities/commit/efc3a320a72ae258996dd62866d206c33f8d4961))
17
+ - Add @MajesticString as a contributor ([295b3e9](https://github.com/sapphiredev/utilities/commit/295b3e9849a4b0fe64074bae02f6426378a303c3))
18
+ - Add @Mzato0001 as a contributor ([c790ef2](https://github.com/sapphiredev/utilities/commit/c790ef25df2d7e22888fa9f8169167aa555e9e19))
19
+ - Add @NotKaskus as a contributor ([00da8f1](https://github.com/sapphiredev/utilities/commit/00da8f199137b9277119823f322d1f2d168d928a))
20
+ - Add @imranbarbhuiya as a contributor ([fb674c2](https://github.com/sapphiredev/utilities/commit/fb674c2c5594d41e71662263553dcb4bac9e37f4))
21
+ - Add @axisiscool as a contributor ([ce1aa31](https://github.com/sapphiredev/utilities/commit/ce1aa316871a88d3663efbdf2a42d3d8dfe6a27f))
22
+ - Add @dhruv-kaushikk as a contributor ([ebbf43f](https://github.com/sapphiredev/utilities/commit/ebbf43f63617daba96e72c50a234bf8b64f6ddc4))
23
+ - Add @Commandtechno as a contributor ([f1d69fa](https://github.com/sapphiredev/utilities/commit/f1d69fabe1ee0abe4be08b19e63dbec03102f7ce))
24
+ - Fix typedoc causing OOM crashes ([63ba41c](https://github.com/sapphiredev/utilities/commit/63ba41c4b6678554b1c7043a22d3296db4f59360))
25
+
26
+ ## ๐Ÿš€ Features
27
+
28
+ - **AsyncQueue:** Add AbortSignal support (#417) ([c0629e7](https://github.com/sapphiredev/utilities/commit/c0629e781ebc3f48e496a0851191b32e91f62fe9))
29
+
30
+ ## ๐Ÿงช Testing
31
+
32
+ - Migrate to vitest (#380) ([075ec73](https://github.com/sapphiredev/utilities/commit/075ec73c7a8e3374fad3ada612d37eb4ac36ec8d))
33
+
5
34
  ## [1.3.1](https://github.com/sapphiredev/utilities/compare/@sapphire/async-queue@1.3.0...@sapphire/async-queue@1.3.1) (2022-04-01)
6
35
 
7
36
  **Note:** Version bump only for package @sapphire/async-queue
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -30,6 +30,46 @@ var SapphireAsyncQueue = (() => {
30
30
  AsyncQueue: () => AsyncQueue
31
31
  });
32
32
 
33
+ // src/lib/AsyncQueueEntry.ts
34
+ var AsyncQueueEntry = class {
35
+ constructor(queue) {
36
+ __publicField(this, "promise");
37
+ __publicField(this, "resolve");
38
+ __publicField(this, "reject");
39
+ __publicField(this, "queue");
40
+ __publicField(this, "signal", null);
41
+ __publicField(this, "signalListener", null);
42
+ this.queue = queue;
43
+ this.promise = new Promise((resolve, reject) => {
44
+ this.resolve = resolve;
45
+ this.reject = reject;
46
+ });
47
+ }
48
+ setSignal(signal) {
49
+ if (signal.aborted)
50
+ return this;
51
+ this.signal = signal;
52
+ this.signalListener = () => {
53
+ const index = this.queue["promises"].indexOf(this);
54
+ if (index !== -1)
55
+ this.queue["promises"].splice(index, 1);
56
+ this.reject(new Error("Request aborted manually"));
57
+ };
58
+ this.signal.addEventListener("abort", this.signalListener);
59
+ return this;
60
+ }
61
+ use() {
62
+ if (this.signal) {
63
+ this.signal.removeEventListener("abort", this.signalListener);
64
+ this.signal = null;
65
+ this.signalListener = null;
66
+ }
67
+ this.resolve();
68
+ return this;
69
+ }
70
+ };
71
+ __name(AsyncQueueEntry, "AsyncQueueEntry");
72
+
33
73
  // src/lib/AsyncQueue.ts
34
74
  var AsyncQueue = class {
35
75
  constructor() {
@@ -38,22 +78,26 @@ var SapphireAsyncQueue = (() => {
38
78
  get remaining() {
39
79
  return this.promises.length;
40
80
  }
41
- wait() {
42
- const next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve();
43
- let resolve;
44
- const promise = new Promise((res) => {
45
- resolve = res;
46
- });
47
- this.promises.push({
48
- resolve,
49
- promise
50
- });
51
- return next;
81
+ wait(options) {
82
+ const entry = new AsyncQueueEntry(this);
83
+ if (this.promises.length === 0) {
84
+ this.promises.push(entry);
85
+ return Promise.resolve();
86
+ }
87
+ this.promises.push(entry);
88
+ if (options?.signal)
89
+ entry.setSignal(options.signal);
90
+ return entry.promise;
52
91
  }
53
92
  shift() {
54
- const deferred = this.promises.shift();
55
- if (typeof deferred !== "undefined")
56
- deferred.resolve();
93
+ if (this.promises.length === 0)
94
+ return;
95
+ if (this.promises.length === 1) {
96
+ this.promises.shift();
97
+ return;
98
+ }
99
+ this.promises.shift();
100
+ this.promises[0].use();
57
101
  }
58
102
  };
59
103
  __name(AsyncQueue, "AsyncQueue");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/lib/AsyncQueue.ts"],"sourcesContent":["export * from './lib/AsyncQueue';\n","/**\n * The AsyncQueue class used to sequentialize burst requests\n */\nexport class AsyncQueue {\n\t/**\n\t * The remaining amount of queued promises\n\t */\n\tpublic get remaining(): number {\n\t\treturn this.promises.length;\n\t}\n\n\t/**\n\t * The promises array\n\t */\n\tprivate promises: InternalAsyncQueueDeferredPromise[] = [];\n\n\t/**\n\t * Waits for last promise and queues a new one\n\t * @example\n\t * ```typescript\n\t * const queue = new AsyncQueue();\n\t * async function request(url, options) {\n\t * await queue.wait();\n\t * try {\n\t * const result = await fetch(url, options);\n\t * // Do some operations with 'result'\n\t * } finally {\n\t * // Remove first entry from the queue and resolve for the next entry\n\t * queue.shift();\n\t * }\n\t * }\n\t *\n\t * request(someUrl1, someOptions1); // Will call fetch() immediately\n\t * request(someUrl2, someOptions2); // Will call fetch() after the first finished\n\t * request(someUrl3, someOptions3); // Will call fetch() after the second finished\n\t * ```\n\t */\n\tpublic wait(): Promise<void> {\n\t\tconst next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve();\n\t\tlet resolve: () => void;\n\t\tconst promise = new Promise<void>((res) => {\n\t\t\tresolve = res;\n\t\t});\n\n\t\tthis.promises.push({\n\t\t\tresolve: resolve!,\n\t\t\tpromise\n\t\t});\n\n\t\treturn next;\n\t}\n\n\t/**\n\t * Frees the queue's lock for the next item to process\n\t */\n\tpublic shift(): void {\n\t\tconst deferred = this.promises.shift();\n\t\tif (typeof deferred !== 'undefined') deferred.resolve();\n\t}\n}\n\n/**\n * @internal\n */\ninterface InternalAsyncQueueDeferredPromise {\n\tresolve(): void;\n\tpromise: Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACGO,MAAM,aAAN,MAAiB;AAAA,IAAjB;AAWN,0BAAQ,YAAgD,CAAC;AAAA;AAAA,IAPzD,IAAW,YAAoB;AAC9B,aAAO,KAAK,SAAS;AAAA,IACtB;AAAA,IA4BA,AAAO,OAAsB;AAC5B,YAAM,OAAO,KAAK,SAAS,SAAS,KAAK,SAAS,KAAK,SAAS,SAAS,GAAG,UAAU,QAAQ,QAAQ;AACtG,UAAI;AACJ,YAAM,UAAU,IAAI,QAAc,CAAC,QAAQ;AAC1C,kBAAU;AAAA,MACX,CAAC;AAED,WAAK,SAAS,KAAK;AAAA,QAClB;AAAA,QACA;AAAA,MACD,CAAC;AAED,aAAO;AAAA,IACR;AAAA,IAKA,AAAO,QAAc;AACpB,YAAM,WAAW,KAAK,SAAS,MAAM;AACrC,UAAI,OAAO,aAAa;AAAa,iBAAS,QAAQ;AAAA,IACvD;AAAA,EACD;AAxDa;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/lib/AsyncQueueEntry.ts","../src/lib/AsyncQueue.ts"],"sourcesContent":["export * from './lib/AsyncQueue';\n","import type { AsyncQueue } from './AsyncQueue';\n\n/**\n * @internal\n */\nexport class AsyncQueueEntry {\n\tpublic readonly promise: Promise<void>;\n\tprivate resolve!: () => void;\n\tprivate reject!: (error: Error) => void;\n\tprivate readonly queue: AsyncQueue;\n\tprivate signal: PolyFillAbortSignal | null = null;\n\tprivate signalListener: (() => void) | null = null;\n\n\tpublic constructor(queue: AsyncQueue) {\n\t\tthis.queue = queue;\n\t\tthis.promise = new Promise((resolve, reject) => {\n\t\t\tthis.resolve = resolve;\n\t\t\tthis.reject = reject;\n\t\t});\n\t}\n\n\tpublic setSignal(signal: AbortSignal) {\n\t\tif (signal.aborted) return this;\n\n\t\tthis.signal = signal as PolyFillAbortSignal;\n\t\tthis.signalListener = () => {\n\t\t\tconst index = this.queue['promises'].indexOf(this);\n\t\t\tif (index !== -1) this.queue['promises'].splice(index, 1);\n\n\t\t\tthis.reject(new Error('Request aborted manually'));\n\t\t};\n\t\tthis.signal.addEventListener('abort', this.signalListener);\n\t\treturn this;\n\t}\n\n\tpublic use() {\n\t\tif (this.signal) {\n\t\t\tthis.signal.removeEventListener('abort', this.signalListener!);\n\t\t\tthis.signal = null;\n\t\t\tthis.signalListener = null;\n\t\t}\n\n\t\tthis.resolve();\n\t\treturn this;\n\t}\n}\n\ninterface PolyFillAbortSignal {\n\treadonly aborted: boolean;\n\taddEventListener(type: 'abort', listener: () => void): void;\n\tremoveEventListener(type: 'abort', listener: () => void): void;\n}\n","import { AsyncQueueEntry } from './AsyncQueueEntry';\n\n/**\n * The AsyncQueue class used to sequentialize burst requests\n */\nexport class AsyncQueue {\n\t/**\n\t * The remaining amount of queued promises\n\t */\n\tpublic get remaining(): number {\n\t\treturn this.promises.length;\n\t}\n\n\t/**\n\t * The promises array\n\t */\n\tprivate promises: AsyncQueueEntry[] = [];\n\n\t/**\n\t * Waits for last promise and queues a new one\n\t * @example\n\t * ```typescript\n\t * const queue = new AsyncQueue();\n\t * async function request(url, options) {\n\t * await queue.wait({ signal: options.signal });\n\t * try {\n\t * const result = await fetch(url, options);\n\t * // Do some operations with 'result'\n\t * } finally {\n\t * // Remove first entry from the queue and resolve for the next entry\n\t * queue.shift();\n\t * }\n\t * }\n\t *\n\t * request(someUrl1, someOptions1); // Will call fetch() immediately\n\t * request(someUrl2, someOptions2); // Will call fetch() after the first finished\n\t * request(someUrl3, someOptions3); // Will call fetch() after the second finished\n\t * ```\n\t */\n\tpublic wait(options?: Readonly<AsyncQueueWaitOptions>): Promise<void> {\n\t\tconst entry = new AsyncQueueEntry(this);\n\n\t\tif (this.promises.length === 0) {\n\t\t\tthis.promises.push(entry);\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tthis.promises.push(entry);\n\t\tif (options?.signal) entry.setSignal(options.signal);\n\t\treturn entry.promise;\n\t}\n\n\t/**\n\t * Unlocks the head lock and transfers the next lock (if any) to the head.\n\t * @returns Whether or not there was an element pending to process.\n\t */\n\tpublic shift(): void {\n\t\tif (this.promises.length === 0) return;\n\t\tif (this.promises.length === 1) {\n\t\t\t// Remove the head entry.\n\t\t\tthis.promises.shift();\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the head entry, making the 2nd entry the new one.\n\t\t// Then use the head entry, which will unlock the promise.\n\t\tthis.promises.shift();\n\t\tthis.promises[0].use();\n\t}\n}\n\nexport interface AsyncQueueWaitOptions {\n\tsignal?: AbortSignal | undefined | null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACKO,MAAM,kBAAN,MAAsB;AAAA,IAQ5B,AAAO,YAAY,OAAmB;AAPtC,0BAAgB;AAChB,0BAAQ;AACR,0BAAQ;AACR,0BAAiB;AACjB,0BAAQ,UAAqC;AAC7C,0BAAQ,kBAAsC;AAG7C,WAAK,QAAQ;AACb,WAAK,UAAU,IAAI,QAAQ,CAAC,SAAS,WAAW;AAC/C,aAAK,UAAU;AACf,aAAK,SAAS;AAAA,MACf,CAAC;AAAA,IACF;AAAA,IAEA,AAAO,UAAU,QAAqB;AACrC,UAAI,OAAO;AAAS,eAAO;AAE3B,WAAK,SAAS;AACd,WAAK,iBAAiB,MAAM;AAC3B,cAAM,QAAQ,KAAK,MAAM,YAAY,QAAQ,IAAI;AACjD,YAAI,UAAU;AAAI,eAAK,MAAM,YAAY,OAAO,OAAO,CAAC;AAExD,aAAK,OAAO,IAAI,MAAM,0BAA0B,CAAC;AAAA,MAClD;AACA,WAAK,OAAO,iBAAiB,SAAS,KAAK,cAAc;AACzD,aAAO;AAAA,IACR;AAAA,IAEA,AAAO,MAAM;AACZ,UAAI,KAAK,QAAQ;AAChB,aAAK,OAAO,oBAAoB,SAAS,KAAK,cAAe;AAC7D,aAAK,SAAS;AACd,aAAK,iBAAiB;AAAA,MACvB;AAEA,WAAK,QAAQ;AACb,aAAO;AAAA,IACR;AAAA,EACD;AAxCa;;;ACAN,MAAM,aAAN,MAAiB;AAAA,IAAjB;AAWN,0BAAQ,YAA8B,CAAC;AAAA;AAAA,IAPvC,IAAW,YAAoB;AAC9B,aAAO,KAAK,SAAS;AAAA,IACtB;AAAA,IA4BA,AAAO,KAAK,SAA0D;AACrE,YAAM,QAAQ,IAAI,gBAAgB,IAAI;AAEtC,UAAI,KAAK,SAAS,WAAW,GAAG;AAC/B,aAAK,SAAS,KAAK,KAAK;AACxB,eAAO,QAAQ,QAAQ;AAAA,MACxB;AAEA,WAAK,SAAS,KAAK,KAAK;AACxB,UAAI,SAAS;AAAQ,cAAM,UAAU,QAAQ,MAAM;AACnD,aAAO,MAAM;AAAA,IACd;AAAA,IAMA,AAAO,QAAc;AACpB,UAAI,KAAK,SAAS,WAAW;AAAG;AAChC,UAAI,KAAK,SAAS,WAAW,GAAG;AAE/B,aAAK,SAAS,MAAM;AACpB;AAAA,MACD;AAIA,WAAK,SAAS,MAAM;AACpB,WAAK,SAAS,GAAG,IAAI;AAAA,IACtB;AAAA,EACD;AAhEa;","names":[]}
package/dist/index.js CHANGED
@@ -31,6 +31,46 @@ __export(src_exports, {
31
31
  });
32
32
  module.exports = __toCommonJS(src_exports);
33
33
 
34
+ // src/lib/AsyncQueueEntry.ts
35
+ var AsyncQueueEntry = class {
36
+ constructor(queue) {
37
+ __publicField(this, "promise");
38
+ __publicField(this, "resolve");
39
+ __publicField(this, "reject");
40
+ __publicField(this, "queue");
41
+ __publicField(this, "signal", null);
42
+ __publicField(this, "signalListener", null);
43
+ this.queue = queue;
44
+ this.promise = new Promise((resolve, reject) => {
45
+ this.resolve = resolve;
46
+ this.reject = reject;
47
+ });
48
+ }
49
+ setSignal(signal) {
50
+ if (signal.aborted)
51
+ return this;
52
+ this.signal = signal;
53
+ this.signalListener = () => {
54
+ const index = this.queue["promises"].indexOf(this);
55
+ if (index !== -1)
56
+ this.queue["promises"].splice(index, 1);
57
+ this.reject(new Error("Request aborted manually"));
58
+ };
59
+ this.signal.addEventListener("abort", this.signalListener);
60
+ return this;
61
+ }
62
+ use() {
63
+ if (this.signal) {
64
+ this.signal.removeEventListener("abort", this.signalListener);
65
+ this.signal = null;
66
+ this.signalListener = null;
67
+ }
68
+ this.resolve();
69
+ return this;
70
+ }
71
+ };
72
+ __name(AsyncQueueEntry, "AsyncQueueEntry");
73
+
34
74
  // src/lib/AsyncQueue.ts
35
75
  var AsyncQueue = class {
36
76
  constructor() {
@@ -39,22 +79,26 @@ var AsyncQueue = class {
39
79
  get remaining() {
40
80
  return this.promises.length;
41
81
  }
42
- wait() {
43
- const next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve();
44
- let resolve;
45
- const promise = new Promise((res) => {
46
- resolve = res;
47
- });
48
- this.promises.push({
49
- resolve,
50
- promise
51
- });
52
- return next;
82
+ wait(options) {
83
+ const entry = new AsyncQueueEntry(this);
84
+ if (this.promises.length === 0) {
85
+ this.promises.push(entry);
86
+ return Promise.resolve();
87
+ }
88
+ this.promises.push(entry);
89
+ if (options?.signal)
90
+ entry.setSignal(options.signal);
91
+ return entry.promise;
53
92
  }
54
93
  shift() {
55
- const deferred = this.promises.shift();
56
- if (typeof deferred !== "undefined")
57
- deferred.resolve();
94
+ if (this.promises.length === 0)
95
+ return;
96
+ if (this.promises.length === 1) {
97
+ this.promises.shift();
98
+ return;
99
+ }
100
+ this.promises.shift();
101
+ this.promises[0].use();
58
102
  }
59
103
  };
60
104
  __name(AsyncQueue, "AsyncQueue");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/lib/AsyncQueue.ts"],"sourcesContent":["export * from './lib/AsyncQueue';\n","/**\n * The AsyncQueue class used to sequentialize burst requests\n */\nexport class AsyncQueue {\n\t/**\n\t * The remaining amount of queued promises\n\t */\n\tpublic get remaining(): number {\n\t\treturn this.promises.length;\n\t}\n\n\t/**\n\t * The promises array\n\t */\n\tprivate promises: InternalAsyncQueueDeferredPromise[] = [];\n\n\t/**\n\t * Waits for last promise and queues a new one\n\t * @example\n\t * ```typescript\n\t * const queue = new AsyncQueue();\n\t * async function request(url, options) {\n\t * await queue.wait();\n\t * try {\n\t * const result = await fetch(url, options);\n\t * // Do some operations with 'result'\n\t * } finally {\n\t * // Remove first entry from the queue and resolve for the next entry\n\t * queue.shift();\n\t * }\n\t * }\n\t *\n\t * request(someUrl1, someOptions1); // Will call fetch() immediately\n\t * request(someUrl2, someOptions2); // Will call fetch() after the first finished\n\t * request(someUrl3, someOptions3); // Will call fetch() after the second finished\n\t * ```\n\t */\n\tpublic wait(): Promise<void> {\n\t\tconst next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve();\n\t\tlet resolve: () => void;\n\t\tconst promise = new Promise<void>((res) => {\n\t\t\tresolve = res;\n\t\t});\n\n\t\tthis.promises.push({\n\t\t\tresolve: resolve!,\n\t\t\tpromise\n\t\t});\n\n\t\treturn next;\n\t}\n\n\t/**\n\t * Frees the queue's lock for the next item to process\n\t */\n\tpublic shift(): void {\n\t\tconst deferred = this.promises.shift();\n\t\tif (typeof deferred !== 'undefined') deferred.resolve();\n\t}\n}\n\n/**\n * @internal\n */\ninterface InternalAsyncQueueDeferredPromise {\n\tresolve(): void;\n\tpromise: Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,aAAN,MAAiB;AAAA,EAAjB;AAWN,wBAAQ,YAAgD,CAAC;AAAA;AAAA,EAPzD,IAAW,YAAoB;AAC9B,WAAO,KAAK,SAAS;AAAA,EACtB;AAAA,EA4BA,AAAO,OAAsB;AAC5B,UAAM,OAAO,KAAK,SAAS,SAAS,KAAK,SAAS,KAAK,SAAS,SAAS,GAAG,UAAU,QAAQ,QAAQ;AACtG,QAAI;AACJ,UAAM,UAAU,IAAI,QAAc,CAAC,QAAQ;AAC1C,gBAAU;AAAA,IACX,CAAC;AAED,SAAK,SAAS,KAAK;AAAA,MAClB;AAAA,MACA;AAAA,IACD,CAAC;AAED,WAAO;AAAA,EACR;AAAA,EAKA,AAAO,QAAc;AACpB,UAAM,WAAW,KAAK,SAAS,MAAM;AACrC,QAAI,OAAO,aAAa;AAAa,eAAS,QAAQ;AAAA,EACvD;AACD;AAxDa;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/lib/AsyncQueueEntry.ts","../src/lib/AsyncQueue.ts"],"sourcesContent":["export * from './lib/AsyncQueue';\n","import type { AsyncQueue } from './AsyncQueue';\n\n/**\n * @internal\n */\nexport class AsyncQueueEntry {\n\tpublic readonly promise: Promise<void>;\n\tprivate resolve!: () => void;\n\tprivate reject!: (error: Error) => void;\n\tprivate readonly queue: AsyncQueue;\n\tprivate signal: PolyFillAbortSignal | null = null;\n\tprivate signalListener: (() => void) | null = null;\n\n\tpublic constructor(queue: AsyncQueue) {\n\t\tthis.queue = queue;\n\t\tthis.promise = new Promise((resolve, reject) => {\n\t\t\tthis.resolve = resolve;\n\t\t\tthis.reject = reject;\n\t\t});\n\t}\n\n\tpublic setSignal(signal: AbortSignal) {\n\t\tif (signal.aborted) return this;\n\n\t\tthis.signal = signal as PolyFillAbortSignal;\n\t\tthis.signalListener = () => {\n\t\t\tconst index = this.queue['promises'].indexOf(this);\n\t\t\tif (index !== -1) this.queue['promises'].splice(index, 1);\n\n\t\t\tthis.reject(new Error('Request aborted manually'));\n\t\t};\n\t\tthis.signal.addEventListener('abort', this.signalListener);\n\t\treturn this;\n\t}\n\n\tpublic use() {\n\t\tif (this.signal) {\n\t\t\tthis.signal.removeEventListener('abort', this.signalListener!);\n\t\t\tthis.signal = null;\n\t\t\tthis.signalListener = null;\n\t\t}\n\n\t\tthis.resolve();\n\t\treturn this;\n\t}\n}\n\ninterface PolyFillAbortSignal {\n\treadonly aborted: boolean;\n\taddEventListener(type: 'abort', listener: () => void): void;\n\tremoveEventListener(type: 'abort', listener: () => void): void;\n}\n","import { AsyncQueueEntry } from './AsyncQueueEntry';\n\n/**\n * The AsyncQueue class used to sequentialize burst requests\n */\nexport class AsyncQueue {\n\t/**\n\t * The remaining amount of queued promises\n\t */\n\tpublic get remaining(): number {\n\t\treturn this.promises.length;\n\t}\n\n\t/**\n\t * The promises array\n\t */\n\tprivate promises: AsyncQueueEntry[] = [];\n\n\t/**\n\t * Waits for last promise and queues a new one\n\t * @example\n\t * ```typescript\n\t * const queue = new AsyncQueue();\n\t * async function request(url, options) {\n\t * await queue.wait({ signal: options.signal });\n\t * try {\n\t * const result = await fetch(url, options);\n\t * // Do some operations with 'result'\n\t * } finally {\n\t * // Remove first entry from the queue and resolve for the next entry\n\t * queue.shift();\n\t * }\n\t * }\n\t *\n\t * request(someUrl1, someOptions1); // Will call fetch() immediately\n\t * request(someUrl2, someOptions2); // Will call fetch() after the first finished\n\t * request(someUrl3, someOptions3); // Will call fetch() after the second finished\n\t * ```\n\t */\n\tpublic wait(options?: Readonly<AsyncQueueWaitOptions>): Promise<void> {\n\t\tconst entry = new AsyncQueueEntry(this);\n\n\t\tif (this.promises.length === 0) {\n\t\t\tthis.promises.push(entry);\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tthis.promises.push(entry);\n\t\tif (options?.signal) entry.setSignal(options.signal);\n\t\treturn entry.promise;\n\t}\n\n\t/**\n\t * Unlocks the head lock and transfers the next lock (if any) to the head.\n\t * @returns Whether or not there was an element pending to process.\n\t */\n\tpublic shift(): void {\n\t\tif (this.promises.length === 0) return;\n\t\tif (this.promises.length === 1) {\n\t\t\t// Remove the head entry.\n\t\t\tthis.promises.shift();\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the head entry, making the 2nd entry the new one.\n\t\t// Then use the head entry, which will unlock the promise.\n\t\tthis.promises.shift();\n\t\tthis.promises[0].use();\n\t}\n}\n\nexport interface AsyncQueueWaitOptions {\n\tsignal?: AbortSignal | undefined | null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,kBAAN,MAAsB;AAAA,EAQ5B,AAAO,YAAY,OAAmB;AAPtC,wBAAgB;AAChB,wBAAQ;AACR,wBAAQ;AACR,wBAAiB;AACjB,wBAAQ,UAAqC;AAC7C,wBAAQ,kBAAsC;AAG7C,SAAK,QAAQ;AACb,SAAK,UAAU,IAAI,QAAQ,CAAC,SAAS,WAAW;AAC/C,WAAK,UAAU;AACf,WAAK,SAAS;AAAA,IACf,CAAC;AAAA,EACF;AAAA,EAEA,AAAO,UAAU,QAAqB;AACrC,QAAI,OAAO;AAAS,aAAO;AAE3B,SAAK,SAAS;AACd,SAAK,iBAAiB,MAAM;AAC3B,YAAM,QAAQ,KAAK,MAAM,YAAY,QAAQ,IAAI;AACjD,UAAI,UAAU;AAAI,aAAK,MAAM,YAAY,OAAO,OAAO,CAAC;AAExD,WAAK,OAAO,IAAI,MAAM,0BAA0B,CAAC;AAAA,IAClD;AACA,SAAK,OAAO,iBAAiB,SAAS,KAAK,cAAc;AACzD,WAAO;AAAA,EACR;AAAA,EAEA,AAAO,MAAM;AACZ,QAAI,KAAK,QAAQ;AAChB,WAAK,OAAO,oBAAoB,SAAS,KAAK,cAAe;AAC7D,WAAK,SAAS;AACd,WAAK,iBAAiB;AAAA,IACvB;AAEA,SAAK,QAAQ;AACb,WAAO;AAAA,EACR;AACD;AAxCa;;;ACAN,IAAM,aAAN,MAAiB;AAAA,EAAjB;AAWN,wBAAQ,YAA8B,CAAC;AAAA;AAAA,EAPvC,IAAW,YAAoB;AAC9B,WAAO,KAAK,SAAS;AAAA,EACtB;AAAA,EA4BA,AAAO,KAAK,SAA0D;AACrE,UAAM,QAAQ,IAAI,gBAAgB,IAAI;AAEtC,QAAI,KAAK,SAAS,WAAW,GAAG;AAC/B,WAAK,SAAS,KAAK,KAAK;AACxB,aAAO,QAAQ,QAAQ;AAAA,IACxB;AAEA,SAAK,SAAS,KAAK,KAAK;AACxB,QAAI,SAAS;AAAQ,YAAM,UAAU,QAAQ,MAAM;AACnD,WAAO,MAAM;AAAA,EACd;AAAA,EAMA,AAAO,QAAc;AACpB,QAAI,KAAK,SAAS,WAAW;AAAG;AAChC,QAAI,KAAK,SAAS,WAAW,GAAG;AAE/B,WAAK,SAAS,MAAM;AACpB;AAAA,IACD;AAIA,SAAK,SAAS,MAAM;AACpB,SAAK,SAAS,GAAG,IAAI;AAAA,EACtB;AACD;AAhEa;","names":[]}
package/dist/index.mjs CHANGED
@@ -6,6 +6,46 @@ var __publicField = (obj, key, value) => {
6
6
  return value;
7
7
  };
8
8
 
9
+ // src/lib/AsyncQueueEntry.ts
10
+ var AsyncQueueEntry = class {
11
+ constructor(queue) {
12
+ __publicField(this, "promise");
13
+ __publicField(this, "resolve");
14
+ __publicField(this, "reject");
15
+ __publicField(this, "queue");
16
+ __publicField(this, "signal", null);
17
+ __publicField(this, "signalListener", null);
18
+ this.queue = queue;
19
+ this.promise = new Promise((resolve, reject) => {
20
+ this.resolve = resolve;
21
+ this.reject = reject;
22
+ });
23
+ }
24
+ setSignal(signal) {
25
+ if (signal.aborted)
26
+ return this;
27
+ this.signal = signal;
28
+ this.signalListener = () => {
29
+ const index = this.queue["promises"].indexOf(this);
30
+ if (index !== -1)
31
+ this.queue["promises"].splice(index, 1);
32
+ this.reject(new Error("Request aborted manually"));
33
+ };
34
+ this.signal.addEventListener("abort", this.signalListener);
35
+ return this;
36
+ }
37
+ use() {
38
+ if (this.signal) {
39
+ this.signal.removeEventListener("abort", this.signalListener);
40
+ this.signal = null;
41
+ this.signalListener = null;
42
+ }
43
+ this.resolve();
44
+ return this;
45
+ }
46
+ };
47
+ __name(AsyncQueueEntry, "AsyncQueueEntry");
48
+
9
49
  // src/lib/AsyncQueue.ts
10
50
  var AsyncQueue = class {
11
51
  constructor() {
@@ -14,22 +54,26 @@ var AsyncQueue = class {
14
54
  get remaining() {
15
55
  return this.promises.length;
16
56
  }
17
- wait() {
18
- const next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve();
19
- let resolve;
20
- const promise = new Promise((res) => {
21
- resolve = res;
22
- });
23
- this.promises.push({
24
- resolve,
25
- promise
26
- });
27
- return next;
57
+ wait(options) {
58
+ const entry = new AsyncQueueEntry(this);
59
+ if (this.promises.length === 0) {
60
+ this.promises.push(entry);
61
+ return Promise.resolve();
62
+ }
63
+ this.promises.push(entry);
64
+ if (options?.signal)
65
+ entry.setSignal(options.signal);
66
+ return entry.promise;
28
67
  }
29
68
  shift() {
30
- const deferred = this.promises.shift();
31
- if (typeof deferred !== "undefined")
32
- deferred.resolve();
69
+ if (this.promises.length === 0)
70
+ return;
71
+ if (this.promises.length === 1) {
72
+ this.promises.shift();
73
+ return;
74
+ }
75
+ this.promises.shift();
76
+ this.promises[0].use();
33
77
  }
34
78
  };
35
79
  __name(AsyncQueue, "AsyncQueue");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/AsyncQueue.ts"],"sourcesContent":["/**\n * The AsyncQueue class used to sequentialize burst requests\n */\nexport class AsyncQueue {\n\t/**\n\t * The remaining amount of queued promises\n\t */\n\tpublic get remaining(): number {\n\t\treturn this.promises.length;\n\t}\n\n\t/**\n\t * The promises array\n\t */\n\tprivate promises: InternalAsyncQueueDeferredPromise[] = [];\n\n\t/**\n\t * Waits for last promise and queues a new one\n\t * @example\n\t * ```typescript\n\t * const queue = new AsyncQueue();\n\t * async function request(url, options) {\n\t * await queue.wait();\n\t * try {\n\t * const result = await fetch(url, options);\n\t * // Do some operations with 'result'\n\t * } finally {\n\t * // Remove first entry from the queue and resolve for the next entry\n\t * queue.shift();\n\t * }\n\t * }\n\t *\n\t * request(someUrl1, someOptions1); // Will call fetch() immediately\n\t * request(someUrl2, someOptions2); // Will call fetch() after the first finished\n\t * request(someUrl3, someOptions3); // Will call fetch() after the second finished\n\t * ```\n\t */\n\tpublic wait(): Promise<void> {\n\t\tconst next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve();\n\t\tlet resolve: () => void;\n\t\tconst promise = new Promise<void>((res) => {\n\t\t\tresolve = res;\n\t\t});\n\n\t\tthis.promises.push({\n\t\t\tresolve: resolve!,\n\t\t\tpromise\n\t\t});\n\n\t\treturn next;\n\t}\n\n\t/**\n\t * Frees the queue's lock for the next item to process\n\t */\n\tpublic shift(): void {\n\t\tconst deferred = this.promises.shift();\n\t\tif (typeof deferred !== 'undefined') deferred.resolve();\n\t}\n}\n\n/**\n * @internal\n */\ninterface InternalAsyncQueueDeferredPromise {\n\tresolve(): void;\n\tpromise: Promise<void>;\n}\n"],"mappings":";;;;;;;;;AAGO,IAAM,aAAN,MAAiB;AAAA,EAAjB;AAWN,wBAAQ,YAAgD,CAAC;AAAA;AAAA,EAPzD,IAAW,YAAoB;AAC9B,WAAO,KAAK,SAAS;AAAA,EACtB;AAAA,EA4BA,AAAO,OAAsB;AAC5B,UAAM,OAAO,KAAK,SAAS,SAAS,KAAK,SAAS,KAAK,SAAS,SAAS,GAAG,UAAU,QAAQ,QAAQ;AACtG,QAAI;AACJ,UAAM,UAAU,IAAI,QAAc,CAAC,QAAQ;AAC1C,gBAAU;AAAA,IACX,CAAC;AAED,SAAK,SAAS,KAAK;AAAA,MAClB;AAAA,MACA;AAAA,IACD,CAAC;AAED,WAAO;AAAA,EACR;AAAA,EAKA,AAAO,QAAc;AACpB,UAAM,WAAW,KAAK,SAAS,MAAM;AACrC,QAAI,OAAO,aAAa;AAAa,eAAS,QAAQ;AAAA,EACvD;AACD;AAxDa;","names":[]}
1
+ {"version":3,"sources":["../src/lib/AsyncQueueEntry.ts","../src/lib/AsyncQueue.ts"],"sourcesContent":["import type { AsyncQueue } from './AsyncQueue';\n\n/**\n * @internal\n */\nexport class AsyncQueueEntry {\n\tpublic readonly promise: Promise<void>;\n\tprivate resolve!: () => void;\n\tprivate reject!: (error: Error) => void;\n\tprivate readonly queue: AsyncQueue;\n\tprivate signal: PolyFillAbortSignal | null = null;\n\tprivate signalListener: (() => void) | null = null;\n\n\tpublic constructor(queue: AsyncQueue) {\n\t\tthis.queue = queue;\n\t\tthis.promise = new Promise((resolve, reject) => {\n\t\t\tthis.resolve = resolve;\n\t\t\tthis.reject = reject;\n\t\t});\n\t}\n\n\tpublic setSignal(signal: AbortSignal) {\n\t\tif (signal.aborted) return this;\n\n\t\tthis.signal = signal as PolyFillAbortSignal;\n\t\tthis.signalListener = () => {\n\t\t\tconst index = this.queue['promises'].indexOf(this);\n\t\t\tif (index !== -1) this.queue['promises'].splice(index, 1);\n\n\t\t\tthis.reject(new Error('Request aborted manually'));\n\t\t};\n\t\tthis.signal.addEventListener('abort', this.signalListener);\n\t\treturn this;\n\t}\n\n\tpublic use() {\n\t\tif (this.signal) {\n\t\t\tthis.signal.removeEventListener('abort', this.signalListener!);\n\t\t\tthis.signal = null;\n\t\t\tthis.signalListener = null;\n\t\t}\n\n\t\tthis.resolve();\n\t\treturn this;\n\t}\n}\n\ninterface PolyFillAbortSignal {\n\treadonly aborted: boolean;\n\taddEventListener(type: 'abort', listener: () => void): void;\n\tremoveEventListener(type: 'abort', listener: () => void): void;\n}\n","import { AsyncQueueEntry } from './AsyncQueueEntry';\n\n/**\n * The AsyncQueue class used to sequentialize burst requests\n */\nexport class AsyncQueue {\n\t/**\n\t * The remaining amount of queued promises\n\t */\n\tpublic get remaining(): number {\n\t\treturn this.promises.length;\n\t}\n\n\t/**\n\t * The promises array\n\t */\n\tprivate promises: AsyncQueueEntry[] = [];\n\n\t/**\n\t * Waits for last promise and queues a new one\n\t * @example\n\t * ```typescript\n\t * const queue = new AsyncQueue();\n\t * async function request(url, options) {\n\t * await queue.wait({ signal: options.signal });\n\t * try {\n\t * const result = await fetch(url, options);\n\t * // Do some operations with 'result'\n\t * } finally {\n\t * // Remove first entry from the queue and resolve for the next entry\n\t * queue.shift();\n\t * }\n\t * }\n\t *\n\t * request(someUrl1, someOptions1); // Will call fetch() immediately\n\t * request(someUrl2, someOptions2); // Will call fetch() after the first finished\n\t * request(someUrl3, someOptions3); // Will call fetch() after the second finished\n\t * ```\n\t */\n\tpublic wait(options?: Readonly<AsyncQueueWaitOptions>): Promise<void> {\n\t\tconst entry = new AsyncQueueEntry(this);\n\n\t\tif (this.promises.length === 0) {\n\t\t\tthis.promises.push(entry);\n\t\t\treturn Promise.resolve();\n\t\t}\n\n\t\tthis.promises.push(entry);\n\t\tif (options?.signal) entry.setSignal(options.signal);\n\t\treturn entry.promise;\n\t}\n\n\t/**\n\t * Unlocks the head lock and transfers the next lock (if any) to the head.\n\t * @returns Whether or not there was an element pending to process.\n\t */\n\tpublic shift(): void {\n\t\tif (this.promises.length === 0) return;\n\t\tif (this.promises.length === 1) {\n\t\t\t// Remove the head entry.\n\t\t\tthis.promises.shift();\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the head entry, making the 2nd entry the new one.\n\t\t// Then use the head entry, which will unlock the promise.\n\t\tthis.promises.shift();\n\t\tthis.promises[0].use();\n\t}\n}\n\nexport interface AsyncQueueWaitOptions {\n\tsignal?: AbortSignal | undefined | null;\n}\n"],"mappings":";;;;;;;;;AAKO,IAAM,kBAAN,MAAsB;AAAA,EAQ5B,AAAO,YAAY,OAAmB;AAPtC,wBAAgB;AAChB,wBAAQ;AACR,wBAAQ;AACR,wBAAiB;AACjB,wBAAQ,UAAqC;AAC7C,wBAAQ,kBAAsC;AAG7C,SAAK,QAAQ;AACb,SAAK,UAAU,IAAI,QAAQ,CAAC,SAAS,WAAW;AAC/C,WAAK,UAAU;AACf,WAAK,SAAS;AAAA,IACf,CAAC;AAAA,EACF;AAAA,EAEA,AAAO,UAAU,QAAqB;AACrC,QAAI,OAAO;AAAS,aAAO;AAE3B,SAAK,SAAS;AACd,SAAK,iBAAiB,MAAM;AAC3B,YAAM,QAAQ,KAAK,MAAM,YAAY,QAAQ,IAAI;AACjD,UAAI,UAAU;AAAI,aAAK,MAAM,YAAY,OAAO,OAAO,CAAC;AAExD,WAAK,OAAO,IAAI,MAAM,0BAA0B,CAAC;AAAA,IAClD;AACA,SAAK,OAAO,iBAAiB,SAAS,KAAK,cAAc;AACzD,WAAO;AAAA,EACR;AAAA,EAEA,AAAO,MAAM;AACZ,QAAI,KAAK,QAAQ;AAChB,WAAK,OAAO,oBAAoB,SAAS,KAAK,cAAe;AAC7D,WAAK,SAAS;AACd,WAAK,iBAAiB;AAAA,IACvB;AAEA,SAAK,QAAQ;AACb,WAAO;AAAA,EACR;AACD;AAxCa;;;ACAN,IAAM,aAAN,MAAiB;AAAA,EAAjB;AAWN,wBAAQ,YAA8B,CAAC;AAAA;AAAA,EAPvC,IAAW,YAAoB;AAC9B,WAAO,KAAK,SAAS;AAAA,EACtB;AAAA,EA4BA,AAAO,KAAK,SAA0D;AACrE,UAAM,QAAQ,IAAI,gBAAgB,IAAI;AAEtC,QAAI,KAAK,SAAS,WAAW,GAAG;AAC/B,WAAK,SAAS,KAAK,KAAK;AACxB,aAAO,QAAQ,QAAQ;AAAA,IACxB;AAEA,SAAK,SAAS,KAAK,KAAK;AACxB,QAAI,SAAS;AAAQ,YAAM,UAAU,QAAQ,MAAM;AACnD,WAAO,MAAM;AAAA,EACd;AAAA,EAMA,AAAO,QAAc;AACpB,QAAI,KAAK,SAAS,WAAW;AAAG;AAChC,QAAI,KAAK,SAAS,WAAW,GAAG;AAE/B,WAAK,SAAS,MAAM;AACpB;AAAA,IACD;AAIA,SAAK,SAAS,MAAM;AACpB,SAAK,SAAS,GAAG,IAAI;AAAA,EACtB;AACD;AAhEa;","names":[]}
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  /**
2
3
  * The AsyncQueue class used to sequentialize burst requests
3
4
  */
@@ -16,7 +17,7 @@ export declare class AsyncQueue {
16
17
  * ```typescript
17
18
  * const queue = new AsyncQueue();
18
19
  * async function request(url, options) {
19
- * await queue.wait();
20
+ * await queue.wait({ signal: options.signal });
20
21
  * try {
21
22
  * const result = await fetch(url, options);
22
23
  * // Do some operations with 'result'
@@ -31,10 +32,14 @@ export declare class AsyncQueue {
31
32
  * request(someUrl3, someOptions3); // Will call fetch() after the second finished
32
33
  * ```
33
34
  */
34
- wait(): Promise<void>;
35
+ wait(options?: Readonly<AsyncQueueWaitOptions>): Promise<void>;
35
36
  /**
36
- * Frees the queue's lock for the next item to process
37
+ * Unlocks the head lock and transfers the next lock (if any) to the head.
38
+ * @returns Whether or not there was an element pending to process.
37
39
  */
38
40
  shift(): void;
39
41
  }
42
+ export interface AsyncQueueWaitOptions {
43
+ signal?: AbortSignal | undefined | null;
44
+ }
40
45
  //# sourceMappingURL=AsyncQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsyncQueue.d.ts","sourceRoot":"","sources":["../../src/lib/AsyncQueue.ts"],"names":[],"mappings":";AAEA;;GAEG;AACH,qBAAa,UAAU;IACtB;;OAEG;IACH,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAyB;IAEzC;;;;;;;;;;;;;;;;;;;;OAoBG;IACI,IAAI,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAarE;;;OAGG;IACI,KAAK,IAAI,IAAI;CAapB;AAED,MAAM,WAAW,qBAAqB;IACrC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;CACxC"}
@@ -0,0 +1,17 @@
1
+ /// <reference types="node" />
2
+ import type { AsyncQueue } from './AsyncQueue';
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare class AsyncQueueEntry {
7
+ readonly promise: Promise<void>;
8
+ private resolve;
9
+ private reject;
10
+ private readonly queue;
11
+ private signal;
12
+ private signalListener;
13
+ constructor(queue: AsyncQueue);
14
+ setSignal(signal: AbortSignal): this;
15
+ use(): this;
16
+ }
17
+ //# sourceMappingURL=AsyncQueueEntry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsyncQueueEntry.d.ts","sourceRoot":"","sources":["../../src/lib/AsyncQueueEntry.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,eAAe;IAC3B,SAAgB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,MAAM,CAAoC;IAClD,OAAO,CAAC,cAAc,CAA6B;gBAEhC,KAAK,EAAE,UAAU;IAQ7B,SAAS,CAAC,MAAM,EAAE,WAAW;IAc7B,GAAG;CAUV"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapphire/async-queue",
3
- "version": "1.3.2-next.fca7a80.0",
3
+ "version": "1.4.0",
4
4
  "description": "Sequential asynchronous lock-based queue for promises",
5
5
  "author": "@sapphire",
6
6
  "license": "MIT",