-
Notifications
You must be signed in to change notification settings - Fork 7
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
how to add custom operator with logic ? #52
Comments
Was self resolved. I was always looking at I read the README and realized that I should use |
Sorry for the confusion @TBSten , but glad you figured it out! I'll try to update the readme with some better examples for extending functionality and your use case would be a great example 🙂 |
Can now call `JseEval.registerPlugin` (same as `JseEval.jsep.plugins.register(...)`). This method will now look at the plugin argument(s) and check for `init()` to call `jsep.plugins.register`, as well as look for `initEval()` to call that method so it can extend JseEval as needed. Updated ReadMe to add more extension examples Fixes #52
Can now call `JseEval.registerPlugin` (same as `JseEval.jsep.plugins.register(...)`). This method will now look at the plugin argument(s) and check for `init()` to call `jsep.plugins.register`, as well as look for `initEval()` to call that method so it can extend JseEval as needed. Added one-line parse + evaluate, `evalExpr(expressionString, context)` and `evalExprAsync()`. Made `context` optional for expressions like `1 + 2` which don't require a context. Updated ReadMe to add more extension examples Fixes #52
# [1.3.0](v1.2.0...v1.3.0) (2022-03-13) ### Features * add `registerPlugin` method ([86939ac](86939ac)), closes [#52](#52)
🎉 This issue has been resolved in version 1.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thank you for your response! |
I want to add custom operator with logic .
For example ,
In this example, I want it to return 1024, which is 2 to the 10th power, like the "^" operator in Excel.
I tried creating an original plugin like below .
However, I don't know where to write the essential logic of "finding exponentiation".
Please tell me how to add a custom operator with logic
The text was updated successfully, but these errors were encountered: