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

google-news-rss-to-js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-news-rss-to-js - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

package.json
{
"name": "google-news-rss-to-js",
"version": "1.0.1",
"version": "1.0.2",
"description": "An RSS scraper for Google News",

@@ -22,4 +22,4 @@ "main": "src/index.js",

"cheerio": "*",
"locale-codes": "^1.3.1"
"cldr-language-country": "^0.6.1"
}
}

@@ -1,8 +0,3 @@

const locale = require('locale-codes');
const locale = require('cldr-language-country');
const getCodesFromTag = (tag) => {
const [languageCode, countryCode] = tag.split('-');
return { lc: languageCode, cc: countryCode };
}
module.exports = function getLocaleCodes({ country, language, cc, lc } = {}) {

@@ -12,10 +7,10 @@ if (cc && lc) {

} else if (lc) {
const tag = locale.getByISO6391(lc).tag;
return getCodesFromTag(tag);
const data = locale.getByLC(lc);
return { lc, cc: data.country.code };
} else if (country) {
const tag = locale.getByLocation(lc).tag;
return getCodesFromTag(tag);
const data = locale.getByCountryName(country);
return { lc: data.language.code, cc: data.country.code };
} else if (language) {
const tag = locale.getByName(lc).tag;
return getCodesFromTag(tag);
const data = locale.getByLanguageName(language);
return { lc: data.language,code, cc: data.country.code };
} else {

@@ -22,0 +17,0 @@ return null;

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