-
-
Notifications
You must be signed in to change notification settings - Fork 238
type checking for Hash values? #158
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
Comments
Try |
it seems to be exactly what I needed 🎉 I changed it to the following async parse(tagToken, context) {
const { default: _default, ...rest } = await Hash.create(tagToken.args, context);
this.defaultValue = _default;
console.log(_default, { type: typeof _default });
} Input
Output 🔥
many thanks ! |
@harttle it seems like is it possible to achieve the same thing using the new API ? thanks |
# [9.15.0](v9.14.1...v9.15.0) (2020-08-04) ### Features * export toPromise and toValue, see [#158](#158) ([2e5ab98](2e5ab98))
It's still there but a bit different, I exported a const { Context, Hash, toPromise } = require('liquidjs')
const hash = new Hash('foo:bar')
const ctx = new Context({bar: 'BAR'})
// Outputs:
// { foo: 'BAR' }
toPromise(hash.render(ctx)).then(console.log)
// or `toValue` to render syncly |
I have a custom tag
the definition I have is like this
current output:
expected
Am I doing something wrong? is there a better way to do this ?
The text was updated successfully, but these errors were encountered: