Throw error in case multiple fields / field options are matched
- 主要语言
- JavaScript
- 星标
- 36
- 派生
- 10
- PR 合并指标
- 30 天内没有已合并 PR
描述
### Please avoid duplicates
- [X] I checked [all open bugs](https://github.com/gr2m/github-project/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and none of them matched my problem.
### Reproducible test case
_No response_
### Please select the environment(s) that are relevant to your bug report
- [X] Browsers
- [X] Node
- [X] Deno
### Versions
1.3.1
### What happened?
In theory, a field configured in the `fields` constructor option can be matched to multiple project fields when using [the `matchFieldName` constructor option](https://github.com/gr2m/github-project/#constructor). The same is true for matching field options and the `matchFieldOptionValue` option.
I think right now the first match wins. But what we should do instead in both cases is to match all fields / field options respectively and verify that there is exactly one match. We throw an error if there is no match. We should also throw an error if there is more than one match
### Would you be interested in contributing a fix?
- [ ] yes
贡献指南
调研方向
从处理 matchFieldName 和 matchFieldOptionValue 的构造函数开始,然后追踪当前匹配如何返回第一个结果。为字段和字段选项分别添加匹配数为零个、一个和多个时的覆盖;完成标准是保留现有的无匹配错误,并让多个匹配现在抛出错误。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- github, javascript
- 领域
- api
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100