Last change
on this file since 6fe77af was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
995 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var freeGlobal = require('./_freeGlobal');
|
---|
| 2 |
|
---|
| 3 | /** Detect free variable `exports`. */
|
---|
| 4 | var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
---|
| 5 |
|
---|
| 6 | /** Detect free variable `module`. */
|
---|
| 7 | var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
---|
| 8 |
|
---|
| 9 | /** Detect the popular CommonJS extension `module.exports`. */
|
---|
| 10 | var moduleExports = freeModule && freeModule.exports === freeExports;
|
---|
| 11 |
|
---|
| 12 | /** Detect free variable `process` from Node.js. */
|
---|
| 13 | var freeProcess = moduleExports && freeGlobal.process;
|
---|
| 14 |
|
---|
| 15 | /** Used to access faster Node.js helpers. */
|
---|
| 16 | var nodeUtil = (function() {
|
---|
| 17 | try {
|
---|
| 18 | // Use `util.types` for Node.js 10+.
|
---|
| 19 | var types = freeModule && freeModule.require && freeModule.require('util').types;
|
---|
| 20 |
|
---|
| 21 | if (types) {
|
---|
| 22 | return types;
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | // Legacy `process.binding('util')` for Node.js < 10.
|
---|
| 26 | return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
---|
| 27 | } catch (e) {}
|
---|
| 28 | }());
|
---|
| 29 |
|
---|
| 30 | module.exports = nodeUtil;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.