UNPKG

@a2r/telemetry

Version:

Telemetry library for the A2R Framework

24 lines (23 loc) 732 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setForceSpecificEnvironment = void 0; let forceSpecificEnvironment; /** * Allows you force an specific environment * @param {string} environment Environment to force: development, production, etc. */ const setForceSpecificEnvironment = (environment) => { forceSpecificEnvironment = environment; }; exports.setForceSpecificEnvironment = setForceSpecificEnvironment; /** * Gets the current node environment * @returns {string} current node environment */ const getEnvironment = () => { if (forceSpecificEnvironment) { return forceSpecificEnvironment; } return process.env.NODE_ENV; }; exports.default = getEnvironment;