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

#Scope(meta.additional_operations) Is way too verbose #6

Open
YumeT023 opened this issue Jan 4, 2024 · 0 comments
Open

#Scope(meta.additional_operations) Is way too verbose #6

YumeT023 opened this issue Jan 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@YumeT023
Copy link
Owner

YumeT023 commented Jan 4, 2024

List of condition with implicit && logical op

"conditions": [
  {
    "lhs": "$arg1",
    "op": "Eq",
    "rhs": "ok"
  },
  {
    "lhs": "$arg2",
    "op": "Eq",
    "rhs": "ko"
  }
]

Since there is currently no method to describe a OR logical op, we can envision the structure below to achieve a OR logical, the array's first element is the Logical op, and the tail is a list of conditions.
The same structure applies to explicit AND logical op

"conditions": [
  [
   "OR",
    {
      "lhs": "$arg1",
      "op": "Eq",
      "rhs": "ok"
    },
    {
      "lhs": "$arg2",
      "op": "Eq",
      "rhs": "ko"
    }
  ]
]

... It would be preferable if it could also support the lisp-like version.

{
  "conditions": [
    [
      "AND",
      [
        {
          "lhs": "$license",
          "op": "Eq",
          "rhs": "MIT"
        },
        {
          "lhs": "$testing",
          "op": "Eq",
          "rhs": "jest"
        }
      ]
    ],
    [
      "OR",
        {
          "lhs": "$license",
          "op": "Eq",
          "rhs": "MIT"
        },
        {
          "lhs": "$testing",
          "op": "Eq",
          "rhs": "jest"
        }
    ],


    [
      "AND",
      [
        ["$license", "Eq", "MIT"],
        ["$testing", "Eq", "jest"]
      ]
    ],
    [
      "OR",
      [
        ["$license", "Eq", "MIT"],
        ["$testing", "Eq", "jest"]
      ]
    ]
  ]
}
@YumeT023 YumeT023 added the enhancement New feature or request label Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant