Skip to content

Commit aabf345

Browse files
committed
deps: p-map@7.0.3
1 parent 28e8761 commit aabf345

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

node_modules/p-map/index.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default async function pMap(
77
signal,
88
} = {},
99
) {
10-
return new Promise((resolve, reject_) => {
10+
return new Promise((resolve_, reject_) => {
1111
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
1212
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
1313
}
@@ -30,20 +30,32 @@ export default async function pMap(
3030
let currentIndex = 0;
3131
const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
3232

33+
const signalListener = () => {
34+
reject(signal.reason);
35+
};
36+
37+
const cleanup = () => {
38+
signal?.removeEventListener('abort', signalListener);
39+
};
40+
41+
const resolve = value => {
42+
resolve_(value);
43+
cleanup();
44+
};
45+
3346
const reject = reason => {
3447
isRejected = true;
3548
isResolved = true;
3649
reject_(reason);
50+
cleanup();
3751
};
3852

3953
if (signal) {
4054
if (signal.aborted) {
4155
reject(signal.reason);
4256
}
4357

44-
signal.addEventListener('abort', () => {
45-
reject(signal.reason);
46-
});
58+
signal.addEventListener('abort', signalListener, {once: true});
4759
}
4860

4961
const next = async () => {

node_modules/p-map/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p-map",
3-
"version": "7.0.2",
3+
"version": "7.0.3",
44
"description": "Map over promises concurrently",
55
"license": "MIT",
66
"repository": "sindresorhus/p-map",

package-lock.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
"npm-profile": "^11.0.1",
135135
"npm-registry-fetch": "^18.0.2",
136136
"npm-user-validate": "^3.0.0",
137-
"p-map": "^7.0.2",
137+
"p-map": "^7.0.3",
138138
"pacote": "^21.0.0",
139139
"parse-conflict-json": "^4.0.0",
140140
"proc-log": "^5.0.0",
@@ -12769,9 +12769,9 @@
1276912769
}
1277012770
},
1277112771
"node_modules/p-map": {
12772-
"version": "7.0.2",
12773-
"resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.2.tgz",
12774-
"integrity": "sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==",
12772+
"version": "7.0.3",
12773+
"resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz",
12774+
"integrity": "sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==",
1277512775
"inBundle": true,
1277612776
"license": "MIT",
1277712777
"engines": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"npm-profile": "^11.0.1",
102102
"npm-registry-fetch": "^18.0.2",
103103
"npm-user-validate": "^3.0.0",
104-
"p-map": "^7.0.2",
104+
"p-map": "^7.0.3",
105105
"pacote": "^21.0.0",
106106
"parse-conflict-json": "^4.0.0",
107107
"proc-log": "^5.0.0",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy