Skip to content

Commit

Permalink
refactor: version cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx committed Dec 6, 2023
1 parent 0c3c6f8 commit 9e5e9d4
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions lib/core/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,19 +334,11 @@ function isDisturbed (body) {
}

function isErrored (body) {
return !!(body && (
stream.isErrored
? stream.isErrored(body)
: /state: 'errored'/.test(nodeUtil.inspect(body)
)))
return !!(body && stream.isErrored(body))
}

function isReadable (body) {
return !!(body && (
stream.isReadable
? stream.isReadable(body)
: /state: 'readable'/.test(nodeUtil.inspect(body)
)))
return !!(body && stream.isReadable(body))
}

function getSocketInfo (socket) {
Expand Down Expand Up @@ -417,10 +409,7 @@ function throwIfAborted (signal) {
signal.throwIfAborted()
} else {
if (signal.aborted) {
// DOMException not available < v17.0.0
const err = new Error('The operation was aborted')
err.name = 'AbortError'
throw err
throw new DOMException('The operation was aborted', 'AbortError')
}
}
}
Expand Down

0 comments on commit 9e5e9d4

Please sign in to comment.