Skip to content

Commit

Permalink
Merge pull request meikidd#3 from SN9NV/master
Browse files Browse the repository at this point in the history
language not case sensitive for getCode
  • Loading branch information
meikidd authored Nov 21, 2016
2 parents 7a61f7e + e0697ac commit 4cc164a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "build/index.js",
"scripts": {
"build": "babel src --out-dir build",
"test": "mocha --require babel-core/register"
"test": "mocha --require babel-core/register --harmony_array_includes"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class ISO6391 {

static getCode = (name) => {
const [code] = Object.entries(LANGUAGES_LIST)
.find(([code, language]) => language.name === name || language.nativeName === name)
.find(([code, language]) => language.name.toLowerCase() === name.toLowerCase() || language.nativeName.toLowerCase() === name.toLowerCase())

return code === undefined ? '' : code
}
Expand Down

0 comments on commit 4cc164a

Please sign in to comment.