File tree 5 files changed +22
-0
lines changed
5 files changed +22
-0
lines changed 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'`.
1290
1290
## ` util.types `
1291
1291
<!-- YAML
1292
1292
added: 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')`.
1293
1297
-->
1294
1298
1295
1299
` 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
1301
1305
properties or behavior a value exposes in JavaScript. They are primarily
1302
1306
useful for addon developers who prefer to do type checking in JavaScript.
1303
1307
1308
+ The API is accessible via ` require('util').types ` or ` require('util/types') ` .
1309
+
1304
1310
### ` util.types.isAnyArrayBuffer(value) `
1305
1311
<!-- YAML
1306
1312
added: 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 99
99
'lib/tty.js' ,
100
100
'lib/url.js' ,
101
101
'lib/util.js' ,
102
+ 'lib/util/types.js' ,
102
103
'lib/v8.js' ,
103
104
'lib/vm.js' ,
104
105
'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