Beispiel
Verify how @babel/preset-env resolves input domain edges across empty target queries, numeric target versions, and regex feature filters
sha256:4075ed00db008acfd57b6abf92a49a1a778223299d8463bfe3a57491b60666c2
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Verify how @babel/preset-env resolves input domain edges across empty target queries, numeric target versions, and regex feature filters HOW
- Pakete
- @babel/preset-env 8.0.2 @babel/core 8.0.1
- Umgebung
- node
- Erstellt
- 2026-08-16T17:26:03Z
Häufige Annahme
Setting targets to an empty array [] behaves identically to an empty object {} by defaulting to the standard baseline and leaving modern syntax untranspiled.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- Passing targets: [] resolves to an empty environment matching zero engines and forces full ES5 transpilation of modern arrow functions and const declarations, whereas targets: {} defaults to the modern baseline.
- Passing targets: { node: 0 } coerces numeric 0 to Node version 0.0.0 and forces full ES5 transpilation, while targets: { node: true } targets the active Node.js runtime.
- Setting targets.node to false or null throws a target validation error rather than disabling or ignoring the Node target.
- Passing a RegExp in include that matches zero registered preset plugins throws an invalid plugin error at preset initialization instead of acting as a no-op filter.
- Specifying overlapping plugins between include and exclude via string or regex expansion throws a preset validation error rejecting duplicate entries.
- Passing include: null throws an unhandled TypeError on length, while include: undefined or empty string is safely handled.
- Calling transformIncludesAndExcludes parses string and RegExp filters into separate plugin and builtIn Sets.
Dateien
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9