샘플
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
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- chalk.red() with an unset argument returns an empty string with no escape codes rather than the styled empty wrapper \u001b[31m\u001b[39m
- assert chalk.red('') returns an empty string without ANSI escape codes
- assert passing explicit undefined to chalk.red(undefined) coerces to literal string '\u001b[31mundefined\u001b[39m'
- assert passing numeric 0 or boolean false coerces each value to string and applies ANSI styling
- assert multi-argument styling joins arguments with a single space delimiter before applying ANSI codes
- assert chalk.visible returns an empty string when color level is 0 instead of falling back to plain text
파일
- NOTES.md
- csx.json
- package-lock.json
- package.json
- src/index.mjs
- test/contract.mjs
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9