File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 9393 "lastName" : "Williams" ,
9494 "suffix" : ""
9595 }
96+ } , {
97+ name : "Jack O'Neill" ,
98+ result : {
99+ "salutation" : "" ,
100+ "firstName" : "Jack" ,
101+ "initials" : "" ,
102+ "lastName" : "O'Neill" ,
103+ "suffix" : ""
104+ }
105+ } , {
106+ name : "Jack o Neill" ,
107+ result : {
108+ "salutation" : "" ,
109+ "firstName" : "Jack" ,
110+ "initials" : "" ,
111+ "lastName" : "O Neill" ,
112+ "suffix" : ""
113+ }
114+ } , {
115+ name : "Jack O Neill" ,
116+ result : {
117+ "salutation" : "" ,
118+ "firstName" : "Jack" ,
119+ "initials" : "O" ,
120+ "lastName" : "Neill" ,
121+ "suffix" : ""
122+ }
96123 } ] ;
97124
98125 test ( 'Test names' , function ( ) {
Original file line number Diff line number Diff line change @@ -60,7 +60,10 @@ var NameParse = (function(){
6060 // move on to parsing the last name if we find an indicator of a compound last name (Von, Van, etc)
6161 // we do not check earlier to allow for rare cases where an indicator is actually the first name (like "Von Fabella")
6262 if ( this . is_compound_lastName ( word ) ) {
63- break ;
63+ if ( ! ( this . is_initial ( word ) && word === word . toUpperCase ( ) ) ) {
64+ //If it's one letter and capitalized, consider it a middle initial
65+ break ;
66+ }
6467 }
6568
6669 if ( this . is_initial ( word ) ) {
You can’t perform that action at this time.
0 commit comments