I'm using json2md like this:
json2md([
{ h1: "Table" },
{
table: {
headers: ["id", "name", "active"],
rows: [
{
id: 1,
name: "token-0123456789",
active: false,
},
{
id: 2,
name: "token-9876543210",
active: true,
},
],
pretty: true,
},
},
]);
Strings and numbers work, but boolean values are ignored, the output is:
# Table
| id | name | active |
| --- | ---------------- | ------ |
| 1 | token-0123456789 | |
| 2 | token-9876543210 | |
Expected output:
# Table
| id | name | active |
| --- | ---------------- | ------ |
| 1 | token-0123456789 | false |
| 2 | token-9876543210 | true |
Editing file index.js:54 fixes the problem for me, but I'm not sure if this is the right approach:
- if (typeof data === "string" || typeof data === "number") {
+ if (typeof data === "string" || typeof data === "number" || typeof data === "boolean") {
I'm using
json2mdlike this:Strings and numbers work, but boolean values are ignored, the output is:
Expected output:
Editing file
index.js:54fixes the problem for me, but I'm not sure if this is the right approach: