diff options
author | Gus Caplan <me@gus.host> | 2018-05-08 21:42:02 -0500 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2018-05-10 15:25:57 -0500 |
commit | f1cdd7749f873409e3929e2bc5d6a5bc3260796f (patch) | |
tree | 9cd5784a4160149e3b1c0386d80be2b90c569aa6 /doc/api/util.md | |
parent | 46d335c380510fda68e62a4cdafa58e7e7b230a1 (diff) | |
download | android-node-v8-f1cdd7749f873409e3929e2bc5d6a5bc3260796f.tar.gz android-node-v8-f1cdd7749f873409e3929e2bc5d6a5bc3260796f.tar.bz2 android-node-v8-f1cdd7749f873409e3929e2bc5d6a5bc3260796f.zip |
doc: add util.types.isModuleNamespaceObject()
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'doc/api/util.md')
-rw-r--r-- | doc/api/util.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/api/util.md b/doc/api/util.md index b0e511c3cd..66f1fc25cd 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -1287,6 +1287,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 @@ -2127,6 +2145,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 |