Repository navigation
v2.12.0
Breaking!
- Drop support for TypeScript < 5.0
- Only
.decode(),.verify(), and.value()can still be called when detached from their decoder (e.g.const { transform } = stringno longer works). This is unlikely to affect you.
Fixes:
- Fix
oneOf()losing its literal types when nested inside another decoder, no moreas constneeded:// ✅ This was already correct before... oneOf(['a', 'b']); // Decoder<'a' | 'b'> // ...but now this is also correct (no longer needs `as const`) optional(oneOf(['a', 'b'])); // Before: ❌ Decoder<string | undefined> // Now: ✅ Decoder<'a' | 'b' | undefined>
Performance:
- Decoders take ~68% less memory and are ~4x faster to construct.
- The
~standardAPI is only built on-demand.