A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/npm/cli/commit/aabf345a524f8aba7e0f45c0d4b8c86d5160d0cc below:

p-map@7.0.3 · npm/cli@aabf345 · GitHub

File tree Expand file treeCollapse file tree 4 files changed

+22

-10

lines changed

Filter options

Expand file treeCollapse file tree 4 files changed

+22

-10

lines changed Original file line number Diff line number Diff line change

@@ -7,7 +7,7 @@ export default async function pMap(

7 7

signal,

8 8

} = {},

9 9

) {

10 -

return new Promise((resolve, reject_) => {

10 +

return new Promise((resolve_, reject_) => {

11 11

if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {

12 12

throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);

13 13

}

@@ -30,20 +30,32 @@ export default async function pMap(

30 30

let currentIndex = 0;

31 31

const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();

32 32 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 + 33 46

const reject = reason => {

34 47

isRejected = true;

35 48

isResolved = true;

36 49

reject_(reason);

50 +

cleanup();

37 51

};

38 52 39 53

if (signal) {

40 54

if (signal.aborted) {

41 55

reject(signal.reason);

42 56

}

43 57 44 -

signal.addEventListener('abort', () => {

45 -

reject(signal.reason);

46 -

});

58 +

signal.addEventListener('abort', signalListener, {once: true});

47 59

}

48 60 49 61

const next = async () => {

Original file line number Diff line number Diff line change

@@ -1,6 +1,6 @@

1 1

{

2 2

"name": "p-map",

3 -

"version": "7.0.2",

3 +

"version": "7.0.3",

4 4

"description": "Map over promises concurrently",

5 5

"license": "MIT",

6 6

"repository": "sindresorhus/p-map",

Original file line number Diff line number Diff line change

@@ -134,7 +134,7 @@

134 134

"npm-profile": "^11.0.1",

135 135

"npm-registry-fetch": "^18.0.2",

136 136

"npm-user-validate": "^3.0.0",

137 -

"p-map": "^7.0.2",

137 +

"p-map": "^7.0.3",

138 138

"pacote": "^21.0.0",

139 139

"parse-conflict-json": "^4.0.0",

140 140

"proc-log": "^5.0.0",

@@ -12769,9 +12769,9 @@

12769 12769

}

12770 12770

},

12771 12771

"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==",

12775 12775

"inBundle": true,

12776 12776

"license": "MIT",

12777 12777

"engines": {

Original file line number Diff line number Diff line change

@@ -101,7 +101,7 @@

101 101

"npm-profile": "^11.0.1",

102 102

"npm-registry-fetch": "^18.0.2",

103 103

"npm-user-validate": "^3.0.0",

104 -

"p-map": "^7.0.2",

104 +

"p-map": "^7.0.3",

105 105

"pacote": "^21.0.0",

106 106

"parse-conflict-json": "^4.0.0",

107 107

"proc-log": "^5.0.0",

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4