Comparing version 25.0.13 to 25.0.14
35
index.js
@@ -11,20 +11,6 @@ /** | ||
var MAIN_FILES = ["ca-buddhist", "ca-chinese", "ca-coptic", "ca-dangi", | ||
"ca-ethiopic-amete-alem", "ca-ethiopic", "ca-generic", "ca-gregorian", | ||
"ca-hebrew", "ca-indian", "ca-islamic-civil", "ca-islamic", "ca-islamic-rgsa", | ||
"ca-islamic-tbla", "ca-islamic-umalqura", "ca-japanese", "ca-persian", "ca-roc", | ||
"characters", "currencies", "dateFields", "delimiters", "languages", "layout", | ||
"listPatterns", "localeDisplayNames", "measurementSystemNames", "numbers", | ||
"posix", "scripts", "territories", "timeZoneNames", "units", "variants" | ||
]; | ||
var SUPPLEMENTAL_FILES = ["aliases", "calendarData", "calendarPreferenceData", | ||
"characterFallbacks", "codeMappings", "currencyData", "gender", | ||
"languageData", "languageMatching", "likelySubtags", "measurementData", | ||
"metaZones", "numberingSystems", "ordinals", "parentLocales", "plurals", | ||
"postalCodeData", "primaryZones", "references", "telephoneCodeData", | ||
"territoryContainment", "territoryInfo", "timeData", "weekData", | ||
"windowsZones" | ||
]; | ||
var JSON_EXTENSION = /^(.*)\.json$/; | ||
var assert = require("assert"); | ||
var _fs = require("fs"); | ||
var _path = require("path"); | ||
@@ -50,2 +36,12 @@ | ||
function jsonFiles(dirName) { | ||
var fileList = _fs.readdirSync(dirName); | ||
return fileList.reduce(function(sum, file) { | ||
if (JSON_EXTENSION.test(file)) { | ||
return sum.concat(file.match(JSON_EXTENSION)[1]); | ||
} | ||
}, []); | ||
} | ||
function cldrData(path/*, ...*/) { | ||
@@ -66,3 +62,4 @@ assert(typeof path === "string", "must include path (e.g., " + | ||
return locales.reduce(function(sum, locale) { | ||
MAIN_FILES.forEach(function(mainFile) { | ||
var mainFiles = jsonFiles(_path.join("main", locale)); | ||
mainFiles.forEach(function(mainFile) { | ||
sum.push(_path.join("main", locale, mainFile)); | ||
@@ -75,3 +72,5 @@ }); | ||
function supplementalPaths() { | ||
return SUPPLEMENTAL_FILES.map(function(supplementalFile) { | ||
var supplementalFiles = jsonFiles("supplemental"); | ||
return supplementalFiles.map(function(supplementalFile) { | ||
return _path.join("supplemental", supplementalFile); | ||
@@ -78,0 +77,0 @@ }); |
{ | ||
"name": "cldr-data", | ||
"version": "25.0.13", | ||
"version": "25.0.14", | ||
"keywords": [ | ||
@@ -30,3 +30,3 @@ "unicode", | ||
"install": "node install.js", | ||
"test": "grunt" | ||
"test": "grunt && node test/index.js" | ||
}, | ||
@@ -33,0 +33,0 @@ "dependencies": { |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
11
221
12976
8