We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
{"foo" | bar}
where bar would be a function that was passed as an option to the compiler.
bar
await compile('{"foo" | bar}', { filters: { bar (value) { return value + "bar" } })
The text was updated successfully, but these errors were encountered:
There is no problem when custom filter is named:
let template = await compile('{foo | myFilter}', { filters: { myFilter: function myFilter (text) { return text.toUpperCase() } } })
In case when someone defined function as anonymous or arrow fn then we cannot create AST.
In first example we received error Function declaration must have a name in this context
Function declaration must have a name in this context
filters: { myFilter: function () {} }
For this case we can return a new Function an append the name.
I think that more complex is handling arrow functions.
Babel has some plugins which can be used via node (transform-function-name, plugin-transform-arrow-functions)
Sorry, something went wrong.
No branches or pull requests
where
bar
would be a function that was passed as an option to the compiler.The text was updated successfully, but these errors were encountered: