Skip to content

Commit

Permalink
Issuer Identification Numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
nathany committed Aug 10, 2018
1 parent a862a43 commit 3f6a42b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions spec/fixtures/canada.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
exports.canada = {
'iin': "990876",
'addressCity': "YOUR CITY",
'addressPostalCode': "A1B 2C3",
'addressState': "AB",
Expand Down
1 change: 1 addition & 0 deletions spec/fixtures/default.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
exports.default = {
'iin': "636001",
'addressCity': "YOUR CITY",
'addressPostalCode': "123450000",
'addressState': "NY",
Expand Down
2 changes: 1 addition & 1 deletion src/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports.CodeToKey = {
DAQ: 'documentNumber',
DAT: 'jurisdictionRestrictionCodes', // License Endorsements Code?
DCF: 'documentDiscriminator',
DCG: 'issuer',
DCG: 'issuer', // Country Identification
DCT: 'givenName',
DDE: 'lastNameTruncated',
DDF: 'firstNameTruncated',
Expand Down
2 changes: 2 additions & 0 deletions src/parseUsdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ exports.parse = function parseDL(str, options = defaultOptions) {
const rawLines = str.trim().split(lineSeparator);
const lines = rawLines.map(rawLine => sanitizeData(rawLine));
let started;
let iin;
lines.forEach(line => {
if (!started) {
if (line.indexOf("ANSI ") === 0) {
started = true;
props["iin"] = line.slice(5,11); // 6-digit Issuer Identification Numbers
}
return;
}
Expand Down

0 comments on commit 3f6a42b

Please sign in to comment.