smartenv/dist/smartenv.classes.helpers.js

53 lines
2.8 KiB
JavaScript
Raw Permalink Normal View History

2016-04-04 16:24:22 +00:00
"use strict";
2016-02-20 09:11:25 +00:00
exports.getEnvString = function () {
2016-11-21 10:58:37 +00:00
if (typeof window !== 'undefined') {
return 'browser';
2016-02-20 09:11:25 +00:00
}
2016-11-21 10:58:37 +00:00
else if (typeof process !== 'undefined') {
return 'node';
2016-02-20 09:11:25 +00:00
}
};
exports.getUserAgentString = function () {
if (exports.isBrowser()) {
return navigator.userAgent;
}
else {
return undefined;
}
};
exports.isNode = function () {
2016-11-21 10:58:37 +00:00
return exports.getEnvString() === 'node';
2016-02-20 09:11:25 +00:00
};
exports.getNodeVersion = function () {
return process.version;
};
exports.isBrowser = function () {
return !exports.isNode();
};
exports.isCI = function () {
if (process.env.CI) {
return true;
}
else {
return false;
}
;
};
2016-03-03 00:50:13 +00:00
exports.isC9 = function () {
if (process.env.C9_HOSTNAME) {
return true;
}
else {
return false;
}
};
2016-02-20 09:11:25 +00:00
exports.isTravis = function () {
if (process.env.TRAVIS) {
return true;
}
else {
return false;
}
;
};
2016-11-21 10:58:37 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRlbnYuY2xhc3Nlcy5oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRlbnYuY2xhc3Nlcy5oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBVyxRQUFBLFlBQVksR0FBRztJQUN0QixFQUFFLENBQUMsQ0FBQyxPQUFPLE1BQU0sS0FBSyxXQUFXLENBQUMsQ0FBQyxDQUFDO1FBQ2hDLE1BQU0sQ0FBQyxTQUFTLENBQUE7SUFDcEIsQ0FBQztJQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQyxPQUFPLE9BQU8sS0FBSyxXQUFXLENBQUMsQ0FBQyxDQUFDO1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