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.2.2 to 1.3.0

9

index.js

@@ -15,11 +15,8 @@ let data = require('./data/data.json');

const getNRandomCountriesData = (count) => {
let randomCountriesArray = [];
let randomCountriesSet = new Set(); // to prevent duplicate countries
while (randomCountriesArray.length < count) {
while (randomCountriesSet.size < count) {
let country = data[randomNum()];
if (!randomCountriesSet.has(country)) {
randomCountriesArray.push(country);
}
randomCountriesSet.add(country); // adds a country to the Array
}
return randomCountriesArray;
return Array.from(randomCountriesSet); // Returns the Array
};

@@ -26,0 +23,0 @@

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

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

@@ -0,5 +1,5 @@

#### Want to contribute to open source? check issues [here.](https://github.com/bhatvikrant/world-countries-capitals/issues)
# world-countries-capitals
#### Want to contribute to open source? check issues [here.](https://github.com/bhatvikrant/world-countries-capitals/issues)
<!-- ![](https://img.shields.io/github/forks/bhatvikrant/world-countries-capitals?style=social)

@@ -6,0 +6,0 @@

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