Condition for checking param is not falsy?

Open
#304 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript
Domain
backend

Research direction

Start by reviewing the rules engine's existing condition operators, especially the notEquals operator and the custom-operator entry point. Determine whether checking for any falsy parameter value should be a built-in condition or a custom operator, then add coverage and documentation that demonstrate the intended behavior for '', 0, false, null, and undefined.

Written by the indexing model from the issue text.

Description

I need to ensure a parameter, if provided, does not contain a falsy value ('', 0, false, null, undefined, etc.). As far as I can tell, the "notEquals" operator would be unwieldy because it uses !== so I'd have to check each possibility separately. Is that the only built-in way? Must this be a custom operator?

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.