andrewrk / andrewrk/node-diacritics
.find() method to retrieve all the group of diacritics from a specific char
- Ngôn ngữ chính
- JavaScript
- Star
- 270
- Fork
- 32
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi @andrewrk,
What do you think about this? Right now i'm facing a case where i need to have a group of all possible diacritics from a specific char. I remembered about your great list of diacritics, and that your package is named as 'diacritics', and not something like 'remove-diacritics', so i thought that would be better to extend it with one more method instead of create another package.
I already created the new method:
```
function findDiacritics(chr) {
var diacriticsFound = replacementList.find( o => o.base == chr || o.chars.indexOf(chr) >= 0 );
return (diacriticsFound)? diacriticsFound.base + diacriticsFound.chars : null;
}
```
If you think it is ok, i can send you a pull request.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.