Beispiel
Handle the Luxon 3 major revision switch where the 'system' zone strictly targets the host operating system zone rather than Settings.defaultZone and 'default' must be used to track the configured default zone.
sha256:987b2b10535353b41b868e879713086cc13b579f48946a42ada763c26ecf0b2a
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Handle the Luxon 3 major revision switch where the 'system' zone strictly targets the host operating system zone rather than Settings.defaultZone and 'default' must be used to track the configured default zone. HOW
- Pakete
- luxon 3.7.2
- Umgebung
- node
- Erstellt
- 2026-08-17T01:57:36Z
Häufige Annahme
Configuring Settings.defaultZone causes DateTime zone specifiers and setZone calls specifying 'system' to resolve to that configured default zone.
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
- When Settings.defaultZone is overridden, Info.normalizeZone('system') and DateTime.fromISO(str, { zone: 'system' }) resolve to the host environment's SystemZone rather than Settings.defaultZone, while 'default' resolves to Settings.defaultZone instead of creating an invalid DateTime.
- Info.normalizeZone('system') equals SystemZone.instance and does not equal Settings.defaultZone when defaultZone is changed
- Info.normalizeZone('default') equals Settings.defaultZone and is valid
- DateTime.fromISO with zone 'system' produces a valid DateTime with zoneName equal to SystemZone.instance.name rather than Settings.defaultZone
- DateTime.fromISO with zone 'default' produces a valid DateTime with zoneName equal to Settings.defaultZone
- DateTime#setZone('system') resets zone to SystemZone.instance.name while DateTime#setZone('default') resets zone to Settings.defaultZone
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-17 · ed25519:d91480838ac982c9