Allow an array of match
es in the pattern matching rules
#24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows setting multiple matches (a combination of subject, predicate and object) for one definition. The same can be achieved by creating multiple definitions with the same callback/options and a different single match pattern.
Using an object (instead of array) for a
match
is still allowed: this is backwards compatible.This also changes two aspects of how deltas are sent through:
When a delta matches multiple patterns (matches), it will send the same change sets multiple times to the same url, for every match that is in the rules.
When using an array for
match
es, the change set will only be sent once.When using in conjunction with
sendMatchesOnly
, all patterns matching those defined inmatch
es will be sent in one change set together. When not using an array formatch
es, multiple change sets with "one type of match" each would be sent to the url.Note: for ease of merging, this is build further upon #21, which is a PR for a fork. So this PR includes those commits as well (the base can't be set to the fork).
This code change could easily be changed to a change on master, as it changes a function that was only moved in #21.
The actual changes for this PR is the last commit.