Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/core/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function isIterable (obj) {
*/
function hasSafeIterator (obj) {
const prototype = Object.getPrototypeOf(obj)
const ownIterator = Object.prototype.hasOwnProperty.call(obj, Symbol.iterator)
const ownIterator = Object.hasOwn(obj, Symbol.iterator)
return ownIterator || (prototype != null && prototype !== Object.prototype && typeof obj[Symbol.iterator] === 'function')
}

Expand Down
2 changes: 1 addition & 1 deletion lib/interceptor/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const maxInt = Math.pow(2, 31) - 1

function hasSafeIterator (headers) {
const prototype = Object.getPrototypeOf(headers)
const ownIterator = Object.prototype.hasOwnProperty.call(headers, Symbol.iterator)
const ownIterator = Object.hasOwn(headers, Symbol.iterator)
return ownIterator || (prototype != null && prototype !== Object.prototype && typeof headers[Symbol.iterator] === 'function')
}

Expand Down
Loading