Skip to content
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

Allow addition of custom functions via decorate() #61

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

darrenmothersele
Copy link

This pull request contains various fixes I have made:

  • npm audit fix
  • allow addition of custom functions
  • allow caching of compiled expressions
  • a couple of minor changes proposed in other PRs

The main difference is that I've added a decorate() function.

The decorate function allows you to add entries to the runtime's built in function table. The return value from this decorate function is a curried function (takes arguments one at a time) that takes the search expression and then the data to search. Because it's curried it means you can cache the parsed expression and run it against multiple data sets.

PR includes basic tests for the decorate() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant