@smithy/shared-ini-file-loader
Advanced tools
Comparing version 2.2.6 to 2.2.7
@@ -8,10 +8,11 @@ "use strict"; | ||
.filter(([key]) => { | ||
const sections = key.split(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); | ||
if (sections.length === 2 && Object.values(types_1.IniSectionType).includes(sections[0])) { | ||
return true; | ||
const indexOfSeparator = key.indexOf(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); | ||
if (indexOfSeparator === -1) { | ||
return false; | ||
} | ||
return false; | ||
return Object.values(types_1.IniSectionType).includes(key.substring(0, indexOfSeparator)); | ||
}) | ||
.reduce((acc, [key, value]) => { | ||
const updatedKey = key.startsWith(types_1.IniSectionType.PROFILE) ? key.split(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR)[1] : key; | ||
const indexOfSeparator = key.indexOf(loadSharedConfigFiles_1.CONFIG_PREFIX_SEPARATOR); | ||
const updatedKey = key.substring(0, indexOfSeparator) === types_1.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; | ||
acc[updatedKey] = value; | ||
@@ -18,0 +19,0 @@ return acc; |
@@ -5,10 +5,11 @@ import { IniSectionType } from "@smithy/types"; | ||
.filter(([key]) => { | ||
const sections = key.split(CONFIG_PREFIX_SEPARATOR); | ||
if (sections.length === 2 && Object.values(IniSectionType).includes(sections[0])) { | ||
return true; | ||
const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); | ||
if (indexOfSeparator === -1) { | ||
return false; | ||
} | ||
return false; | ||
return Object.values(IniSectionType).includes(key.substring(0, indexOfSeparator)); | ||
}) | ||
.reduce((acc, [key, value]) => { | ||
const updatedKey = key.startsWith(IniSectionType.PROFILE) ? key.split(CONFIG_PREFIX_SEPARATOR)[1] : key; | ||
const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR); | ||
const updatedKey = key.substring(0, indexOfSeparator) === IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key; | ||
acc[updatedKey] = value; | ||
@@ -15,0 +16,0 @@ return acc; |
{ | ||
"name": "@smithy/shared-ini-file-loader", | ||
"version": "2.2.6", | ||
"version": "2.2.7", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "@smithy/types": "^2.7.0", |
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
47569
777