Skip to content

Commit 8e2c4fd

Browse files
committed
Rename secondPromiseValue to nextValue
1 parent 9af11f3 commit 8e2c4fd

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ Value resolved/rejected by the promise. Only defined with
189189
and
190190
[`multipleResolves`](https://nodejs.org/api/process.html#process_event_multipleresolves).
191191

192-
## `info.nextRejected`, `info.secondPromiseValue`
192+
## `info.nextRejected`, `info.nextValue`
193193

194-
Like [`rejected`](#inforejected) and [`promiseValue`](#infopromisevalue) but for
194+
Like [`rejected`](#inforejected) and [`value`](#infovalue) but for
195195
the second time the promise was resolved/rejected. Only defined with
196196
[`multipleResolves`](https://nodejs.org/api/process.html#process_event_multipleresolves).
197197

src/events.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ const rejectionHandled = function(context, promise) {
2222
}
2323

2424
// eslint-disable-next-line max-params
25-
const multipleResolves = function(context, type, promise, secondPromiseValue) {
25+
const multipleResolves = function(context, type, promise, nextValue) {
2626
const nextRejected = TYPE_TO_REJECTED[type]
27-
handleEvent({ ...context, promise, nextRejected, secondPromiseValue })
27+
handleEvent({ ...context, promise, nextRejected, nextValue })
2828
}
2929

3030
const TYPE_TO_REJECTED = {

src/handle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const handleEvent = async function({
1818
promise,
1919
promiseValue,
2020
nextRejected,
21-
secondPromiseValue,
21+
nextValue,
2222
}) {
2323
if (isLimited({ previousEvents, mEmitLimitedWarning, eventName, error })) {
2424
return
@@ -30,7 +30,7 @@ const handleEvent = async function({
3030
promise,
3131
promiseValue,
3232
nextRejected,
33-
secondPromiseValue,
33+
nextValue,
3434
})
3535

3636
if (isRepeated({ info, previousEvents })) {

src/info.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const getInfo = async function({
99
promise,
1010
promiseValue,
1111
nextRejected,
12-
secondPromiseValue,
12+
nextValue,
1313
}) {
1414
const { rejected, promiseValue: promiseValueA } = await parsePromise({
1515
eventName,
@@ -23,7 +23,7 @@ const getInfo = async function({
2323
rejected,
2424
promiseValue: promiseValueA,
2525
nextRejected,
26-
secondPromiseValue,
26+
nextValue,
2727
}
2828

2929
const infoA = pickBy(info, value => value !== undefined)

src/message.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const defaultMessage = function({
1818
rejected,
1919
promiseValue,
2020
nextRejected,
21-
secondPromiseValue,
21+
nextValue,
2222
error,
2323
level,
2424
colors,
@@ -27,7 +27,7 @@ const defaultMessage = function({
2727
rejected,
2828
promiseValue,
2929
nextRejected,
30-
secondPromiseValue,
30+
nextValue,
3131
error,
3232
})
3333

@@ -63,7 +63,7 @@ const multipleResolves = function({
6363
rejected,
6464
promiseValue,
6565
nextRejected,
66-
secondPromiseValue,
66+
nextValue,
6767
}) {
6868
const rejectedStr = REJECTED_NAME[rejected]
6969
const nextRejectedStr = REJECTED_NAME[nextRejected]
@@ -72,7 +72,7 @@ const multipleResolves = function({
7272

7373
return ` (a promise was ${state} multiple times)
7474
Initially ${rejectedStr} with: ${serialize(promiseValue)}
75-
Then ${nextRejectedStr}${again} with: ${serialize(secondPromiseValue)}`
75+
Then ${nextRejectedStr}${again} with: ${serialize(nextValue)}`
7676
}
7777

7878
const REJECTED_NAME = {

src/repeat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const INFO_PROPS = [
4343
'nextRejected',
4444
'rejected',
4545
'error',
46-
'secondPromiseValue',
46+
'nextValue',
4747
'promiseValue',
4848
]
4949

test/info.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const INFOS = [
4848
rejected: false,
4949
promiseValue: true,
5050
nextRejected: true,
51-
secondPromiseValue: false,
51+
nextValue: false,
5252
},
5353
},
5454
]

0 commit comments

Comments
 (0)