Coder Social home page Coder Social logo

parse-usdl's Issues

Issue when parsing name containing code key

Hi everyone i'm seeing the following issue when the first name (or any other value) contains a key name, like for example ADAN which contains DAN key, then the name parsed is the following response:

{
  "documentNumber": "xxxxxx",
  "lastName": "MANTILLA",
  "lastNameTruncated": "N",
  "firstName": "A",
  "firstNameTruncated": "N",
  "middleName": "ELIECER",
  "middleNameTruncated": "N",
  "jurisdictionVehicleClass": "C",
  "jurisdictionRestrictionCodes": "01",
  "jurisdictionEndorsementCodes": "NONE",
  "dateOfIssue": "06/01/2018",
  "dateOfBirth": "06/03/1987",
  "dateOfExpiry": "06/03/2022",
  "sex": "M",
  "height": "064 IN",
  "eyeColor": "GRN",
  "addressStreet": "xxxxx",
  "addressCity": "xxxx",
  "complianceType": "N",
  "addressPostalCode": "xxxxxxx",
  "documentDiscriminator": "xxxxxx",
  "issuer": "USA",
  "weightLb": "130",
  "hairColor": "BRO",
  "inventoryControlNumber": "xxxxxx"
}

Do you guys know how to handle this race cases ?

Change in California drivers license format

It seems the format for the codes of the new drivers license in California (expire in 2023 instead of 2020) have changed a bit. The drivers license number seems to be located under DCK, previously it was located under DAQ. I made an quick and dirty adjustment to the parseUsdl.js file to accommodate for this in my local environment:

Under line 22:

/////////////////////////////////////////////
// Switch values if true, of value and key //
/////////////////////////////////////////////
if (isNewDl(code, line)) value = line.slice(8, 16), key = 'documentNumber'

Under line 43:

/////////////////////////////
// Determine if DCK code's //
// key is documentNumber   //
/////////////////////////////
const isNewDl = (code, line) => (code === "DCK" && line.slice(0, 8).match('DCK[0-9][0-9][0-9][0-9][0-9]') !== null)

Just wanted to bring attention to this.

Error when parsing Ontario driver's license

Ontario driver's licenses include the DCT field, which is where the first name is placed. This library is missing that field and errors out on Ontario licenses. It should be an easy fix.

Parsing new line characters

I'm working with the L-Tron LTC4910 scanner in the USB Keyboard mode. When scanning a driver's license I get a string formatted as below:

@ ANSI 636024070001DL00310247DLDAQ12345678DCSDOEDDENDACJANEDDFNDADCDDGUDCADDCBNONEDCDNONEDBD02012018DBB01011940DBA01012022DBC2DAU070 inDAYHAZDAG10 SOME STREETDAICITYDAJVTDAK123450000 DCF123451234544DCGUSADAW170DAHNONEDDAFDDB02202013DDK1

The only new line characters are after the @ and ANSI. If I manually add new lines after each section, the string parses but if I don't, the string returns an empty object. I believe the prefixes are different for each state so I'm unsure of how to parse the string programmatically. Is there a way to parse the data without requiring the new line characters?

Thanks for the help.

ES6 code is not bundle safe

Hello, This is a nice little utility! We noticed that it uses let and const (ES6) and is breaking our webpack build due to the fact that Uglify JS cannot minify ES6 code. Super easy to fork into our own function but just wanted to give a heads up. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.