CacheControl / CacheControl/json-rules-engine

Ability to send params in to a custom operator

未关闭
#92 4 条评论 11 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
JavaScript
星标
3.1k
派生
507
PR 合并指标
30 天内没有已合并 PR

描述

Ran across a use case where i wanted to know if a date was at least 5 minutes greater than another date. But if I have other cases like 10 minutes then I need to create operators for each test. If I could send in params with the operator it would allow for some pretty flexible conditions.

```
{
fact: 'date1',
operator: {
operation: 'dateTime-greater',
params: {
unit: 'minute',
quantity: 5
}
},
value: {
fact: 'date2'
}
}
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先跟踪仓库中自定义运算符的定义、调用方式以及为其提供规则数据的方式。以 dateTime-greater 示例作为目标案例;完成内容应包括向自定义运算符传递 unit 和 quantity 参数,以便在不使用单独运算符的情况下处理不同的时间间隔。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
backend
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。