v0.3.0
Pre-release-
Fix regression: Forbid bare schema in which a type is repeated in an union
The following schema is now correctly reported as invalid:
type X (u8 | u8) -
Deduplicate readers and writers of complex non-aliased types
@bare-ts/tools generates readers and writers for complex non-aliased types.
These reader and writer are now de-duplicated. -
Default to null instead of undefined for optional types
The use of
nullseems more common than the use ofundefined.The option
--use-nullis removed.
A new option--use-undefinedis added. -
Make configurable the emitted type for void type
BARE schema enable use of void types in unions. For example:
type Union (u8 | void)Previously, @bare-ts/tools emitted the type
undefinedforvoid.
Now it relies on options--use-undefinedand--use-lax-optionalto
choose betweennull,undefined, andnull | undefined.
Note that these options also modify the emitted types for optionals. -
Support for quoted properties
The option
--use-quoted-propertyenables to output
quoted properties instead of unquoted properties.This can be useful when using a JS minifier that differently handles
quoted and unquoted properties.