greek-name-correction 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/package.json +1 -1
- package/src/utils.js +8 -1
package/README.md
CHANGED
|
@@ -634,7 +634,10 @@ The test suite covers:
|
|
|
634
634
|
|
|
635
635
|
## Changelog
|
|
636
636
|
|
|
637
|
-
### Version 2.1.
|
|
637
|
+
### Version 2.1.2 (Current)
|
|
638
|
+
- 🐛 **Bug Fix** - Fixed `splitNameParts` to correctly filter out general titles (κ. and κα) from name parts
|
|
639
|
+
|
|
640
|
+
### Version 2.1.1
|
|
638
641
|
- ✨ **Automatic General Title Addition** - Added `addGeneralTitle` option to automatically add general titles (κ. for men, κα for women) when no title exists
|
|
639
642
|
|
|
640
643
|
### Version 2.1.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "greek-name-correction",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "A zero-dependency Node.js library for correcting and formatting Greek names with transliteration, genitive conversion, and advanced features",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
package/src/utils.js
CHANGED
|
@@ -205,7 +205,14 @@ function detectGender(fullname) {
|
|
|
205
205
|
function splitNameParts(fullname) {
|
|
206
206
|
const parts = fullname
|
|
207
207
|
.split(/\s+/)
|
|
208
|
-
.filter((p) =>
|
|
208
|
+
.filter((p) => {
|
|
209
|
+
const lowerP = p.toLowerCase();
|
|
210
|
+
return !isGreekParticle(lowerP) &&
|
|
211
|
+
!titles.includes(p) &&
|
|
212
|
+
!titles.some(t => t.toLowerCase() === lowerP) &&
|
|
213
|
+
lowerP !== "κ." &&
|
|
214
|
+
lowerP !== "κα";
|
|
215
|
+
});
|
|
209
216
|
|
|
210
217
|
if (parts.length === 0) return { firstName: "", lastName: "" };
|
|
211
218
|
if (parts.length === 1) return { firstName: parts[0], lastName: "" };
|