mirror of
https://github.com/nodejs/node.git
synced 2025-05-04 06:27:35 +00:00

Ref: https://github.com/nodejs/node/pull/37485#pullrequestreview-600060802 Ref: https://github.com/nodejs/node/pull/37787 PR-URL: https://github.com/nodejs/node/pull/37819 Refs: https://github.com/nodejs/node/pull/37787 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
37 lines
816 B
JavaScript
37 lines
816 B
JavaScript
'use strict';
|
|
const {
|
|
ArrayPrototypeFilter,
|
|
ArrayPrototypeIncludes,
|
|
ObjectFromEntries,
|
|
ObjectEntries,
|
|
SafeArrayIterator,
|
|
} = primordials;
|
|
const { types } = require('util');
|
|
|
|
module.exports = {
|
|
util() {
|
|
return ObjectFromEntries(new SafeArrayIterator(ArrayPrototypeFilter(
|
|
ObjectEntries(types),
|
|
({ 0: key }) => {
|
|
return ArrayPrototypeIncludes([
|
|
'isArrayBuffer',
|
|
'isArrayBufferView',
|
|
'isAsyncFunction',
|
|
'isDataView',
|
|
'isDate',
|
|
'isExternal',
|
|
'isMap',
|
|
'isMapIterator',
|
|
'isNativeError',
|
|
'isPromise',
|
|
'isRegExp',
|
|
'isSet',
|
|
'isSetIterator',
|
|
'isTypedArray',
|
|
'isUint8Array',
|
|
'isAnyArrayBuffer',
|
|
], key);
|
|
})));
|
|
}
|
|
};
|