@mitm/config
Advanced tools
Comparing version 1.2.0 to 2.0.0
@@ -25,3 +25,2 @@ import { constant } from 'case'; | ||
} | ||
function getEnvVariableName(key) { | ||
@@ -32,6 +31,5 @@ return key.split('.').map(part => constant(part)).join('_'); | ||
function getVariables() { | ||
var _a; // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
var _a; | ||
return Object.assign({}, process.env, (_a = globalThis.DYNAMIC_ENVIRONMENT_VARIABLES) !== null && _a !== void 0 ? _a : {}); | ||
return (_a = globalThis.NODE_ENV_OVERRIDE) !== null && _a !== void 0 ? _a : process.env; | ||
} | ||
@@ -81,2 +79,2 @@ | ||
export { NoSuchConfigurationKeyError, asBoolean, asCommaSeparatedStrings, asNodeEnv, asNumber, asString, config as default, getConfig, getOptionalConfig }; | ||
export { NoSuchConfigurationKeyError, asBoolean, asCommaSeparatedStrings, asNodeEnv, asNumber, asString, config as default, getConfig, getEnvVariableName, getOptionalConfig }; |
@@ -38,13 +38,2 @@ (function (global, factory) { | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var NoSuchConfigurationKeyError = | ||
@@ -76,3 +65,2 @@ /** @class */ | ||
} | ||
function getEnvVariableName(key) { | ||
@@ -85,6 +73,5 @@ return key.split('.').map(function (part) { | ||
function getVariables() { | ||
var _a; // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
var _a; | ||
return __assign(__assign({}, process.env), (_a = globalThis.DYNAMIC_ENVIRONMENT_VARIABLES) !== null && _a !== void 0 ? _a : {}); | ||
return (_a = globalThis.NODE_ENV_OVERRIDE) !== null && _a !== void 0 ? _a : process.env; | ||
} | ||
@@ -144,2 +131,3 @@ | ||
exports.getConfig = getConfig; | ||
exports.getEnvVariableName = getEnvVariableName; | ||
exports.getOptionalConfig = getOptionalConfig; | ||
@@ -146,0 +134,0 @@ |
@@ -6,1 +6,2 @@ export declare class NoSuchConfigurationKeyError extends Error { | ||
export declare function getConfig<T>(key: string, parser: (value: string) => T): T; | ||
export declare function getEnvVariableName(key: string): string; |
{ | ||
"name": "@mitm/config", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"dependencies": { | ||
"case": "^1.6.0" | ||
}, | ||
"peerDependencies": { | ||
"@mitm/common": "^1.3.0", | ||
"case": "^1.6.3", | ||
"rxjs": "^7.4.0" | ||
"@mitm/common": "^1.4.0" | ||
}, | ||
"main": "./config.umd.js", | ||
"module": "./config.esm.js", | ||
"typings": "./index.d.ts", | ||
"dependencies": {} | ||
"typings": "./index.d.ts" | ||
} |
2
8666
194
+ Addedcase@^1.6.0