You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
993 B
30 lines
993 B
import freeGlobal from './_freeGlobal.js'; |
|
|
|
/** 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) {} |
|
}()); |
|
|
|
export default nodeUtil;
|
|
|