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 };