Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions actions/setup/js/json_object_to_markdown.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function formatValue(value) {
* Convert a plain JavaScript object to Markdown bullet points.
* Nested objects and arrays are rendered as indented sub-lists.
*
* @param {Record<string, unknown>} obj - The object to render
* @param {object} obj - The object to render
* @param {number} [depth=0] - Current indentation depth
* @returns {string} - Markdown bullet list string
*/
Expand All @@ -60,15 +60,15 @@ function jsonObjectToMarkdown(obj, depth = 0) {
lines.push(`${indent}- **${label}**:`);
for (const item of value) {
if (typeof item === "object" && item !== null) {
lines.push(jsonObjectToMarkdown(/** @type {Record<string, unknown>} */ item, depth + 1));
lines.push(jsonObjectToMarkdown(item, depth + 1));
} else {
lines.push(`${" ".repeat(depth + 1)}- ${String(item)}`);
}
Comment on lines 61 to 66
}
}
} else if (typeof value === "object" && value !== null) {
lines.push(`${indent}- **${label}**:`);
lines.push(jsonObjectToMarkdown(/** @type {Record<string, unknown>} */ value, depth + 1));
lines.push(jsonObjectToMarkdown(value, depth + 1));
} else {
const formatted = formatValue(value);
lines.push(`${indent}- **${label}**: ${formatted}`);
Expand Down
Loading