Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

world-countries-capitals

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

world-countries-capitals - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

29

index.js

@@ -24,2 +24,14 @@ let data = require("./data/data.json");

// Helper function
// const getCountriesByField = (value, fieldName) => {
// let resultArray = [];
// value = value.toLowerCase();
// field = fieldName;
// data.forEach((item) => {
// item[field] = item[field].toLowerCase();
// if (item[field] && item[field].includes(value)) {
// resultArray.push(item);
// }
// });
const getCountriesByObject = (value, obj) => {

@@ -39,3 +51,17 @@ let resultArray = [];

// Get details of a country by the capital name
// // Get details of a country by the capital name
// const getCountryDetailsByCapital = (capital) => {
// return getCountriesByField(capital, 'capital');
// };
// // Get details of a country by the country name
// const getCountryDetailsByName = (country) => {
// return getCountriesByField(country, 'country');
// };
// // Get country details by the language spoken
// const getCountiesByLanguage = (languageSpoken) => {
// return getCountriesByField(languageSpoken, 'native_language');
const getCountryDetailsByCapital = capital => {

@@ -53,2 +79,3 @@ return getCountriesByObject(capital, "capital");

return getCountriesByObject(languageSpoken, "native_language");
};

@@ -55,0 +82,0 @@

2

package.json
{
"name": "world-countries-capitals",
"version": "1.5.0",
"version": "1.5.1",
"description": "A simple NPM package to get capitals, currency, native language, famous_for etc. of all the countries in the world",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc