-
-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Milestone
Description
Current behaviour
As of 3.7.0 the change to casted values is returning undefined which is not ideal and problematic with implementations where primitives should not be stringified.
Expected behaviour
Result should be empty string.
Reproduction Example
In the below example, foo is undefined, but it is not ansis job to cast that, failing silently is far better imo as per the previous versions. The argument for type checking before printing can also be a nuance because it is assumed behaviour based on alternative libs.
import ansis from 'ansis';
export const { cyan } = ansis
// assuming i have a function
const someFn = (foo) => cyan(foo)
someFn() // undefined is printedAdditional context
While the logic is good in theory, in practice it is not ideal.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request