Throw error in case multiple fields / field options are matched
- Ngôn ngữ chính
- JavaScript
- Star
- 36
- Fork
- 10
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### 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
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu từ constructor xử lý matchFieldName và matchFieldOptionValue, sau đó theo dõi cách matching hiện đang trả về kết quả đầu tiên. Bổ sung coverage cho trường hợp có 0, 1 và nhiều kết quả khớp, cho cả field và field option; hoàn thành khi các lỗi hiện có đối với trường hợp không có kết quả khớp vẫn được giữ nguyên và nhiều kết quả khớp sẽ ném lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- github, javascript
- Lĩnh vực
- api
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100