country-codes-list
Advanced tools
Comparing version 1.2.7 to 1.3.0
16
index.js
@@ -56,13 +56,5 @@ const groupBy = require('./utils/groupBy') | ||
if (sortBy && fields[sortBy]) { | ||
finalCollection.sort(function(a, b) { | ||
var textA = a[sortBy].toUpperCase(); // ignore upper and lowercase | ||
var textB = b[sortBy].toUpperCase(); // ignore upper and lowercase | ||
if (textA < textB) { | ||
return -1; | ||
} | ||
if (textA > textB) { | ||
return 1; | ||
} | ||
return 0; | ||
}) | ||
// ignore upper and lowercase | ||
const collator = new Intl.Collator([], {sensitivity:'accent'}) | ||
finalCollection.sort((a, b) => collator.compare(a[sortBy], b[sortBy])) | ||
} | ||
@@ -91,2 +83,2 @@ | ||
} | ||
} | ||
} |
{ | ||
"name": "country-codes-list", | ||
"version": "1.2.7", | ||
"version": "1.3.0", | ||
"description": "List of codes per country (languages, calling codes, currency codes, etc)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,5 +13,5 @@ # country-codes-list | ||
- Country Calling Code: The phone calling code for the country. Obtained from [Wikipedia](https://en.wikipedia.org/wiki/List_of_country_calling_codes#Alphabetical_listing_by_country_or_region). | ||
- Region: The Regional Classifications are from the [International Telecommunications Union](http://www.itu.int/ITU-D/ict/definitions/regions/index.html). Seen [here](https://meta.wikimedia.org/wiki/List_of_countries_by_regional_classification) | ||
# Installation | ||
@@ -41,2 +41,4 @@ ## Install the NPM module | ||
- countryCallingCode | ||
- region | ||
- globalSouth | ||
@@ -43,0 +45,0 @@ #### Example |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105020
3349
72