Skip to content

Commit

Permalink
fix(cli): Account for non-array in pindata migration (#3938)
Browse files Browse the repository at this point in the history
🗃️ Account for non-array in pindata migration
  • Loading branch information
ivov authored Aug 25, 2022
1 parent 4f875ff commit f052187
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ function makeUpdateParams(fetchedWorkflows: PinData.FetchedWorkflow[]) {

const newPinDataPerWorkflow = Object.keys(pinDataPerWorkflow).reduce<PinData.New>(
(newPinDataPerWorkflow, nodeName) => {
const pinDataPerNode = pinDataPerWorkflow[nodeName];
let pinDataPerNode = pinDataPerWorkflow[nodeName];

if (!Array.isArray(pinDataPerNode)) {
pinDataPerNode = [pinDataPerNode];
}

if (pinDataPerNode.every((item) => item.json)) return newPinDataPerWorkflow;

Expand Down

0 comments on commit f052187

Please sign in to comment.