p-queue-multi
Advanced tools
Comparing version 8.0.2 to 8.0.3
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const eventemitter3_1 = require("eventemitter3"); | ||
const p_timeout_1 = require("p-timeout"); | ||
const p_timeout_js_1 = require("./p-timeout.js"); | ||
const priority_queue_js_1 = require("./priority-queue.js"); | ||
@@ -184,3 +198,3 @@ /** | ||
if (options.timeout) { | ||
operation = (0, p_timeout_1.default)(Promise.resolve(operation), { milliseconds: options.timeout }); | ||
operation = (0, p_timeout_js_1.default)(Promise.resolve(operation), { milliseconds: options.timeout }); | ||
} | ||
@@ -195,6 +209,8 @@ if (options.signal) { | ||
catch (error) { | ||
if (error instanceof p_timeout_1.TimeoutError && !options.throwOnTimeout) { | ||
console.log(error); | ||
if (error instanceof p_timeout_js_1.TimeoutError && options.throwOnTimeout === false) { | ||
resolve(); | ||
return; | ||
} | ||
console.log('not returned'); | ||
reject(error); | ||
@@ -299,3 +315,2 @@ this.emit('error', error); | ||
sizeBy(options) { | ||
// eslint-disable-next-line unicorn/no-array-callback-reference | ||
return this.#queue.filter(options).length; | ||
@@ -317,1 +332,2 @@ } | ||
exports.default = PQueue; | ||
__exportStar(require("./p-timeout.js"), exports); |
@@ -88,3 +88,4 @@ import { EventEmitter } from 'eventemitter3'; | ||
} | ||
export * from './p-timeout.js'; | ||
export type { Queue } from './queue.js'; | ||
export { type QueueAddOptions, type Options } from './options.js'; |
{ | ||
"name": "p-queue-multi", | ||
"version": "8.0.2", | ||
"version": "8.0.3", | ||
"description": "Promise queue with concurrency control", | ||
@@ -47,4 +47,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"eventemitter3": "^5.0.1", | ||
"p-timeout": "^6.1.2" | ||
"eventemitter3": "^5.0.1" | ||
}, | ||
@@ -54,3 +53,3 @@ "devDependencies": { | ||
"@types/node": "^20.12.10", | ||
"ava": "^5.3.1", | ||
"vitest": "^1.6.0", | ||
"benchmark": "^2.1.4", | ||
@@ -84,3 +83,8 @@ "del-cli": "^5.1.0", | ||
"@typescript-eslint/no-floating-promises": "off", | ||
"@typescript-eslint/no-invalid-void-type": "off" | ||
"@typescript-eslint/no-invalid-void-type": "off", | ||
"@typescript-eslint/no-unnecessary-type-assertion": "off", | ||
"@typescript-eslint/no-unsafe-call": "off", | ||
"@typescript-eslint/no-unsafe-assignment": "off", | ||
"@typescript-eslint/no-unsafe-argument": "off", | ||
"unicorn/no-array-callback-reference": "off" | ||
} | ||
@@ -90,5 +94,5 @@ }, | ||
"build": "del-cli dist && tsc && tsc -p tsconfig.module.json", | ||
"test": "xo && ava && del-cli dist && tsc && tsd", | ||
"test": "vitest && del-cli dist && tsc && tsd", | ||
"bench": "node --import=tsx/esm bench.ts" | ||
} | ||
} |
42171
1
15
709
- Removedp-timeout@^6.1.2
- Removedp-timeout@6.1.4(transitive)