UNPKG

react-application-core

Version:

A react-based application core for the business applications.

60 lines 2.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DEFAULT_ENVIRONMENT_ENTITY = exports.EnvironmentGlobalVariablesEnum = void 0; /** * @stable [28.08.2019] */ var EnvironmentGlobalVariablesEnum; (function (EnvironmentGlobalVariablesEnum) { EnvironmentGlobalVariablesEnum["API"] = "$$api"; EnvironmentGlobalVariablesEnum["DATE_CONVERTER"] = "$$dateConverter"; EnvironmentGlobalVariablesEnum["ENVIRONMENT"] = "$$env"; EnvironmentGlobalVariablesEnum["TRANSPORT"] = "$$transport"; })(EnvironmentGlobalVariablesEnum = exports.EnvironmentGlobalVariablesEnum || (exports.EnvironmentGlobalVariablesEnum = {})); /** * @stable [10.09.2020] */ var definedLocation = typeof location === 'undefined' ? ({ assign: function () { return null; }, host: 'localhost', href: '', origin: '', pathname: '', port: '80', protocol: 'http', }) : location; var definedWindow = typeof window === 'undefined' ? {} : window; var definedDocument = typeof document === 'undefined' ? ({ baseURI: '', body: null, }) : document; var definedLocalStorage = typeof localStorage === 'undefined' ? ({ getItem: function () { return null; }, }) : localStorage; var origin = definedLocation.origin || [definedLocation.protocol, definedLocation.host].join('//'); var basePath = (definedDocument.baseURI || definedLocation.href).replace(origin, ''); /** * @default-entity * @stable [10.09.2020] */ exports.DEFAULT_ENVIRONMENT_ENTITY = Object.freeze({ appProfile: process.env.APP_PROFILE || 'DEFAULT', appVersion: process.env.APP_VERSION || '0.0.1', basePath: basePath, devMode: !!definedLocalStorage.getItem('$$RAC-DEV_MODE'), document: definedDocument, host: definedLocation.host, normalizedBasePath: basePath.replace(/\//g, ''), port: definedLocation.port || '80', prodMode: process.env.NODE_ENV === 'production', window: definedWindow, }); //# sourceMappingURL=env-definition.interface.js.map