DamonOehlman / addressit

Freeform Street Address Parser
https://npm.runkit.com/addressit
93 stars 29 forks source link

If no regions are found, an empty array should be returned, not an array with with a single empty string #8

Closed markstos closed 10 years ago

markstos commented 10 years ago

Example:

    console.log( addressit("18 E. Main St"));

Returns an 'region' of: ['']

Since there's no match, I would expect it to return an empty array instead.

So, if you want to check to see if there's a region match, it should be as easy as:

if (addrParts.regions.length) { ... }

Currently, additional work is required to filter out the empty string case .

markstos commented 10 years ago

I'm looking at patch for this now.

DamonOehlman commented 10 years ago

Thanks heaps for making the patch. Was great tracking emails where an issue was reported, patched and a PR issued all while I was asleep :)