country-data-filter 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +3 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export function getProvincesByCountry(code) {
|
|
|
13
13
|
// Function to get a list of district names by country code and province name
|
|
14
14
|
export function getDistrictsByProvince(countryCode, provinceName) {
|
|
15
15
|
const country = countryData[countryCode];
|
|
16
|
-
if (country && country.province[provinceName]) {
|
|
16
|
+
if (country && country.province[provinceName.toLowerCase()]) {
|
|
17
17
|
// Return an array of district names
|
|
18
18
|
return Object.values(country.province[provinceName].districts).map(
|
|
19
19
|
(district) => district.name
|
|
@@ -25,8 +25,8 @@ export function getDistrictsByProvince(countryCode, provinceName) {
|
|
|
25
25
|
// Function to get city details by country code, province name, and district name
|
|
26
26
|
export function getCityByDistrict(countryCode, provinceName, districtName) {
|
|
27
27
|
const country = countryData[countryCode];
|
|
28
|
-
const province = country.province[provinceName];
|
|
29
|
-
if (province && province.districts[districtName]) {
|
|
28
|
+
const province = country.province[provinceName.toLowerCase()];
|
|
29
|
+
if (province && province.districts[districtName.toLowerCase()]) {
|
|
30
30
|
return province.districts[districtName];
|
|
31
31
|
}
|
|
32
32
|
return null;
|