-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
Export LiquidExpression
class or evalExpression
to evaluate single expressions
#527
Comments
LiquidExpression
class to evaluate single expressionsLiquidExpression
class or evalExpression
to evaluate single expressions
Thank you for digging into the codebase and provide the snippet! There was a keepOutputType option to allow Actually Lines 263 to 268 in e874b40
|
Thanks! Do you think exposing this as a simple |
Makes sense! But |
It looks like you've been unhappy with the name for at least four years (#58), but it's up to you if you want to deprecate
That does sound even more confusing if we add a flag or something to Maybe |
I agree with you that adding a flag to
Currently The concept of |
I see, sounds good. I clearly don't know enough about the internals 😄 |
# [9.41.0](v9.40.0...v9.41.0) (2022-08-24) ### Features * use evalValue to parse & render expression, [#527](#527) ([071368a](071368a))
I find
Lines 269 to 278 in 071368a
|
That's amazing! Was playing with it to see if it fully solves my use-case and opened #533 for that |
First of all thanks for creating and maintaining LiquidJS. I needed a white space sensitive generic templating language that is not tied to HTML and LiquidJS does exactly that.
Now I have a requirement that I think this library could very easily fulfill as well. You are probably aware how GitHub actions allows using templating and conditions inside YAML. E.g.
or
I have a very similar requirement (not sure yet if it will use YAML as well). Since I am already using LiquidJS I would love to use the same semantics here as well. But Instead of rendering a template and getting a string as a result I would need LiquidJS to evaluate a single expression and return the value as is (boolean, number, etc.). It would look like this:
I've been poking around the docs and code and I think what I want is a more ergonomic way of doing this?
liquidjs/test/unit/render/expression.ts
Lines 10 to 12 in 753e8f9
Maybe add
evalExpression
analogous toevalValue
?The text was updated successfully, but these errors were encountered: