- Added negated equality assertions for comparative and length. (#40)
- Added schema generators for: angle, bytes, direction, fraction, function, label, length, location, plugin, ratio, relative, regex, selector, stroke, symbol, and version
- Valkyrie is now distributed under the MIT license rather than GPL-3.0-only.
- Number schema generator now takes additional optional parameters
min
andmax
which a sugar for value assertions. These changes also apply to number specializations such asfloat
andinteger
- String schema generator now takes additional optional parameters
min
andmax
which a sugar for value length assertions. These changes also apply to number specializations such asemail
andip
- Array schema generator now takes additional optional parameters
min
andmax
which a sugar for value length assertions. - Added schema generator for argument sinks. Takes
positional
andnamed
as optional parameters that take schema types. Absence of one of these parameters indicate that these must also be absent from the argument type being validated. - (Potentially Breaking) Content now accepts
symbol
as a valid input type by default (see #20) - (Potentially Breaking) If the tested value is
auto
, parsing no longer fails. Ifdefault
is set, it takes the default value. Ifoptional
is set but notdefault
, value is parsed asnone
. - (Potentially Breaking)
tuple
has a new parameterexact
which defaults to true, whereby the length of a tuple must match exactly to be valid.
Valkyrie
is now a community-lead project and is now homed on the typst-community organisation.
Boolean
validation typeContent
validation type. Also accepts strings which are coerced into content types.Color
validation type.Optional
validation type. If a schema yields a validation error, the error is suppressed and the returned value is 'auto'Choice
validation type. Tested value must be contained within the listed choices.Date
validation type.- Dictionaries can now provide a list of aliases for members.
- Dictionaries can now be coerced from values
- Arrays can be coerced from singular values.
- (Breaking) Schema generator function arguments are now uniform. Types are all now effectively a curried form of
base-type
. A table is provided in the manual to document these arguments. - (Breaking)
transform
argument has been replaced withpre-transform
(applied prior to validation), andpost-transform
(applied after validation). - (Breaking) Dictionaries now take the schema definition of members as a dictionary in the first positional argument rather than a sink of named arguments.
- (Breaking)
strict
contextual flag is now applied on the type level rather than directly in the parse function. It is currently only applied in the dictionary type, and will cause an assertion to fail if s - (Breaking) Dictionaries default to empty dictionaries rather than none.
- (Potentially breaking) Dictionaries that don't have a member that is present in the schema no longer produce an error outside of
strict
contexts. - (Potentially breaking)
strict
contextual flag is now applied on the type level rather than directly in the parse function. It is currently only applied in the dictionary type, and will cause an assertion to fail if set totrue
when object being validated contains keys unknown to the schema. - (Breaking) Assertions on values have been moved from named arguments to assertion generator functions.
- Dictionary schema definitions will need additional braces to account for a change in the API layout
transform
is nowpre-transform
, and can be used to coerce values into types- Assertions regarding the value being validated (length, magnitude, regex match) have now been moved from being named arguments to being passed in the
assertions
argument as an array.
- fixed syntax error in Typst 0.11+ because of internal context type
Initial Release