Exemple
Prove that Commander 10 does not normalize leading whitespace in `.arguments()` signatures, which changes required positional argument behavior.
sha256:f5f99fd68dd8d58f64b485d0f9975aae0947b6d0dce1125646115bb8c16ba5a0
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- Prove that Commander 10 does not normalize leading whitespace in `.arguments()` signatures, which changes required positional argument behavior. HOW
- Paquets
- commander 10.0.0
- Environnement
- node
- Créé
- 2026-08-17T03:16:09Z
Ce que l'on suppose souvent
A leading space before a positional signature is ignored by Commander, so `program.arguments(' <name>')` is equivalent to `program.arguments('<name>')`.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- In Commander 10, a leading-space argument signature is not ignored, so parsing `['node', 'app', 'only']` with `new Command().arguments(' <required> [optional]')` throws `commander.missingArgument` and does not accept a single positional argument.
- assert.equal(error.code, 'commander.missingArgument')
- assert.match(error.message, /missing required argument/)
Fichiers
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9