File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1290,6 +1290,10 @@ The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`.
12901290## ` util.types `
12911291<!-- YAML
12921292added: v10.0.0
1293+ changes:
1294+ - version: REPLACEME
1295+ pr-url: https://github.com/nodejs/node/pull/34055
1296+ description: Exposed as `require('util/types')`.
12931297-->
12941298
12951299` util.types ` provides type checks for different kinds of built-in objects.
@@ -1301,6 +1305,8 @@ The result generally does not make any guarantees about what kinds of
13011305properties or behavior a value exposes in JavaScript. They are primarily
13021306useful for addon developers who prefer to do type checking in JavaScript.
13031307
1308+ The API is accessible via ` require('util').types ` or ` require('util/types') ` .
1309+
13041310### ` util.types.isAnyArrayBuffer(value) `
13051311<!-- YAML
13061312added: v10.0.0
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ module . exports = require ( 'internal/util/types' ) ;
Original file line number Diff line number Diff line change 100100 'lib/tty.js' ,
101101 'lib/url.js' ,
102102 'lib/util.js' ,
103+ 'lib/util/types.js' ,
103104 'lib/v8.js' ,
104105 'lib/vm.js' ,
105106 'lib/wasi.js' ,
Original file line number Diff line number Diff line change 1+ import '../common/index.mjs' ;
2+ import assert from 'assert' ;
3+ import { types } from 'util' ;
4+ import utilTypes from 'util/types' ;
5+
6+ assert . strictEqual ( types , utilTypes ) ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ require ( '../common' ) ;
4+ const assert = require ( 'assert' ) ;
5+
6+ assert . strictEqual ( require ( 'util/types' ) , require ( 'util' ) . types ) ;
You can’t perform that action at this time.
0 commit comments