country-list-js
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "country-list-js", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Country list with ISO2, ISO3 code, continent, capital, dialing code", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/i-rocky/country-list-js.git", |
@@ -92,3 +92,3 @@ ## Country List JS | ||
Object destructor supported since `2.0.0` | ||
Object destructure supported since `2.0.0` | ||
@@ -109,3 +109,3 @@ ```javascript | ||
* findByCurrency | ||
* findByPhoneNbr | ||
* findByPhoneNbr (Thanks to @ekkis) | ||
@@ -122,2 +122,2 @@ ### npm commands | ||
npm run build | ||
``` | ||
``` |
@@ -203,30 +203,30 @@ 'use strict'; | ||
export function getInstance() { | ||
Country.getInstance = function() { | ||
return instance; | ||
} | ||
}; | ||
export function findByISOALpha2(code) { | ||
return getInstance().find(code, getInstance().FIND_BY_ISO_ALPHA_2); | ||
} | ||
Country.findByISOAlpha2 = function(code) { | ||
return Country.Country.getInstance().find(code, Country.getInstance().FIND_BY_ISO_ALPHA_2); | ||
}; | ||
export function findByISOAlpha3(code) { | ||
return getInstance().find(code, getInstance().FIND_BY_ISO_ALPHA_3); | ||
} | ||
Country.findByISOAlpha3 = function(code) { | ||
return Country.getInstance().find(code, Country.getInstance().FIND_BY_ISO_ALPHA_3); | ||
}; | ||
export function findByName(name) { | ||
return getInstance().find(name, getInstance().FIND_BY_NAME); | ||
} | ||
Country.findByName = function(name) { | ||
return Country.getInstance().find(name, Country.getInstance().FIND_BY_NAME); | ||
}; | ||
export function findByCapital(capital) { | ||
return getInstance().find(capital, getInstance().FIND_BY_CAPITAL); | ||
} | ||
Country.findByCapital = function(capital) { | ||
return Country.getInstance().find(capital, Country.getInstance().FIND_BY_CAPITAL); | ||
}; | ||
export function findByCurrency(currency) { | ||
return getInstance().find(currency, getInstance().FIND_BY_CURRENCY); | ||
} | ||
Country.findByCurrency = function(currency) { | ||
return Country.getInstance().find(currency, Country.getInstance().FIND_BY_CURRENCY); | ||
}; | ||
export function findByPhoneNbr(phone) { | ||
return getInstance().find(capital, getInstance().FIND_BY_PHONE_NBR); | ||
} | ||
Country.findByPhoneNbr = function(phone) { | ||
return Country.getInstance().find(capital, Country.getInstance().FIND_BY_PHONE_NBR); | ||
}; | ||
export default Country; | ||
module.exports = Country; |
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
289019
121