UNPKG

@kwiz/common

Version:

KWIZ common utilities and helpers for M365 platform

36 lines 1.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.config = config; const common_config_1 = require("./common-config"); const polyfill_1 = require("./helpers/polyfill"); const consolelogger_1 = require("./utils/consolelogger"); function config(params) { (0, polyfill_1.SetPolyfills)(); SetDependencies(params); const GetLogger = (name) => { return consolelogger_1.ConsoleLogger.get(name, common_config_1.CommonConfig.i.ProjectName); }; return { GetLogger, /** @deprecated call GetLogger instead */ logger: GetLogger, configInfo: common_config_1.CommonConfig.i }; } function SetDependencies(params) { const currentConfig = common_config_1.CommonConfig.i; const BuildNumber = (typeof params.BuildNumber === "string") ? params.BuildNumber : currentConfig.BuildNumber; const ReleaseStatus = (typeof params.ReleaseStatus === "string") ? params.ReleaseStatus : currentConfig.ReleaseStatus; const newValue = { BuildNumber, ReleaseStatus, IsLocalDev: ReleaseStatus === "dev", IsFastRing: ReleaseStatus === "fastring", IsProduction: ReleaseStatus !== "dev" && ReleaseStatus !== "fastring", ProjectName: params.ProjectName || currentConfig.ProjectName, _configured: true }; for (const key in newValue) //update configInfo currentConfig[key] = newValue[key]; } //# sourceMappingURL=config.js.map