Skip to content

Commit

Permalink
code review fix, split preset just once
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Linderoth committed Jun 28, 2021
1 parent 05f445b commit 0529560
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ const parseLocale = (preset, object, isLocal) => {
Ls[presetLower] = object
l = presetLower
}
if (!l && preset.split('-').length > 1) {
return parseLocale(preset.split('-')[0])
const presetSplit = preset.split('-')
if (!l && presetSplit.length) {
return parseLocale(presetSplit[0])
}
} else {
const { name } = preset
Expand Down

0 comments on commit 0529560

Please sign in to comment.