53 lines
2.8 KiB
JavaScript
53 lines
2.8 KiB
JavaScript
"use strict";
|
|
exports.getEnvString = function () {
|
|
if (typeof window !== 'undefined') {
|
|
return 'browser';
|
|
}
|
|
else if (typeof process !== 'undefined') {
|
|
return 'node';
|
|
}
|
|
};
|
|
exports.getUserAgentString = function () {
|
|
if (exports.isBrowser()) {
|
|
return navigator.userAgent;
|
|
}
|
|
else {
|
|
return undefined;
|
|
}
|
|
};
|
|
exports.isNode = function () {
|
|
return exports.getEnvString() === 'node';
|
|
};
|
|
exports.getNodeVersion = function () {
|
|
return process.version;
|
|
};
|
|
exports.isBrowser = function () {
|
|
return !exports.isNode();
|
|
};
|
|
exports.isCI = function () {
|
|
if (process.env.CI) {
|
|
return true;
|
|
}
|
|
else {
|
|
return false;
|
|
}
|
|
;
|
|
};
|
|
exports.isC9 = function () {
|
|
if (process.env.C9_HOSTNAME) {
|
|
return true;
|
|
}
|
|
else {
|
|
return false;
|
|
}
|
|
};
|
|
exports.isTravis = function () {
|
|
if (process.env.TRAVIS) {
|
|
return true;
|
|
}
|
|
else {
|
|
return false;
|
|
}
|
|
;
|
|
};
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRlbnYuY2xhc3Nlcy5oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRlbnYuY2xhc3Nlcy5oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBVyxRQUFBLFlBQVksR0FBRztJQUN0QixFQUFFLENBQUMsQ0FBQyxPQUFPLE1BQU0sS0FBSyxXQUFXLENBQUMsQ0FBQyxDQUFDO1FBQ2hDLE1BQU0sQ0FBQyxTQUFTLENBQUE7SUFDcEIsQ0FBQztJQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQyxPQUFPLE9BQU8sS0FBSyxXQUFXLENBQUMsQ0FBQyxDQUFDO1FBQ3h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