UNPKG

@broadcom/jclcheck-for-zowe-cli

Version:

JCLCheck Plug-in for Zowe CLI

62 lines 2.65 kB
"use strict"; /** * Copyright (c) 2023. Broadcom. All rights reserved. * * This software and all information contained therein is confidential and * proprietary and shall not be duplicated, used, disclosed or disseminated * in any way except as authorized by the applicable license agreement, * without the express written permission of BROADCOM. All authorized reproductions * must be marked with this language. * * EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO THE EXTENT * PERMITTED BY APPLICABLE LAW, BROADCOM PROVIDES THIS SOFTWARE WITHOUT * WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED * WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN * NO EVENT WILL BROADCOM BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY * LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS SOFTWARE, * INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, * GOODWILL, OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED OF SUCH LOSS OR * DAMAGE. * * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * **/ Object.defineProperty(exports, "__esModule", { value: true }); exports.ResponseParser = void 0; class ResponseParser { static buildJobReportOutput(jobReport) { const table = []; const report6 = jobReport.reports.report6; if (report6 != null && report6.statementMessages != null) { Object.keys(report6.statementMessages).forEach((key) => { for (const msg of report6.statementMessages[key].messages) { const entry = { Stmnt: key, ID: msg.messageId, Msg: msg.messageText, }; if (jobReport.reports.report2 != null) { entry.Statement = jobReport.reports.report2.jclStatements[key].lines.join("\n"); entry.Sev = jobReport.reports.report2.jclStatements[key].errorSev; } table.push(entry); } }); } return table; } static formatMessage(message, removeFormatting = false) { const table = []; Object.keys(message).forEach((key) => { const msg = (removeFormatting) ? message[key].toString().split("\n").join(" ").split("\t").join(" ") : message[key]; const entry = { label: key, value: msg }; table.push(entry); }); return table; } } exports.ResponseParser = ResponseParser; //# sourceMappingURL=ResponseParser.js.map