Update checked-in dependencies
This commit is contained in:
parent
fa428daf9c
commit
b3bf514df4
216 changed files with 4342 additions and 1611 deletions
27
node_modules/nock/lib/common.js
generated
vendored
27
node_modules/nock/lib/common.js
generated
vendored
|
|
@ -593,31 +593,35 @@ function deepEqual(expected, actual) {
|
|||
return expected === actual
|
||||
}
|
||||
|
||||
const timeouts = []
|
||||
const intervals = []
|
||||
const immediates = []
|
||||
const timeouts = new Set()
|
||||
const immediates = new Set()
|
||||
|
||||
const wrapTimer =
|
||||
(timer, ids) =>
|
||||
(...args) => {
|
||||
const id = timer(...args)
|
||||
ids.push(id)
|
||||
(callback, ...timerArgs) => {
|
||||
const cb = (...callbackArgs) => {
|
||||
try {
|
||||
// eslint-disable-next-line n/no-callback-literal
|
||||
callback(...callbackArgs)
|
||||
} finally {
|
||||
ids.delete(id)
|
||||
}
|
||||
}
|
||||
const id = timer(cb, ...timerArgs)
|
||||
ids.add(id)
|
||||
return id
|
||||
}
|
||||
|
||||
const setTimeout = wrapTimer(timers.setTimeout, timeouts)
|
||||
const setInterval = wrapTimer(timers.setInterval, intervals)
|
||||
const setImmediate = wrapTimer(timers.setImmediate, immediates)
|
||||
|
||||
function clearTimer(clear, ids) {
|
||||
while (ids.length) {
|
||||
clear(ids.shift())
|
||||
}
|
||||
ids.forEach(clear)
|
||||
ids.clear()
|
||||
}
|
||||
|
||||
function removeAllTimers() {
|
||||
clearTimer(clearTimeout, timeouts)
|
||||
clearTimer(clearInterval, intervals)
|
||||
clearTimer(clearImmediate, immediates)
|
||||
}
|
||||
|
||||
|
|
@ -762,7 +766,6 @@ module.exports = {
|
|||
removeAllTimers,
|
||||
restoreOverriddenRequests,
|
||||
setImmediate,
|
||||
setInterval,
|
||||
setTimeout,
|
||||
stringifyRequest,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue