vapor / leaf-kit

🍃 An expressive, performant, and extensible templating language built for Swift.
https://docs.vapor.codes/4.0/leaf/getting-started
MIT License
49 stars 38 forks source link

Add requirement methods to LeafContext #37

Closed tonyarnold closed 4 years ago

tonyarnold commented 4 years ago

Adds methods to LeafContext to verify the existence, or non-existence of a context body, as well as to verify the context contains a specific number of parameters.

tonyarnold commented 4 years ago

I've had to strip all of the stack trace and source location information from the LeafKitError type - although to be honest, I'm not sure that this information was necessarily useful, given that it didn't resolve to locations inside the templates themselves.

There's room for improvement here.

tonyarnold commented 4 years ago

Belay that, I noticed everything else is throwing descriptive strings: let's just use that for now.

tanner0101 commented 4 years ago

These changes are now available in 1.0.0-rc.1.3