@furkot/address
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -22,9 +22,15 @@ const { abbr2country, country2abbr } = require('../country'); | ||
country = country2abbr[country] || country; | ||
if (!abbr2country[country]) { | ||
street = town; | ||
town = state; | ||
state = getState(country); | ||
country = state2country[state]; | ||
if (!country) { | ||
if (country2abbr[country]) { | ||
country = country2abbr[country]; | ||
} | ||
else { | ||
const _state = getState(country); | ||
const _country = state2country[_state]; | ||
if (_state && _country) { | ||
street = town; | ||
town = state; | ||
state = _state; | ||
country = _country; | ||
} | ||
else if (!abbr2country[country]) { | ||
return; | ||
@@ -31,0 +37,0 @@ } |
{ | ||
"name": "@furkot/address", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Furkot address normalizer.", | ||
@@ -5,0 +5,0 @@ "author": { |
16423
621