File tree Expand file tree Collapse file tree 5 files changed +22
-0
lines changed Expand file tree Collapse file tree 5 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1237,6 +1237,10 @@ The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`.
1237
1237
## ` util.types `
1238
1238
<!-- YAML
1239
1239
added: v10.0.0
1240
+ changes:
1241
+ - version: REPLACEME
1242
+ pr-url: https://github.com/nodejs/node/pull/34055
1243
+ description: Exposed as `require('util/types')`
1240
1244
-->
1241
1245
1242
1246
` 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
1248
1252
properties or behavior a value exposes in JavaScript. They are primarily
1249
1253
useful for addon developers who prefer to do type checking in JavaScript.
1250
1254
1255
+ The API is accessible via ` require('util').types ` or ` require('util/types') ` .
1256
+
1251
1257
### ` util.types.isAnyArrayBuffer(value) `
1252
1258
<!-- YAML
1253
1259
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 95
95
'lib/tty.js' ,
96
96
'lib/url.js' ,
97
97
'lib/util.js' ,
98
+ 'lib/util/types.js' ,
98
99
'lib/v8.js' ,
99
100
'lib/vm.js' ,
100
101
'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