-
Notifications
You must be signed in to change notification settings - Fork 229
Proposal: URL/URI Helper Functions #103
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
Can't you simply add these via |
@xogeny You could register these functions however they encompase pretty standard functionality that one would want in most places which is why adding them to the set of built-in functions would be pretty desireable IMO. |
Do you think this could be addressed by having a plugin system for registering functions in bulk? That way, people could pick and choose what "libraries" of functions they wanted to have pre-defined in their application and it could even provide a mechanism to provide such libraries as packages in |
A plugin system could be a useful JSONata feature. My thoughts:
|
All good comments. Regarding your last point, the issue is really just making sure the global namespace doesn't get too polluted. One could say "I can't think of a use cases in which a user wouldn't want ... mongodb/fetch/node/DOM/whatever ...functions to be available". But you make a good point that these are native to Javascript and don't introduce dependencies. |
@xogeny - I think the idea of a plugin system is a good one. Please could you raise a separate issue outlining your proposal (especially the external API)? Many thanks. @jhorbulyk - I'm always open to adding more functions that are of genuine use to (at least) more than one user, and these might qualify on that. However, just because they are in the underlying Javascript language won't help the groups that are currently implementing JSONata in Java and Golang (plus any potential future implementors in other host languages). That is one of the reasons why this implementation has no dependencies on other packages. |
Thinking about this more, I think there are two ways a "plugin" system could operate. It could either be used to add functions, in bulk, to an existing expression (essentially just invoking |
Resolved by #357 |
It would be useful if the following JavaScript string operators were exposed to JSONata:
encodeURIComponent()
encodeURI()
decodeURI()
decodeURIComponent()
This functionality would be useful in order to write transformations which produce or consume URLs/URIs. Would adding such functionality be in the spirit of the library's intended purposes?
The text was updated successfully, but these errors were encountered: