diff --git a/package.json b/package.json index dd4030a..0f05277 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.js b/src/index.js index 10b1ce9..59701ef 100644 --- a/src/index.js +++ b/src/index.js @@ -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 }