Skip to content

Commit 4d4cf25

Browse files
committed
updates address-formatting, fixes Firenze
1 parent 9305097 commit 4d4cf25

3 files changed

Lines changed: 19 additions & 12 deletions

File tree

package-lock.json

Lines changed: 8 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/internal.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,17 @@ export const getCountyCode = (county, countryCode) => {
137137
if (typeof e.name === 'string' && e.name.toUpperCase() === county.toUpperCase()) {
138138
return e;
139139
}
140+
if (typeof e.name === 'string') {
141+
return false;
142+
}
140143
const variants = Object.values(e.name);
141-
const foundVariant = variants.find((e) => e.toUpperCase() === county.toUpperCase());
142-
if (foundVariant) {
143-
return {
144-
key: e.key
145-
};
144+
for(const v of variants) {
145+
const foundVariant = county.match(new RegExp(`${v}`, 'i'));
146+
if (foundVariant) {
147+
return {
148+
key: e.key
149+
};
150+
}
146151
}
147152
return false;
148153
});

0 commit comments

Comments
 (0)