Skip to content

Allow color functions to receive a parameter of any type #6869

@acrodrig

Description

@acrodrig

Is your feature request related to a problem? Please describe.

Is is slightly annoying to have to call toString on parameters that are not original string when using colors. For example, you cannot do:

console.log(red(new Date());

As date is not a string. Ideally red accepts anything and converts it to its string representation using toString.

Describe the solution you'd like

Add a string conversion internally if the parameters is not a string.

Describe alternatives you've considered

Not really any alternatives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions