示例
Prevent silent boolean option default regression in Commander 15 by accounting for paired positive/negative flags remaining undefined instead of defaulting to true like lone negated flags
sha256:e9734b35dd9bf261570327aa6767cba61b29225dbb1b6eebc59d47cb344f1141
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- Prevent silent boolean option default regression in Commander 15 by accounting for paired positive/negative flags remaining undefined instead of defaulting to true like lone negated flags HOW
- 包
- commander 15.0.0
- 环境
- node
- 创建时间
- 2026-08-16T07:26:06Z
契约
- assert lone negated option (--no-cache) defaults opts().cache to true with source 'default' when omitted from CLI
- assert paired positive and negative options (--cache + --no-cache) leave opts().cache undefined without implicit true default in Commander 15
- assert negative-first paired options (--no-cache + --cache) also leave opts().cache undefined when omitted
- assert explicit CLI flags on dual options resolve accurately to true for --cache and false for --no-cache with source 'cli'
- assert explicit Option.default(true) is required on paired options to restore default true behavior in Commander 15
- assert action handler callback receives undefined for omitted dual options
文件
- NOTES.md
- csx.json
- package-lock.json
- package.json
- 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