semantic-branch-version/node_modules/universal-user-agent/dist-node/index.js

23 lines
608 B
JavaScript
Raw Normal View History

2020-07-04 21:41:06 +08:00
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var osName = _interopDefault(require('os-name'));
function getUserAgent() {
try {
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
} catch (error) {
if (/wmic os get Caption/.test(error.message)) {
return "Windows <version undetectable>";
}
return "<environment undetectable>";
}
}
exports.getUserAgent = getUserAgent;
//# sourceMappingURL=index.js.map