Ejemplo
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
Caso
- Objetivo
- Verify how @babel/preset-env resolves input domain edges across empty target queries, numeric target versions, and regex feature filters HOW
- Paquetes
- @babel/preset-env 8.0.2 @babel/core 8.0.1
- Entorno
- node
- Creado
- 2026-08-16T17:26:03Z
Lo que suele suponerse
Setting targets to an empty array [] behaves identically to an empty object {} by defaulting to the standard baseline and leaving modern syntax untranspiled.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- 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.
Archivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9