hassansin / parse-address

US Street Address Parser
http://hassansin.github.io/parse-address/
Other
159 stars 82 forks source link

Adding country at the end of an address makes parsed address set city to street and street to prefix #25

Open rizowski opened 5 years ago

rizowski commented 5 years ago

Given the following: 1800 N, Lehi, UT 84043, USA

I would expect to see

{
  number: '1800',
  street: 'N',
  city: 'Lehi',
  state: 'UT',
  zip: '84043'
}

Instead I get:

{
    number: '1800',
  prefix: 'N',
  street: 'Lehi',
}

Should USA just be omitted? Given that this just parses US addresses?

varadara commented 5 years ago

Correct. You just need to remove the country at the end.