From 86bc1db2b78b12ce28edba2536088438752a8bbc Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Sat, 27 Jun 2020 15:40:00 +0200 Subject: [PATCH] =?UTF-8?q?util:=20add=C2=A0`util/types`=20alias=C2=A0modu?= =?UTF-8?q?le?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/31553 Refs: https://github.com/nodejs/node/pull/32953 Refs: https://github.com/nodejs/node/pull/33950 Refs: https://github.com/nodejs/node/pull/34001 Refs: https://github.com/nodejs/node/pull/34002 --- doc/api/util.md | 6 ++++++ lib/util/types.js | 3 +++ node.gyp | 1 + test/es-module/test-esm-util-types.mjs | 6 ++++++ test/parallel/test-util-types-exists.js | 6 ++++++ 5 files changed, 22 insertions(+) create mode 100644 lib/util/types.js create mode 100644 test/es-module/test-esm-util-types.mjs create mode 100644 test/parallel/test-util-types-exists.js diff --git a/doc/api/util.md b/doc/api/util.md index 3b400400e08cae..ab7388b4d8affa 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1237,6 +1237,10 @@ The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. ## `util.types` `util.types` provides type checks for different kinds of built-in objects. @@ -1248,6 +1252,8 @@ The result generally does not make any guarantees about what kinds of properties or behavior a value exposes in JavaScript. They are primarily useful for addon developers who prefer to do type checking in JavaScript. +The API is accessible via `require('util').types` or `require('util/types')`. + ### `util.types.isAnyArrayBuffer(value)`