From f549560f7d18441fd48cabb5519528f3d118e03c Mon Sep 17 00:00:00 2001 From: singuerinc Date: Mon, 25 Feb 2019 22:26:06 +0100 Subject: [PATCH] fix: getProvinceCode / code to uppercase --- src/getProvinceCode.js | 2 +- src/getProvinceName.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/getProvinceCode.js b/src/getProvinceCode.js index f3c2d77..2f2bb6d 100644 --- a/src/getProvinceCode.js +++ b/src/getProvinceCode.js @@ -19,7 +19,7 @@ function getProvinceCode(value) { const [code] = _partsOld(str); - return PROVINCES[code] ? code : null; + return code ? (PROVINCES[code.toUpperCase()] ? code.toUpperCase() : null) : null; } export { getProvinceCode }; diff --git a/src/getProvinceName.js b/src/getProvinceName.js index 0be8596..1b2b18e 100644 --- a/src/getProvinceName.js +++ b/src/getProvinceName.js @@ -13,7 +13,7 @@ function getProvinceName(value) { const str = !value ? "" : value; const code = getProvinceCode(str); - return PROVINCES[code] || null; + return code ? PROVINCES[code.toUpperCase()] : null; } export { getProvinceName };