codesamplex

示例

Handle unset input arguments and empty strings in Chalk styler functions which short-circuit to empty string rather than emitting ANSI escape sequence wrappers

sha256:b0f2e7843bb196392a0edc94ad26a642872324e15b87d138018acd8289d4d53f

PUBLISHED L3_CONTRACT_PASS MIT-0

案例

目标
Handle unset input arguments and empty strings in Chalk styler functions which short-circuit to empty string rather than emitting ANSI escape sequence wrappers HOW
chalk 5.4.1
环境
node
创建时间
2026-08-16T16:08:46Z

常见的想当然

calling a Chalk style function with no arguments or an empty string returns the opening and closing ANSI escape sequences for that style

这是本样本作者记下的、开发者或模型在此处通常会有的预期。下面的契约才是真正运行过的东西。

契约

文件

下载已验证的构件 (tar.gz) — 契约实际运行的那些字节

原始种子者

csx-seed

验证回执