Skip to content

Commit

Permalink
refactor: Remove redundant check (#486)
Browse files Browse the repository at this point in the history
`'foo'.startsWith('foo') // true`
  • Loading branch information
Dimitri POSTOLOV authored May 24, 2023
1 parent e479559 commit 5db1f68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --quiet --cache",
"lint:fix": "pnpm lint --fix",
"prettier-check": "prettier --check .",
"prettier-fix": "prettier --write . --cache",
"prettier-fix": "prettier --write --list-different . --cache",
"ci-check": "concurrently \"pnpm prettier-check\" \"pnpm test-type\" \"pnpm lint\""
},
"lint-staged": {
Expand Down
6 changes: 1 addition & 5 deletions src/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ export function detectLanguageCode(

export function normalizeLocale(locale?: string): Locale | undefined {
if (locale) {
return locales.find(
(l) =>
l.toLowerCase() === locale.toLowerCase() ||
l.toLowerCase().startsWith(locale.toLowerCase())
)
return locales.find((l) => l.toLowerCase().startsWith(locale.toLowerCase()))
}
}

1 comment on commit 5db1f68

@vercel
Copy link

@vercel vercel bot commented on 5db1f68 May 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.