/** * Protocol parsing functions. * * @author n1474335 [n1474335@gmail.com] * @copyright Crown Copyright 2022 * @license Apache-2.0 */ import BigNumber from "bignumber.js"; import {toHexFast} from "../lib/Hex.mjs"; /** * Recursively displays a JSON object as an HTML table * * @param {Object} obj * @returns string */ export function objToTable(obj, nested=false) { let html = `
Field | Value | |
---|---|---|
${key} | `; if (typeof obj[key] === "object") html += `${objToTable(obj[key], true)} | `; else html += `${obj[key]} | `; html += "