From 4f4a9fa88c5449acc9ee7339de5a0cd68610e8a0 Mon Sep 17 00:00:00 2001 From: David Anson Date: Wed, 7 Feb 2024 22:35:27 -0800 Subject: [PATCH] Freshen generated index.js file. --- dist/index.js | 56 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/dist/index.js b/dist/index.js index 52459b1..06fa957 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6126,15 +6126,15 @@ exports.isEmpty = isEmpty; var reusify = __nccwpck_require__(2113) -function fastqueue (context, worker, concurrency) { +function fastqueue (context, worker, _concurrency) { if (typeof context === 'function') { - concurrency = worker + _concurrency = worker worker = context context = null } - if (concurrency < 1) { - throw new Error('fastqueue concurrency must be greater than 1') + if (!(_concurrency >= 1)) { + throw new Error('fastqueue concurrency must be equal to or greater than 1') } var cache = reusify(Task) @@ -6149,7 +6149,23 @@ function fastqueue (context, worker, concurrency) { saturated: noop, pause: pause, paused: false, - concurrency: concurrency, + + get concurrency () { + return _concurrency + }, + set concurrency (value) { + if (!(value >= 1)) { + throw new Error('fastqueue concurrency must be equal to or greater than 1') + } + _concurrency = value + + if (self.paused) return + for (; queueHead && _running < _concurrency;) { + _running++ + release() + } + }, + running: running, resume: resume, idle: idle, @@ -6199,7 +6215,12 @@ function fastqueue (context, worker, concurrency) { function resume () { if (!self.paused) return self.paused = false - for (var i = 0; i < self.concurrency; i++) { + if (queueHead === null) { + _running++ + release() + return + } + for (; queueHead && _running < _concurrency;) { _running++ release() } @@ -6218,7 +6239,7 @@ function fastqueue (context, worker, concurrency) { current.callback = done || noop current.errorHandler = errorHandler - if (_running === self.concurrency || self.paused) { + if (_running >= _concurrency || self.paused) { if (queueTail) { queueTail.next = current queueTail = current @@ -6242,7 +6263,7 @@ function fastqueue (context, worker, concurrency) { current.callback = done || noop current.errorHandler = errorHandler - if (_running === self.concurrency || self.paused) { + if (_running >= _concurrency || self.paused) { if (queueHead) { current.next = queueHead queueHead = current @@ -6262,7 +6283,7 @@ function fastqueue (context, worker, concurrency) { cache.release(holder) } var next = queueHead - if (next) { + if (next && _running <= _concurrency) { if (!self.paused) { if (queueTail === queueHead) { queueTail = null @@ -6325,9 +6346,9 @@ function Task () { } } -function queueAsPromised (context, worker, concurrency) { +function queueAsPromised (context, worker, _concurrency) { if (typeof context === 'function') { - concurrency = worker + _concurrency = worker worker = context context = null } @@ -6339,7 +6360,7 @@ function queueAsPromised (context, worker, concurrency) { }, cb) } - var queue = fastqueue(context, asyncWrapper, concurrency) + var queue = fastqueue(context, asyncWrapper, _concurrency) var pushCb = queue.push var unshiftCb = queue.unshift @@ -6743,6 +6764,14 @@ const cleanRangeBackSlash = slashes => { // '`foo/`' should not continue with the '`..`' const REPLACERS = [ + [ + // remove BOM + // TODO: + // Other similar zero-width characters? + /^\uFEFF/, + () => EMPTY + ], + // > Trailing spaces are ignored unless they are quoted with backslash ("\") [ // (a\ ) -> (a ) @@ -32982,6 +33011,9 @@ function httpRedirectFetch (fetchParams, response) { // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name request.headersList.delete('authorization') + // https://fetch.spec.whatwg.org/#authentication-entries + request.headersList.delete('proxy-authorization', true) + // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement. request.headersList.delete('cookie') request.headersList.delete('host')