Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"prettier",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript"
"plugin:import/typescript",
"plugin:jest/recommended"
],
"parserOptions": {
"sourceType": "module",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
prerelease: false
- uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish
Expand Down
1 change: 1 addition & 0 deletions jestconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"testEnvironment": "jsdom",
"transform": {
"^.+\\.(t|j)sx?$": "ts-jest"
},
Expand Down
31 changes: 18 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"private": false,
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"engines": {
"npm": "^8",
"node": "^16"
},
"scripts": {
"build": "tsc",
"lint": "eslint --ext js,ts,tsx src",
Expand All @@ -39,18 +43,19 @@
},
"homepage": "https://github.com/aboutbits/internationalization#readme",
"devDependencies": {
"@types/node": "^14.11.5",
"@types/jest": "^26.0.9",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^23.20.0",
"eslint-plugin-prettier": "^3.1.4",
"jest": "^26.2.2",
"prettier": "^2.0.5",
"ts-jest": "^26.1.4",
"typescript": "^3.9.7"
"@types/jest": "^28.1.3",
"@types/node": "^16.0.0",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"@typescript-eslint/parser": "^5.30.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-prettier": "^4.1.0",
"jest": "^28.1.2",
"jest-environment-jsdom": "^28.1.2",
"prettier": "^2.7.1",
"ts-jest": "^28.0.5",
"typescript": "^4.7.4"
}
}
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ class Internationalization<T extends string> {
)

// Check if the potential locale is not undefined else return the fallback language
return (potentialLocale
? potentialLocale.locale
: this.fallbackLanguage) as T
return (
potentialLocale ? potentialLocale.locale : this.fallbackLanguage
) as T
}
}

Expand Down