Automattic / Automattic/cli-table

.toString() throws error when new Table was instanciated with "head" prop as undefined.

Open
#178 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.3k
Forks
141
PR merge metrics
No merged PRs in 30d

Description

The interface for ```TableOptions``` suggests that is it is valid to pass the constructor options head property as undefined, as if it were not passed at all - standard JS/TS practice.

Unfortunately this causes the ```.toString()``` method to throw an error since it does not appear to be checking whether the head options property isn't undefined.

I think this should just require a quick gaurd to ensure this is handled correctly?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.