function convertColumnAttributesToCamelCase()

in transcriptTransformationScript.js [69:104]


function convertColumnAttributesToCamelCase(currEntry) {
    if (currEntry['type'] === 'message') {
        if (currEntry.hasOwnProperty("attachments")) {
            const attachments = currEntry["attachments"];
            attachments.forEach(attachment => {
                if (attachment.hasOwnProperty("content")) {
                    const content = attachment["content"];
                    if (content.hasOwnProperty("body")) {
                        const contentBody = content["body"][0];
                        if (contentBody.hasOwnProperty("items")) {
                            const bodyItems = contentBody["items"];
                            bodyItems.forEach(bodyItem => {
                                if (bodyItem.hasOwnProperty("columns")) {
                                    const columns = bodyItem["columns"];
                                    columns.forEach(column => {
                                        if (column.hasOwnProperty("items")) {
                                            const colItems = column["items"];
                                            const attributesToEdit = ["size", "weight", "color", "horizontalAlignment", "spacing"];
                                            colItems.forEach(colItem => {
                                                attributesToEdit.forEach(attr => {
                                                    if (colItem.hasOwnProperty(attr)) {
                                                        colItem[attr] = colItem[attr].charAt(0).toLowerCase() + colItem[attr].slice(1, colItem[attr].length);
                                                    }
                                                });
                                            });
                                        }
                                    });
                                }
                            });
                        }
                    }
                }
            });
        }
    }
}