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

Add custom constraint using function and resolve types in scope #142

Merged
merged 1 commit into from
Feb 25, 2015
Merged

Add custom constraint using function and resolve types in scope #142

merged 1 commit into from
Feb 25, 2015

Conversation

raymondfeng
Copy link
Contributor

The PR adds two things:

  1. Allow the constraint to be a JS function in addition to nools expression
  2. Allow type names to be resolved with options.scope

Motivations:

We try to use nools as the rules engine for LoopBack's policy framework. LoopBack has its own JSON format to describe rules/constraints/actions that will be transformed to the formats consumable by nools.

@raymondfeng
Copy link
Contributor Author

@doug-martin Any chance to review this PR?

@ritch
Copy link

ritch commented Feb 24, 2015

👍

@doug-martin
Copy link
Contributor

@raymondfeng Thanks for the PR, Ill take a look tonight and try to get a release out!

@raymondfeng
Copy link
Contributor Author

@doug-martin Thanks!

@superkhau
Copy link

👍

@doug-martin doug-martin merged commit d606e67 into noolsjs:master Feb 25, 2015
doug-martin added a commit to doug-martin/nools that referenced this pull request Feb 25, 2015
* Fix for issue noolsjs#122 referencing defined class within another defined class
   * Also fixes accessing scoped functions within a defined class.
* Fix for issue noolsjs#119 window was removed from the nools.js file now it is called in the current scope of `this`.
* Allow session.halt even for `match()` noolsjs#143 - @raymondfeng
   * Now if you call `halt()` even if you did not call `matchUntilHalt()`
* Now you can use a function as a constraint (Only applies to rules defined programatically) noolsjs#142 - @raymondfeng
* You can now define types using scope [noolsjs#142](noolsjs#142) - @raymondfeng
* Fix for issue, is the dsl you do not have to escape `\` characters noolsjs#123
@doug-martin doug-martin mentioned this pull request Feb 25, 2015
doug-martin added a commit to doug-martin/nools that referenced this pull request Feb 25, 2015
* Fix for issue noolsjs#122 referencing defined class within another defined class
   * Also fixes accessing scoped functions within a defined class.
* Fix for issue noolsjs#119 window was removed from the nools.js file now it is called in the current scope of `this`.
* Allow session.halt even for `match()` noolsjs#143 - @raymondfeng
   * Now if you call `halt()` even if you did not call `matchUntilHalt()`
* Now you can use a function as a constraint (Only applies to rules defined programatically) noolsjs#142 - @raymondfeng
* You can now define types using scope [noolsjs#142](noolsjs#142) - @raymondfeng
* Fix for issue, is the dsl you do not have to escape `\` characters noolsjs#123
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.

4 participants