perogi / zipcodes-perogi

Zipcode lookup node module
https://www.npmjs.com/package/zipcodes-perogi
Other
1 stars 3 forks source link

Zipcode from outside of the US causes undefined error. #11

Closed perogi closed 7 years ago

perogi commented 7 years ago

If you use a “valid” zipcode (5 digit string) but it’s not a valid zipcode, getting an undefined error

germanZipCode = "01465" 1) ZipCode Service Tests When getting zipcode with timezone information and zipcode is a valid length but not a US zip code "before each" hook for "then the res.statusCode is 500": TypeError: Cannot read property 'timeZoneId' of undefined at Object.lookupWithTime (node_modules/zipcodes-perogi/lib/index.js:16:33) at Object.invokeZipcodeTimezoneService (src/services/ZipCodeService.js:48:38) at Context.beforeEach (src/services/test/ZipCodeService.test.js:273:25)

perogi commented 7 years ago

Issue is in line 16 of index.js - need to check for undefined info coming back from look up.

perogi commented 7 years ago

Committed.