forked from roALAB1/data-normalization-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-suffix.ts
More file actions
25 lines (22 loc) · 698 Bytes
/
Copy pathtest-suffix.ts
File metadata and controls
25 lines (22 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { NameEnhanced } from './client/src/lib/NameEnhanced';
const testCases = [
'Albert L Gaffney III',
'John Smith Jr.',
'Mary Johnson Sr',
'Robert Brown II',
'William Davis IV',
'James Wilson V',
'Dr. John Paul Smith Jr.',
'Albert Gaffney III PhD',
];
console.log('Testing generational suffix detection:\n');
testCases.forEach(testName => {
const name = new NameEnhanced(testName);
console.log(`Input: "${testName}"`);
console.log(` Valid: ${name.isValid}`);
console.log(` First: "${name.firstName}"`);
console.log(` Middle: "${name.middleName}"`);
console.log(` Last: "${name.lastName}"`);
console.log(` Suffix: "${name.suffix}"`);
console.log('');
});