@incanta/config
Advanced tools
Comparing version 0.5.14 to 0.5.15
@@ -15,2 +15,3 @@ export interface IConfigOptions { | ||
private configDir; | ||
private configEnv; | ||
private extraConfigDirs; | ||
@@ -27,2 +28,3 @@ private values; | ||
dir(): string; | ||
env(): string; | ||
configEnvDir(configEnv: string): string | null; | ||
@@ -29,0 +31,0 @@ getConfiguredEnv(): any; |
@@ -14,2 +14,3 @@ "use strict"; | ||
configDir = ""; | ||
configEnv = ""; | ||
extraConfigDirs = []; | ||
@@ -55,4 +56,5 @@ values; | ||
path_1.default.join(cwd, defaultConfigDir); | ||
const configEnv = options?.configEnv || process.env["NODE_CONFIG_ENV"] || defaultConfigEnv; | ||
const configEnvDir = this.configEnvDir(configEnv); | ||
this.configEnv = | ||
options?.configEnv || process.env["NODE_CONFIG_ENV"] || defaultConfigEnv; | ||
const configEnvDir = this.configEnvDir(this.configEnv); | ||
const configFolderOptions = loader_1.Loader.readConfigSettings(configEnvDir || path_1.default.join(this.configDir, "default")); | ||
@@ -88,2 +90,5 @@ const defaultValues = loader_1.Loader.loadRoot(path_1.default.join(this.configDir, "default"), { | ||
} | ||
env() { | ||
return this.configEnv; | ||
} | ||
configEnvDir(configEnv) { | ||
@@ -90,0 +95,0 @@ if (fs_1.default.existsSync(path_1.default.join(this.configDir, configEnv))) { |
{ | ||
"name": "@incanta/config", | ||
"version": "0.5.14", | ||
"version": "0.5.15", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "exports": { |
@@ -24,2 +24,3 @@ import mergeWith from "lodash.mergewith"; | ||
private configDir: string = ""; | ||
private configEnv: string = ""; | ||
private extraConfigDirs: string[] = []; | ||
@@ -81,6 +82,6 @@ | ||
const configEnv = | ||
this.configEnv = | ||
options?.configEnv || process.env["NODE_CONFIG_ENV"] || defaultConfigEnv; | ||
const configEnvDir = this.configEnvDir(configEnv); | ||
const configEnvDir = this.configEnvDir(this.configEnv); | ||
@@ -147,2 +148,6 @@ const configFolderOptions = Loader.readConfigSettings( | ||
public env(): string { | ||
return this.configEnv; | ||
} | ||
public configEnvDir(configEnv: string): string | null { | ||
@@ -149,0 +154,0 @@ if (fs.existsSync(path.join(this.configDir, configEnv))) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82871
1501