denoland / denoland/std

Allow color functions to receive a parameter of any type

Open
#6,869 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

**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:

```ts
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.