Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot combine pre-transform with optional #44

Open
EpicEricEE opened this issue Jul 25, 2024 · 3 comments
Open

Cannot combine pre-transform with optional #44

EpicEricEE opened this issue Jul 25, 2024 · 3 comments

Comments

@EpicEricEE
Copy link

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

@EpicEricEE
Copy link
Author

Oops, just saw that #33 was closed yesterday.

@EpicEricEE EpicEricEE closed this as not planned Won't fix, can't repro, duplicate, stale Jul 25, 2024
@jamesrswift
Copy link
Member

Would adding an option to skip pre-transforms if defaulted by amenable?

@jamesrswift jamesrswift reopened this Jul 26, 2024
@EpicEricEE
Copy link
Author

I'm not familiar with the package as this my first time using it, so I don't really have an opinion on that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants