Skip to content

Commit

Permalink
fix: getProvinceCode / code to uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
singuerinc committed Feb 25, 2019
1 parent 857facd commit f549560
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/getProvinceCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
2 changes: 1 addition & 1 deletion src/getProvinceName.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

0 comments on commit f549560

Please sign in to comment.