Beispiel
prove that transpiling a named capture group regex mutates its serialization shape by stripping the named groups from its .source property, even though evaluation semantics are preserved
sha256:15dd17f193ef111f72ee349d6af1c3b8051e9157c5ba59126ce65b3d88afd6d1
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- node
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- node
- Sprache
- node
- Paketmanager
- npm
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- node 22
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- node 22
- Sprache
- javascript
- Paketmanager
- npm
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17
Fall
- Ziel
- prove that transpiling a named capture group regex mutates its serialization shape by stripping the named groups from its .source property, even though evaluation semantics are preserved HOW
- Pakete
-
@babel/preset-env 7.29.7
- Umgebung
- node
- Erstellt
- 2026-08-17T06:38:36Z
Häufige Annahme
a regular expression with named capture groups compiled by Babel will preserve the exact syntactic shape of the pattern in its .source property
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
- the .source property of a named capture group regex transpiled for IE11 evaluates to a string stripped of the capture group names, rather than the original source string
- assert.strictEqual(nativeRegex.source, '(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})');
- assert.strictEqual(transpiledRegex.source, '(\\d{4})-(\\d{2})-(\\d{2})');
Dateien
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test.mjs
- test/contract.mjs
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- node 22 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9