Bug
--format table derives its columns from only the first object in an array. If later rows contain additional fields, those values are silently omitted from the table output.
In src/output.ts:
const keys = Object.keys(data[0] as Record<string, unknown>)
That works for homogeneous arrays, but OpenSea API responses can include optional fields that differ between items. In that case the CLI makes the later-row data look absent even though it is present in the JSON response.
Reproduction
formatOutput(
[
{ name: "CryptoPunk #1", price: "10 ETH" },
{ name: "Bored Ape #2", price: "5 ETH", rarity: "Rare" },
],
"table",
)
Expected: the table includes a rarity column and shows Rare on the second row.
Actual: the table only includes name and price, because rarity is not present on the first item.
Suggested fix
Build the table header from the union of keys across all object rows, preserving first-seen order. Homogeneous arrays keep the same output, while heterogeneous arrays no longer lose later-row fields.
Bug
--format tablederives its columns from only the first object in an array. If later rows contain additional fields, those values are silently omitted from the table output.In
src/output.ts:That works for homogeneous arrays, but OpenSea API responses can include optional fields that differ between items. In that case the CLI makes the later-row data look absent even though it is present in the JSON response.
Reproduction
Expected: the table includes a
raritycolumn and showsRareon the second row.Actual: the table only includes
nameandprice, becauserarityis not present on the first item.Suggested fix
Build the table header from the union of keys across all object rows, preserving first-seen order. Homogeneous arrays keep the same output, while heterogeneous arrays no longer lose later-row fields.