Skip to content

Make rules syntax user-friendly #4

Description

@samirketema

Proposed syntax:

["length", "field", "password", "GREATER_THAN", "4"]
  1. Keep evaluating operands left to right until a value is reduced from a group of strings (in this case, "length", "field", "password" all represent one value).
  2. Once operands are reduced to values, apply operators to values:
  • Comparisons: [value1, EQUAL_TO, value2] -> value1 === value2
  • Regular expressions: [value1, REGEX, value2 ] -> new RegExp(value1).test(value2)
  • Length: [LENGTH, value1] -> length(value1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions