tiny-essentials 1.5.0 → 1.5.1

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.
@@ -2984,7 +2984,7 @@ function toTitleCaseLowerFirst(str) {
2984
2984
  class TinyPromiseQueue {
2985
2985
  /**
2986
2986
  * @typedef {Object} QueuedTask
2987
- * @property {() => Promise<any>} task - The async task to execute.
2987
+ * @property {(...args: any[]) => Promise<any>|Promise<any>} task - The async task to execute.
2988
2988
  * @property {(value: any) => any} resolve - The resolve function from the Promise.
2989
2989
  * @property {(reason?: any) => any} reject - The reject function from the Promise.
2990
2990
  * @property {string|undefined} [id] - Optional identifier for the task.
@@ -3104,7 +3104,7 @@ class TinyPromiseQueue {
3104
3104
  * If the task is canceled before execution, it will be rejected with the message:
3105
3105
  * "The function was canceled on TinyPromiseQueue."
3106
3106
  *
3107
- * @param {(...args: any[]) => Promise<any>} task A function that returns a Promise to be executed sequentially.
3107
+ * @param {(...args: any[]) => Promise<any>|Promise<any>} task A function that returns a Promise to be executed sequentially.
3108
3108
  * @param {number|null} [delay] Optional delay (in ms) before the task is executed.
3109
3109
  * @param {string} [id] Optional ID to identify the task in the queue.
3110
3110
  * @returns {Promise<any>} A Promise that resolves or rejects with the result of the task once it's processed.
@@ -41,7 +41,7 @@ __webpack_require__.d(__webpack_exports__, {
41
41
  class TinyPromiseQueue {
42
42
  /**
43
43
  * @typedef {Object} QueuedTask
44
- * @property {() => Promise<any>} task - The async task to execute.
44
+ * @property {(...args: any[]) => Promise<any>|Promise<any>} task - The async task to execute.
45
45
  * @property {(value: any) => any} resolve - The resolve function from the Promise.
46
46
  * @property {(reason?: any) => any} reject - The reject function from the Promise.
47
47
  * @property {string|undefined} [id] - Optional identifier for the task.
@@ -161,7 +161,7 @@ class TinyPromiseQueue {
161
161
  * If the task is canceled before execution, it will be rejected with the message:
162
162
  * "The function was canceled on TinyPromiseQueue."
163
163
  *
164
- * @param {(...args: any[]) => Promise<any>} task A function that returns a Promise to be executed sequentially.
164
+ * @param {(...args: any[]) => Promise<any>|Promise<any>} task A function that returns a Promise to be executed sequentially.
165
165
  * @param {number|null} [delay] Optional delay (in ms) before the task is executed.
166
166
  * @param {string} [id] Optional ID to identify the task in the queue.
167
167
  * @returns {Promise<any>} A Promise that resolves or rejects with the result of the task once it's processed.
@@ -11,7 +11,7 @@
11
11
  class TinyPromiseQueue {
12
12
  /**
13
13
  * @typedef {Object} QueuedTask
14
- * @property {() => Promise<any>} task - The async task to execute.
14
+ * @property {(...args: any[]) => Promise<any>|Promise<any>} task - The async task to execute.
15
15
  * @property {(value: any) => any} resolve - The resolve function from the Promise.
16
16
  * @property {(reason?: any) => any} reject - The reject function from the Promise.
17
17
  * @property {string|undefined} [id] - Optional identifier for the task.
@@ -131,7 +131,7 @@ class TinyPromiseQueue {
131
131
  * If the task is canceled before execution, it will be rejected with the message:
132
132
  * "The function was canceled on TinyPromiseQueue."
133
133
  *
134
- * @param {(...args: any[]) => Promise<any>} task A function that returns a Promise to be executed sequentially.
134
+ * @param {(...args: any[]) => Promise<any>|Promise<any>} task A function that returns a Promise to be executed sequentially.
135
135
  * @param {number|null} [delay] Optional delay (in ms) before the task is executed.
136
136
  * @param {string} [id] Optional ID to identify the task in the queue.
137
137
  * @returns {Promise<any>} A Promise that resolves or rejects with the result of the task once it's processed.
@@ -44,12 +44,12 @@ declare class TinyPromiseQueue {
44
44
  * If the task is canceled before execution, it will be rejected with the message:
45
45
  * "The function was canceled on TinyPromiseQueue."
46
46
  *
47
- * @param {(...args: any[]) => Promise<any>} task A function that returns a Promise to be executed sequentially.
47
+ * @param {(...args: any[]) => Promise<any>|Promise<any>} task A function that returns a Promise to be executed sequentially.
48
48
  * @param {number|null} [delay] Optional delay (in ms) before the task is executed.
49
49
  * @param {string} [id] Optional ID to identify the task in the queue.
50
50
  * @returns {Promise<any>} A Promise that resolves or rejects with the result of the task once it's processed.
51
51
  */
52
- enqueue(task: (...args: any[]) => Promise<any>, delay?: number | null, id?: string): Promise<any>;
52
+ enqueue(task: (...args: any[]) => Promise<any> | Promise<any>, delay?: number | null, id?: string): Promise<any>;
53
53
  /**
54
54
  * Cancels a scheduled delay and removes the task from the queue.
55
55
  * Adds the ID to a blacklist so the task is skipped if already being processed.
@@ -9,7 +9,7 @@
9
9
  class TinyPromiseQueue {
10
10
  /**
11
11
  * @typedef {Object} QueuedTask
12
- * @property {() => Promise<any>} task - The async task to execute.
12
+ * @property {(...args: any[]) => Promise<any>|Promise<any>} task - The async task to execute.
13
13
  * @property {(value: any) => any} resolve - The resolve function from the Promise.
14
14
  * @property {(reason?: any) => any} reject - The reject function from the Promise.
15
15
  * @property {string|undefined} [id] - Optional identifier for the task.
@@ -119,7 +119,7 @@ class TinyPromiseQueue {
119
119
  * If the task is canceled before execution, it will be rejected with the message:
120
120
  * "The function was canceled on TinyPromiseQueue."
121
121
  *
122
- * @param {(...args: any[]) => Promise<any>} task A function that returns a Promise to be executed sequentially.
122
+ * @param {(...args: any[]) => Promise<any>|Promise<any>} task A function that returns a Promise to be executed sequentially.
123
123
  * @param {number|null} [delay] Optional delay (in ms) before the task is executed.
124
124
  * @param {string} [id] Optional ID to identify the task in the queue.
125
125
  * @returns {Promise<any>} A Promise that resolves or rejects with the result of the task once it's processed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiny-essentials",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
5
5
  "scripts": {
6
6
  "test": "npm run test:mjs && npm run test:cjs && npm run test:js",