parse-full-name icon indicating copy to clipboard operation
parse-full-name copied to clipboard

Last Name becomes Middle Name with trailing blankspace

Open GregZoeller opened this issue 8 years ago • 3 comments

a name such as Ezekiel Johnson would be fine as is and returns { title: '', first: 'Ezekiel', middle: '', last: 'Johnson', nick: '', suffix: '', error: [] }

but Ezekiel Johnson with a blank space at the end results in

{ title: '', first: 'Ezekiel', middle: 'Johnson', last: '', nick: '', suffix: '', error: [] }

GregZoeller avatar May 11 '17 19:05 GregZoeller

To fix temporarily you can just do nameStr.trim() before you put it into the function

turbobuilt avatar Aug 31 '17 18:08 turbobuilt

.replace(/\s\s+/g, ' ').trim()

GregZoeller avatar Apr 12 '18 15:04 GregZoeller

@GregZoeller @turbobuilt we've taken over ownership of this library I'm moving issues into our fork. Please feel free to comment further on your issue there.

chris-pardy avatar Sep 16 '19 15:09 chris-pardy