Skip to content

Commit 22e4bb2

Browse files
Copilotaaronpowell
andcommitted
Fix YAML parsing logic bug: replace impossible condition with proper indentation check
Co-authored-by: aaronpowell <[email protected]>
1 parent 188d344 commit 22e4bb2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

update-readme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function parseCollectionYaml(filePath) {
167167
} else if (currentObject && leadingSpaces > 0) {
168168
// Property of current object (e.g., display properties)
169169
currentObject[key] = value === "true" ? true : value === "false" ? false : value;
170-
} else if (currentArray && currentObject && leadingSpaces > leadingSpaces) {
170+
} else if (currentArray && currentObject && leadingSpaces > 2) {
171171
// Property of array item object
172172
currentObject[key] = value;
173173
}

validate-collections.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function parseCollectionYaml(filePath) {
9999
} else if (currentObject && leadingSpaces > 0) {
100100
// Property of current object (e.g., display properties)
101101
currentObject[key] = value === "true" ? true : value === "false" ? false : value;
102-
} else if (currentArray && currentObject && leadingSpaces > leadingSpaces) {
102+
} else if (currentArray && currentObject && leadingSpaces > 2) {
103103
// Property of array item object
104104
currentObject[key] = value;
105105
}

0 commit comments

Comments
 (0)