infer-gender
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -23,3 +23,3 @@ const fs = require('fs') | ||
exports.extractName = fullName => ( | ||
exports.extractName = (fullName, onlyFirst = false) => ( | ||
removeDiacritics(fullName) | ||
@@ -30,7 +30,7 @@ .toLowerCase() | ||
// Return the first word that matches a name | ||
.find(name => name in names) | ||
.find(name => name in names || onlyFirst) | ||
) | ||
exports.infer = fullName => ( | ||
names[exports.extractName(fullName)] || UNKNOWN | ||
exports.infer = (fullName, onlyFirst = false) => ( | ||
names[exports.extractName(fullName, onlyFirst)] || UNKNOWN | ||
) |
{ | ||
"name": "infer-gender", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Infer the gender of a name based on a large list of names, case insensitive and removes diacritics", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3
434990
6
28