@aws-sdk/shared-ini-file-loader
Advanced tools
Comparing version 3.109.0 to 3.110.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [3.110.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.109.0...v3.110.0) (2022-06-14) | ||
### Bug Fixes | ||
* **shared-ini-file-loader:** update ini parsing ([#3682](https://github.com/aws/aws-sdk-js-v3/issues/3682)) ([9536104](https://github.com/aws/aws-sdk-js-v3/commit/95361044a5f2291389bd2886fb5dffe238ae6cdb)) | ||
# [3.109.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.108.1...v3.109.0) (2022-06-13) | ||
@@ -8,0 +19,0 @@ |
@@ -9,6 +9,6 @@ "use strict"; | ||
for (let line of iniData.split(/\r?\n/)) { | ||
line = line.split(/(^|\s)[;#]/)[0]; | ||
const section = line.match(/^\s*\[([^\[\]]+)]\s*$/); | ||
if (section) { | ||
currentSection = section[1]; | ||
line = line.split(/(^|\s)[;#]/)[0].trim(); | ||
const isSection = line[0] === "[" && line[line.length - 1] === "]"; | ||
if (isSection) { | ||
currentSection = line.substring(1, line.length - 1); | ||
if (profileNameBlockList.includes(currentSection)) { | ||
@@ -19,6 +19,13 @@ throw new Error(`Found invalid profile name "${currentSection}"`); | ||
else if (currentSection) { | ||
const item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/); | ||
if (item) { | ||
const indexOfEqualsSign = line.indexOf("="); | ||
const start = 0; | ||
const end = line.length - 1; | ||
const isAssignment = indexOfEqualsSign !== -1 && indexOfEqualsSign !== start && indexOfEqualsSign !== end; | ||
if (isAssignment) { | ||
const [name, value] = [ | ||
line.substring(0, indexOfEqualsSign).trim(), | ||
line.substring(indexOfEqualsSign + 1).trim(), | ||
]; | ||
map[currentSection] = map[currentSection] || {}; | ||
map[currentSection][item[1]] = item[2]; | ||
map[currentSection][name] = value; | ||
} | ||
@@ -25,0 +32,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { __values } from "tslib"; | ||
import { __read, __values } from "tslib"; | ||
var profileNameBlockList = ["__proto__", "profile __proto__"]; | ||
@@ -10,6 +10,6 @@ export var parseIni = function (iniData) { | ||
var line = _c.value; | ||
line = line.split(/(^|\s)[;#]/)[0]; | ||
var section = line.match(/^\s*\[([^\[\]]+)]\s*$/); | ||
if (section) { | ||
currentSection = section[1]; | ||
line = line.split(/(^|\s)[;#]/)[0].trim(); | ||
var isSection = line[0] === "[" && line[line.length - 1] === "]"; | ||
if (isSection) { | ||
currentSection = line.substring(1, line.length - 1); | ||
if (profileNameBlockList.includes(currentSection)) { | ||
@@ -20,6 +20,13 @@ throw new Error("Found invalid profile name \"".concat(currentSection, "\"")); | ||
else if (currentSection) { | ||
var item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/); | ||
if (item) { | ||
var indexOfEqualsSign = line.indexOf("="); | ||
var start = 0; | ||
var end = line.length - 1; | ||
var isAssignment = indexOfEqualsSign !== -1 && indexOfEqualsSign !== start && indexOfEqualsSign !== end; | ||
if (isAssignment) { | ||
var _d = __read([ | ||
line.substring(0, indexOfEqualsSign).trim(), | ||
line.substring(indexOfEqualsSign + 1).trim(), | ||
], 2), name = _d[0], value = _d[1]; | ||
map[currentSection] = map[currentSection] || {}; | ||
map[currentSection][item[1]] = item[2]; | ||
map[currentSection][name] = value; | ||
} | ||
@@ -26,0 +33,0 @@ } |
{ | ||
"name": "@aws-sdk/shared-ini-file-loader", | ||
"version": "3.109.0", | ||
"version": "3.110.0", | ||
"dependencies": { | ||
@@ -8,3 +8,3 @@ "tslib": "^2.3.1" | ||
"devDependencies": { | ||
"@aws-sdk/types": "3.109.0", | ||
"@aws-sdk/types": "3.110.0", | ||
"@tsconfig/recommended": "1.0.1", | ||
@@ -11,0 +11,0 @@ "@types/node": "^10.0.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
59046
505