Skip to content

Commit

Permalink
Merge pull request #9 from Cloudoki/develop
Browse files Browse the repository at this point in the history
chore(merge): merge develop into master
  • Loading branch information
s1moe2 committed Apr 23, 2019
2 parents 68fad2b + 29e8978 commit 8959c55
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@
"semantic-release": "^15.13.3",
"semantic-release-cli": "^4.1.0"
},
"dependencies": {
"lodash": "^4.17.11"
},
"dependencies": {},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
Expand Down
9 changes: 4 additions & 5 deletions src/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const _ = require('lodash')
const data = require('../data.json')

/**
Expand All @@ -7,7 +6,7 @@ const data = require('../data.json')
* @return {boolean}
*/
const validateLocaleCode = (localeCode) => {
return _.findIndex(data, (l) => l.code === localeCode) !== -1
return data.findIndex((l) => l.code === localeCode) !== -1
}

/**
Expand All @@ -16,7 +15,7 @@ const validateLocaleCode = (localeCode) => {
* @return {boolean}
*/
const validateLanguageCode = (languageCode) => {
return _.findIndex(data, (l) => l.langCode === languageCode) !== -1
return data.findIndex((l) => l.langCode === languageCode) !== -1
}

/**
Expand All @@ -25,7 +24,7 @@ const validateLanguageCode = (languageCode) => {
* @return {string[]} Languages list
*/
const findCountryLanguages = (countryCode) => {
const countryEntries = _.filter(data, (l) => l.countryCode === countryCode)
const countryEntries = data.filter((l) => l.countryCode === countryCode)
const langSet = new Set()

countryEntries.forEach((e, i) => langSet.add(countryEntries[i].langCode))
Expand All @@ -39,7 +38,7 @@ const findCountryLanguages = (countryCode) => {
* @return {string[]} Locales list
*/
const findCountryLocales = (countryCode) => {
const countryEntries = _.filter(data, (l) => l.countryCode === countryCode)
const countryEntries = data.filter((l) => l.countryCode === countryCode)
const localeSet = new Set()

countryEntries.forEach((e, i) => localeSet.add(countryEntries[i].code))
Expand Down

0 comments on commit 8959c55

Please sign in to comment.