aboutsummaryrefslogtreecommitdiff
path: root/node_modules/lodash/_nodeUtil.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/lodash/_nodeUtil.js')
-rw-r--r--node_modules/lodash/_nodeUtil.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/node_modules/lodash/_nodeUtil.js b/node_modules/lodash/_nodeUtil.js
new file mode 100644
index 0000000..983d78f
--- /dev/null
+++ b/node_modules/lodash/_nodeUtil.js
@@ -0,0 +1,30 @@
+var freeGlobal = require('./_freeGlobal');
+
+/** Detect free variable `exports`. */
+var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
+
+/** Detect free variable `module`. */
+var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
+
+/** Detect the popular CommonJS extension `module.exports`. */
+var moduleExports = freeModule && freeModule.exports === freeExports;
+
+/** Detect free variable `process` from Node.js. */
+var freeProcess = moduleExports && freeGlobal.process;
+
+/** Used to access faster Node.js helpers. */
+var nodeUtil = (function() {
+ try {
+ // Use `util.types` for Node.js 10+.
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
+
+ if (types) {
+ return types;
+ }
+
+ // Legacy `process.binding('util')` for Node.js < 10.
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
+ } catch (e) {}
+}());
+
+module.exports = nodeUtil;