infer-gender
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -27,3 +27,5 @@ const fs = require('fs') | ||
.replace(/[^a-z -]+/g, '') | ||
.split(' ')[0] | ||
.split(' ') | ||
// Return the first word that matches a name | ||
.find(name => name in names) | ||
) | ||
@@ -30,0 +32,0 @@ |
{ | ||
"name": "infer-gender", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "Infer the gender of a name based on a large list of names, case insensitive and removes diacritics", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -34,2 +34,10 @@ const assert = require('assert') | ||
}) | ||
it('It should return male even though first word does not match', () => { | ||
infer('Abcde Alfonso Wayne', 'male') | ||
}) | ||
it('It should return female even though first word does not match', () => { | ||
infer('Abcde Ariana Matrix', 'female') | ||
}) | ||
}) | ||
@@ -36,0 +44,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
438928
174