Accessing Event on a Rule

Open
#307 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript
Domain
backend

Research direction

Start by comparing the Rule class definition, the ruleEvent object, the JavaScript getEvent() method, and the index.d.ts declaration mentioned in the issue. Trace how event data is represented and exposed, then verify whether the public behavior and type declarations agree; done means the supported way to access event data is clear and accurately represented.

Written by the indexing model from the issue text.

Description

Hello,

I'm working on a project in node that uses your rule engine, and I've noticed something that I can't understand.

The Rule class definition implements:
export class Rule implements RuleProperties { event: Event; }

But the Rule object uses
ruleEvent: {}

Trying to access a rule's events with rule.event returns nothing (as expected).

I've looked at the js code and there's a method getEvent(), that is not in index.d.ts.
What's the reason for all of this?
It seems it's impossible to access the event data.

Dominant language
JavaScript
Stars
3.1k
Forks
507
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CacheControl/json-rules-engine

All issues in CacheControl/json-rules-engine

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.