country-codes-list
Advanced tools
Comparing version 1.2.2 to 1.2.3
10
index.js
@@ -31,5 +31,11 @@ const supplant = require('./utils/supplant') | ||
*/ | ||
customArray: function (fields = { name: '{countryNameEn} ({countryCode})', value: '{countryCode}'}, { sortBy = 'name' } = {}) { | ||
customArray: function (fields = { name: '{countryNameEn} ({countryCode})', value: '{countryCode}'}, { sortBy = 'name', filter } = {}) { | ||
const finalCollection = [] | ||
countriesData.forEach(countryData => { | ||
let data = countriesData | ||
if (typeof filter === 'function') { | ||
data = data.filter(filter) | ||
} | ||
data.forEach(countryData => { | ||
let collectionObject = {} | ||
@@ -36,0 +42,0 @@ for (const field in fields) { |
{ | ||
"name": "country-codes-list", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "List of codes per country (languages, calling codes, currency codes, etc)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
102588
3081