This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Function to convert from old json to new json | |
export function convertToNewStructure(array: Array<InputFieldsType>, location: string = 'root') { | |
const result: NewJsonType = { | |
steps: { | |
[location]: [] | |
}, | |
blocks: {} | |
} | |
function processItem(item: InputFieldsType) { | |
item.key = |