Skip to content

Commit f1cdd77

Browse files
committed
doc: add util.types.isModuleNamespaceObject()
PR-URL: #20616 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
1 parent 46d335c commit f1cdd77

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

doc/api/util.md

+19
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,24 @@ util.types.isMapIterator(map.entries()); // Returns true
12871287
util.types.isMapIterator(map[Symbol.iterator]()); // Returns true
12881288
```
12891289

1290+
### util.types.isModuleNamespaceObject(value)
1291+
<!-- YAML
1292+
added: v10.0.0
1293+
-->
1294+
1295+
* Returns: {boolean}
1296+
1297+
Returns `true` if the value is an instance of a [Module Namespace Object][].
1298+
1299+
For example:
1300+
1301+
<!-- eslint-skip -->
1302+
```js
1303+
import * as ns from './a.js';
1304+
1305+
util.types.isModuleNamespaceObject(ns); // Returns true
1306+
```
1307+
12901308
### util.types.isNativeError(value)
12911309
<!-- YAML
12921310
added: v10.0.0
@@ -2127,6 +2145,7 @@ Deprecated predecessor of `console.log`.
21272145
[Custom promisified functions]: #util_custom_promisified_functions
21282146
[Customizing `util.inspect` colors]: #util_customizing_util_inspect_colors
21292147
[Internationalization]: intl.html
2148+
[Module Namespace Object]: https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects
21302149
[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/
21312150
[Common System Errors]: errors.html#errors_common_system_errors
21322151
[constructor]: https://developer.mozilla.org/en-US/JavaScript/Reference/Global_Objects/Object/constructor

0 commit comments

Comments
 (0)