react-simple-phone-input 1.0.7-beta → 1.0.8-beta

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/dist/esm/index.js CHANGED
@@ -3988,12 +3988,12 @@ const getDefaultCountry = (code) => {
3988
3988
  return result;
3989
3989
  };
3990
3990
  const getBySearch = (search, onlyCountry, excludeCountry) => {
3991
- let countries = [];
3991
+ var countries = [];
3992
3992
  if (excludeCountry && excludeCountry.length > 0) {
3993
- countries = countryData.filter((item) => !(excludeCountry === null || excludeCountry === void 0 ? void 0 : excludeCountry.includes(item.countryCode)));
3993
+ countries = countryData.filter((item) => (excludeCountry === null || excludeCountry === void 0 ? void 0 : excludeCountry.indexOf(item.countryCode)) === -1);
3994
3994
  }
3995
3995
  else if (onlyCountry && (onlyCountry === null || onlyCountry === void 0 ? void 0 : onlyCountry.length) > 0) {
3996
- countries = countryData.filter((item) => onlyCountry === null || onlyCountry === void 0 ? void 0 : onlyCountry.includes(item.countryCode));
3996
+ countries = countryData.filter((item) => (onlyCountry === null || onlyCountry === void 0 ? void 0 : onlyCountry.indexOf(item.countryCode)) !== -1);
3997
3997
  }
3998
3998
  else {
3999
3999
  countries = countryData;
@@ -4006,17 +4006,17 @@ const getBySearch = (search, onlyCountry, excludeCountry) => {
4006
4006
  return result;
4007
4007
  };
4008
4008
  const getCountryByFilter = (onlyCountry, excludeCountry, preferredCountry) => {
4009
- let countries = [];
4009
+ var countries = [];
4010
4010
  if (excludeCountry && excludeCountry.length > 0) {
4011
- countries = countryData.filter((item) => !(excludeCountry === null || excludeCountry === void 0 ? void 0 : excludeCountry.includes(item.countryCode)));
4011
+ countries = countryData.filter((item) => (excludeCountry === null || excludeCountry === void 0 ? void 0 : excludeCountry.indexOf(item.countryCode)) === -1);
4012
4012
  }
4013
4013
  else if (onlyCountry && (onlyCountry === null || onlyCountry === void 0 ? void 0 : onlyCountry.length) > 0) {
4014
- countries = countryData.filter((item) => onlyCountry === null || onlyCountry === void 0 ? void 0 : onlyCountry.includes(item.countryCode));
4014
+ countries = countryData.filter((item) => (onlyCountry === null || onlyCountry === void 0 ? void 0 : onlyCountry.indexOf(item.countryCode)) !== -1);
4015
4015
  }
4016
4016
  else {
4017
4017
  countries = countryData;
4018
4018
  }
4019
- const result = countries.sort((a, b) => (Number(preferredCountry === null || preferredCountry === void 0 ? void 0 : preferredCountry.includes(b.countryCode)) - Number(preferredCountry === null || preferredCountry === void 0 ? void 0 : preferredCountry.includes(a.countryCode)))
4019
+ const result = countries.sort((a, b) => (Number(preferredCountry === null || preferredCountry === void 0 ? void 0 : preferredCountry.indexOf(b.countryCode)) - Number(preferredCountry === null || preferredCountry === void 0 ? void 0 : preferredCountry.indexOf(a.countryCode)))
4020
4020
  || ((preferredCountry === null || preferredCountry === void 0 ? void 0 : preferredCountry.indexOf(a.countryCode)) - (preferredCountry === null || preferredCountry === void 0 ? void 0 : preferredCountry.indexOf(b.countryCode))));
4021
4021
  return result;
4022
4022
  };