Skip to content
interview-ques…
Go to file
Code
This branch is 4 commits ahead, 48 commits behind chovy:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

humanparser JavaScript Bug Squash

humanparser is a third-party library we use at Remind to parse a human name string into salutation, first name, middle name, last name, and suffix.

Your Goal

Your goal is to find the root cause of the bug described below, then fix it if you have time!

The Bug

When parseName is called for a salutation and last name only, it is returning the last name as the first name:

const human = require("humanparser")
const attrs = human.parseName("Ms. Smith")
console.log(attrs);

actual:

{ 
    salutation: 'Ms.',
    firstName: 'Smith',
    lastName: '',
    fullName: 'Ms. Smith'
}

expected:

{ 
    salutation: 'Ms.',
    firstName: '',
    lastName: 'Smith',
    fullName: 'Ms. Smith'
}

About

Parse a human name string into salutation, first name, middle name, last name, suffix.

Resources

License

Packages

No packages published
You can’t perform that action at this time.