@@ -174,24 +174,24 @@ function deDeCheck(tin) {
174174 const digits = tin . split ( '' ) . map ( a => parseInt ( a , 10 ) ) ;
175175
176176 // Fill array with strings of number positions
177- let occurences = [ ] ;
177+ let occurrences = [ ] ;
178178 for ( let i = 0 ; i < digits . length - 1 ; i ++ ) {
179- occurences . push ( '' ) ;
179+ occurrences . push ( '' ) ;
180180 for ( let j = 0 ; j < digits . length - 1 ; j ++ ) {
181181 if ( digits [ i ] === digits [ j ] ) {
182- occurences [ i ] += j ;
182+ occurrences [ i ] += j ;
183183 }
184184 }
185185 }
186186
187- // Remove digits with one occurence and test for only one duplicate/triplicate
188- occurences = occurences . filter ( a => a . length > 1 ) ;
189- if ( occurences . length !== 2 && occurences . length !== 3 ) { return false ; }
187+ // Remove digits with one occurrence and test for only one duplicate/triplicate
188+ occurrences = occurrences . filter ( a => a . length > 1 ) ;
189+ if ( occurrences . length !== 2 && occurrences . length !== 3 ) { return false ; }
190190
191191 // In case of triplicate value only two digits are allowed next to each other
192- if ( occurences [ 0 ] . length === 3 ) {
193- const trip_locations = occurences [ 0 ] . split ( '' ) . map ( a => parseInt ( a , 10 ) ) ;
194- let recurrent = 0 ; // Amount of neighbour occurences
192+ if ( occurrences [ 0 ] . length === 3 ) {
193+ const trip_locations = occurrences [ 0 ] . split ( '' ) . map ( a => parseInt ( a , 10 ) ) ;
194+ let recurrent = 0 ; // Amount of neighbor occurrences
195195 for ( let i = 0 ; i < trip_locations . length - 1 ; i ++ ) {
196196 if ( trip_locations [ i ] + 1 === trip_locations [ i + 1 ] ) {
197197 recurrent += 1 ;
@@ -621,10 +621,10 @@ function huHuCheck(tin) {
621621 * and X characters after vowels may only be followed by other X characters.
622622 */
623623function itItNameCheck ( name ) {
624- // true at the first occurence of a vowel
624+ // true at the first occurrence of a vowel
625625 let vowelflag = false ;
626626
627- // true at the first occurence of an X AFTER vowel
627+ // true at the first occurrence of an X AFTER vowel
628628 // (to properly handle last names with X as consonant)
629629 let xflag = false ;
630630
@@ -890,7 +890,7 @@ function plPlCheck(tin) {
890890 const date = `${ full_year } /${ month } /${ tin . slice ( 4 , 6 ) } ` ;
891891 if ( ! isDate ( date , 'YYYY/MM/DD' ) ) { return false ; }
892892
893- // Calculate last digit by mulitplying with odd one-digit numbers except 5
893+ // Calculate last digit by multiplying with odd one-digit numbers except 5
894894 let checksum = 0 ;
895895 let multiplier = 1 ;
896896 for ( let i = 0 ; i < tin . length - 1 ; i ++ ) {
0 commit comments