idauth / node-humanname

JavaScript code to split names into their respective components (first, last, etc)
http://www.onlineaspect.com/2009/08/17/splitting-names/
Apache License 2.0
14 stars 5 forks source link

Throws an error if pass a single word that contains a parenthesis #5

Open 2fd opened 7 years ago

2fd commented 7 years ago

> humanname.parse('(Name)')

TypeError: Cannot read property 'split' of undefined
    at NameParse.safe_ucfirst (node_modules/humanname/lib/parse-names.js:156:18)
    at NameParse.fix_case (node_modules/humanname/lib/parse-names.js:144:12)
    at NameParse.parse (humanname/lib/parse-names.js:238:18)
    at repl:1:11
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
    at REPLServer.defaultEval (repl.js:239:29)
    at bound (domain.js:301:14)
    at REPLServer.runBound [as eval] (domain.js:314:12)
    at REPLServer.onLine (repl.js:440:10)
    at emitOne (events.js:120:20)
yubo56 commented 6 years ago

To add onto this,

> humanname.parse('Mr')
TypeError: Cannot read property 'split' of undefined