main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
993 bytes
|
Line | |
---|
1 | import freeGlobal from './_freeGlobal.js';
|
---|
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 | export default nodeUtil;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.