Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
fixup! lib: make process.binding('util') return only type checkers
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
addaleax and aduh95 authored Mar 20, 2021
commit 7ae04f66a2427de8687eb51e8bcf3b769777810d
5 changes: 3 additions & 2 deletions lib/internal/legacy/processbinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ const {
ArrayPrototypeIncludes,
ObjectFromEntries,
ObjectEntries,
SafeArrayIterator,
} = primordials;
const { types } = require('util');

module.exports = {
util() {
return ObjectFromEntries(ArrayPrototypeFilter(
return ObjectFromEntries(new SafeArrayIterator(ArrayPrototypeFilter(
ObjectEntries(types),
({ 0: key }) => {
return ArrayPrototypeIncludes([
Expand All @@ -30,6 +31,6 @@ module.exports = {
'isUint8Array',
'isAnyArrayBuffer',
], key);
}));
})));
}
};