Skip to content

Commit

Permalink
fix node:util/types exports (#3016)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig authored Oct 28, 2024
1 parent 712e77b commit aefa9f8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 44 additions & 1 deletion src/node/util/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,50 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

/* todo: the following is adopted code, enabling linting one day */
export * from 'node-internal:internal_types';
import { default as types } from 'node-internal:internal_types';
export {
isCryptoKey,
isKeyObject,
isAsyncFunction,
isGeneratorFunction,
isGeneratorObject,
isAnyArrayBuffer,
isArrayBuffer,
isArgumentsObject,
isBoxedPrimitive,
isDataView,
isMap,
isMapIterator,
isModuleNamespaceObject,
isNativeError,
isPromise,
isProxy,
isSet,
isSetIterator,
isSharedArrayBuffer,
isWeakMap,
isWeakSet,
isRegExp,
isDate,
isStringObject,
isSymbolObject,
isNumberObject,
isBooleanObject,
isBigIntObject,
isArrayBufferView,
isBigInt64Array,
isBigUint64Array,
isFloat32Array,
isFloat64Array,
isInt8Array,
isInt16Array,
isInt32Array,
isTypedArray,
isUint8Array,
isUint8ClampedArray,
isUint16Array,
isUint32Array,
isExternal,
} from 'node-internal:internal_types';
export default types;
2 changes: 2 additions & 0 deletions src/workerd/api/node/tests/util-nodejs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4373,5 +4373,7 @@ export const makeSureUtilTypesIsExported = {
async test() {
const types = await import('node:util/types');
assert.ok(types, 'node:util/types is not exported');
assert.ok(types.isTypedArray);
assert.ok(types.default.isTypedArray);
},
};

0 comments on commit aefa9f8

Please sign in to comment.