Skip to content

Commit ee911ec

Browse files
authored
fix(cfnspec): incorrectly handling array result from jsondiff (backport #23795) (#23800)
This is an automatic backport of pull request #23795 done by [Mergify](https://mergify.com). --- <details> <summary>Mergify commands and options</summary> <br /> More conditions and actions can be found in the [documentation](https://docs.mergify.com/). You can also trigger Mergify actions by commenting on this pull request: - `@Mergifyio refresh` will re-evaluate the rules - `@Mergifyio rebase` will rebase this PR on its base branch - `@Mergifyio update` will merge the base branch into this PR - `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch Additionally, on Mergify [dashboard](https://dashboard.mergify.com/) you can: - look at your merge queues - generate the Mergify configuration with the config editor. Finally, you can contact us on https://mergify.com </details>
1 parent d0a750b commit ee911ec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/@aws-cdk/cfnspec/build-tools/spec-diff.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ async function main() {
237237
if (Array.isArray(update)) {
238238
changes.push(`* ${namespace} ${prefix} (__changed__)`);
239239
for (const entry of update) {
240+
if (entry.length === 1 && entry[0] === ' ') {
241+
// This means that this element of the array is unchanged
242+
continue;
243+
}
240244
if (entry.length !== 2) {
241245
throw new Error(`Unexpected array diff entry: ${JSON.stringify(entry)}`);
242246
}
@@ -247,7 +251,7 @@ async function main() {
247251
case '-':
248252
throw new Error(`Something awkward happened: ${entry[1]} was deleted from ${namespace} ${prefix}!`);
249253
case ' ':
250-
// This entry is "context"
254+
// This entry is "context"
251255
break;
252256
default:
253257
throw new Error(`Unexpected array diff entry: ${JSON.stringify(entry)}`);

0 commit comments

Comments
 (0)