-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add MS sample data + new DAA field #27
base: master
Are you sure you want to change the base?
Conversation
⚡ REFACTOR: rename data3 to UsdlDataTN
const UsdlDataTN = require('./sample/index').UsdlDataTN | ||
const UsdlDataMS = require('./sample/index').UsdlDataMS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename data by state
expect(parsedData.documentNumber).toEqual('802926467') | ||
expect(parsedData.firstName).toEqual('JANICE') | ||
expect(parsedData.lastName).toEqual('SMITH') | ||
expect(parsedData.middleName).toEqual('C') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parse full name into separate fields
@@ -5,6 +5,7 @@ exports.CodeToKey = { | |||
DCB: 'jurisdictionRestrictionCodes', | |||
DCD: 'jurisdictionEndorsementCodes', | |||
DBA: 'dateOfExpiry', | |||
DAA: 'fullName', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new DAA key
let started | ||
lines.slice(0, -1).forEach((line) => { | ||
if (!started) { | ||
if (line.indexOf('ANSI ') === 0) { | ||
if (line.indexOf('ANSI') === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove space from ANSI to check for MS when space doesn't exist
if (code === 'DAA') { | ||
const nameArray = value.split(',') | ||
props.firstName = nameArray[1] | ||
props.lastName = nameArray[0] | ||
props.middleName = nameArray[2] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
past full name to separate fields
@chancesmith if you're interested in continuing to work with this repo, can i add you to collaborators? Then you can do your thing. Just please stick to semantic versioning |
changes made