@app-config/core
Advanced tools
Comparing version 2.5.2 to 2.6.0
@@ -182,2 +182,3 @@ import { extname } from 'path'; | ||
export async function parseRawString(contents, fileType) { | ||
var _a; | ||
switch (fileType) { | ||
@@ -187,3 +188,3 @@ case FileType.JSON: | ||
case FileType.YAML: | ||
return (parseYAML(contents) ?? {}); | ||
return ((_a = parseYAML(contents)) !== null && _a !== void 0 ? _a : {}); | ||
case FileType.TOML: | ||
@@ -190,0 +191,0 @@ return parseTOML(contents); |
@@ -35,2 +35,3 @@ import { inspect } from 'util'; | ||
static merge(a, b) { | ||
var _a, _b; | ||
const meta = merge(a.meta, b.meta); | ||
@@ -56,3 +57,3 @@ if ( | ||
else { | ||
newValueK = b.value[key] ?? a.value[key]; | ||
newValueK = (_a = b.value[key]) !== null && _a !== void 0 ? _a : a.value[key]; | ||
} | ||
@@ -70,3 +71,3 @@ Object.assign(newValue, { [key]: newValueK }); | ||
else { | ||
newRawValueK = b.raw[key] ?? a.raw[key]; | ||
newRawValueK = (_b = b.raw[key]) !== null && _b !== void 0 ? _b : a.raw[key]; | ||
} | ||
@@ -128,2 +129,3 @@ Object.assign(newRawValue, { [key]: newRawValueK }); | ||
property([key, ...rest]) { | ||
var _a, _b; | ||
if (key === '') | ||
@@ -135,5 +137,5 @@ return this.property(rest); | ||
if (Array.isArray(this.value)) { | ||
return this.value[parseFloat(key)]?.property(rest); | ||
return (_a = this.value[parseFloat(key)]) === null || _a === void 0 ? void 0 : _a.property(rest); | ||
} | ||
return this.value[key]?.property(rest); | ||
return (_b = this.value[key]) === null || _b === void 0 ? void 0 : _b.property(rest); | ||
} | ||
@@ -291,3 +293,3 @@ /** Returns JSON object if the value is one */ | ||
if (applicableExtension) { | ||
const parse = (inner, metadataOverride, sourceOverride, extensionsOverride, contextOverride) => parseValueInner(inner, sourceOverride ?? source, extensionsOverride ?? extensions, { ...metadata, ...metadataOverride }, { ...context, ...contextOverride }, parentKeys, root, parent, visitedExtensions); | ||
const parse = (inner, metadataOverride, sourceOverride, extensionsOverride, contextOverride) => parseValueInner(inner, sourceOverride !== null && sourceOverride !== void 0 ? sourceOverride : source, extensionsOverride !== null && extensionsOverride !== void 0 ? extensionsOverride : extensions, { ...metadata, ...metadataOverride }, { ...context, ...contextOverride }, parentKeys, root, parent, visitedExtensions); | ||
// note that we don't traverse the object is an extension applied, that's up to them (with `parse`) | ||
@@ -294,0 +296,0 @@ return applicableExtension(parse, parent, source, extensions, root); |
{ | ||
"name": "@app-config/core", | ||
"description": "Core logic for App Config", | ||
"version": "2.5.2", | ||
"version": "2.6.0", | ||
"license": "MPL-2.0", | ||
@@ -33,4 +33,4 @@ "author": { | ||
"dependencies": { | ||
"@app-config/logging": "^2.5.2", | ||
"@app-config/utils": "^2.5.2", | ||
"@app-config/logging": "^2.6.0", | ||
"@app-config/utils": "^2.6.0", | ||
"@iarna/toml": "3", | ||
@@ -42,3 +42,3 @@ "js-yaml": "^3.13.1", | ||
"devDependencies": { | ||
"@app-config/test-utils": "^2.5.2", | ||
"@app-config/test-utils": "^2.6.0", | ||
"@types/js-yaml": "3", | ||
@@ -45,0 +45,0 @@ "@types/lodash.merge": "4" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
123030
1824
Updated@app-config/logging@^2.6.0
Updated@app-config/utils@^2.6.0