formatParams = (params) => {
let literal = "";
let previousParam = null;
for (const currentParam of params) {
if (currentParam.optional) {
literal += "[";
}
if (previousParam !== null) {
literal += ", ";
}
literal += `<i>${currentParam.name}`;
if (currentParam.default !== undefined) {
literal += ` = ${currentParam.default}`;
}
literal += "</i>"
previousParam = currentParam;
}
const openSquareBracketCount = literal.split("[").length - 1;
if (openSquareBracketCount > 0) {
literal += "]".repeat(openSquareBracketCount);
}
return literal;
}