Skip to content

Commit

Permalink
fix for list types in Fn::Join
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacobsson committed Dec 7, 2020
1 parent 7b0a145 commit 150350a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mhlabs/cfn-diagram",
"version": "1.1.8",
"version": "1.1.9",
"description": "CLI tool to visualise CloudFormation templates as draw.io or HTML diagrams",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions resources/JsonUtil.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
function createPseudoResources(template, current) {
current = current || template;
current = current || template.Resources;
for (var k in current) {
if (current[k]["Fn::Join"]) {
current[k] = current[k]["Fn::Join"][1].join(current[k]["Fn::Join"][0]);
const joinList = current[k]["Fn::Join"][1]
current[k] = (Array.isArray(joinList) ? joinList : [joinList]).join(current[k]["Fn::Join"][0]);
}
if (typeof current[k] === "object" && current[k] !== null) {
createPseudoResources(template, current[k]);
Expand Down

0 comments on commit 150350a

Please sign in to comment.