Skip to content

Cannot combine pre-transform with optional #44

Description

@EpicEricEE

Suppose I want an optional date as an argument. The code

#import "@preview/valkyrie:0.2.1" as z

#let schema = z.dictionary((
  date: z.date(optional: true, pre-transform: z.coerce.date)
))

#z.parse((date: none), schema)

results in the error Unknown date of type 'none' accepts: datetime, str, int, and object

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions