@contember/config-loader
Advanced tools
Comparing version 0.12.0-beta.2 to 1.0.0-alpha.0
@@ -16,3 +16,3 @@ "use strict"; | ||
async load(filename) { | ||
const ext = path_1.extname(filename); | ||
const ext = (0, path_1.extname)(filename); | ||
if (!ext) { | ||
@@ -27,3 +27,3 @@ throw new Loader.UnresolvedAdapterError(`File ${filename} does not have an extension.`); | ||
const config = this.adapters[extWithoutDot].parse(file); | ||
return await this.includeConfigs(config, path_1.dirname(filename)); | ||
return await this.includeConfigs(config, (0, path_1.dirname)(filename)); | ||
} | ||
@@ -51,3 +51,3 @@ async loadString(content, adapter) { | ||
return Merger_1.default.merge(...(await Promise.all((_include || []).map(async (file) => { | ||
const nestedConfig = await this.load(path_1.join(baseDir, file)); | ||
const nestedConfig = await this.load((0, path_1.join)(baseDir, file)); | ||
if (typeof nestedConfig !== 'object' || nestedConfig === null) { | ||
@@ -54,0 +54,0 @@ throw new Loader.InvalidConfigError(`Only object configs can be included`); |
@@ -93,3 +93,3 @@ "use strict"; | ||
.map(([key, value]) => [key, resolveParametersInternal(value, [...path, key], parametersResolver)]) | ||
.reduce((result, [key, value]) => ({ ...result, [key]: value }), {}); | ||
.reduce((result, [key, value]) => value === undefined ? result : ({ ...result, [key]: value }), {}); | ||
} | ||
@@ -96,0 +96,0 @@ return data; |
{ | ||
"name": "@contember/config-loader", | ||
"version": "0.12.0-beta.2", | ||
"version": "1.0.0-alpha.0", | ||
"license": "Apache-2.0", | ||
@@ -12,3 +12,3 @@ "main": "dist/src/index.js", | ||
"@types/js-yaml": "^4.0.1", | ||
"@types/node": "^15.12.5" | ||
"@types/node": "^17.0.5" | ||
}, | ||
@@ -15,0 +15,0 @@ "dependencies": { |
@@ -99,5 +99,5 @@ export type Path = (string | number)[] | ||
.map(([key, value]: [string, any]) => [key, resolveParametersInternal(value, [...path, key], parametersResolver)]) | ||
.reduce((result, [key, value]) => ({ ...result, [key]: value }), {}) | ||
.reduce((result, [key, value]) => value === undefined ? result : ({ ...result, [key]: value }), {}) | ||
} | ||
return data | ||
} |
Sorry, the diff of this file is not supported yet
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
58650