mirror of
https://github.com/nodejs/node.git
synced 2025-05-04 18:29:54 +00:00

PR-URL: https://github.com/nodejs/node/pull/46881 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
37 lines
817 B
JavaScript
37 lines
817 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);
|
|
})));
|
|
},
|
|
};
|