Skip to content

Commit

Permalink
doc: add util.types.isModuleNamespaceObject()
Browse files Browse the repository at this point in the history
PR-URL: #20616
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
  • Loading branch information
devsnek authored and targos committed May 12, 2018
1 parent 56530f0 commit 7349223
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,24 @@ util.types.isMapIterator(map.entries()); // Returns true
util.types.isMapIterator(map[Symbol.iterator]()); // Returns true
```

### util.types.isModuleNamespaceObject(value)
<!-- YAML
added: v10.0.0
-->

* Returns: {boolean}

Returns `true` if the value is an instance of a [Module Namespace Object][].

For example:

<!-- eslint-skip -->
```js
import * as ns from './a.js';

util.types.isModuleNamespaceObject(ns); // Returns true
```

### util.types.isNativeError(value)
<!-- YAML
added: v10.0.0
Expand Down Expand Up @@ -2111,6 +2129,7 @@ Deprecated predecessor of `console.log`.
[Custom promisified functions]: #util_custom_promisified_functions
[Customizing `util.inspect` colors]: #util_customizing_util_inspect_colors
[Internationalization]: intl.html
[Module Namespace Object]: https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects
[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/
[Common System Errors]: errors.html#errors_common_system_errors
[constructor]: https://developer.mozilla.org/en-US/JavaScript/Reference/Global_Objects/Object/constructor
Expand Down

0 comments on commit 7349223

Please sign in to comment.