Skip to content

Commit

Permalink
refactor(api)!: util.string.vowels moved to `util.string.alphabet.v…
Browse files Browse the repository at this point in the history
…owels`.

Signed-off-by: Guennadi Maximov C <[email protected]>
  • Loading branch information
DrKJeff16 committed Sep 6, 2024
1 parent 9622cc7 commit 65bdc44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions lua/user_api/types/user/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ require('user_api.types.user.autocmd')
---@class User.Util.Notify
---@field notify fun(msg: string, lvl: NotifyLvl|VimNotifyLvl?, opts: NotifyOpts?)

---@class User.Util.String.Alphabet.Vowels
---@field upper_map { ['A']: 'A', ['E']: 'E', ['I']: 'I', ['O']: 'O', ['U']: 'U' }
---@field lower_map { ['a']: 'a', ['e']: 'e', ['i']: 'i', ['o']: 'o', ['u']: 'u' }

---@class User.Util.String.Alphabet
---@field upper_list string[]
---@field lower_list string[]
---@field upper_map table<string, string>
---@field lower_map table<string, string>

---@class User.Util.String.Vowels: User.Util.String.Alphabet
---@field upper_map { ['A']: 'A', ['E']: 'E', ['I']: 'I', ['O']: 'O', ['U']: 'U' }
---@field lower_map { ['a']: 'a', ['e']: 'e', ['i']: 'i', ['o']: 'o', ['u']: 'u' }
---@field vowels User.Util.String.Alphabet.Vowels

---@class User.Util.String.Digits
---@field all table<string, string>
Expand All @@ -52,7 +53,6 @@ require('user_api.types.user.autocmd')

---@class User.Util.String
---@field alphabet User.Util.String.Alphabet
---@field vowels User.Util.String.Vowels
---@field digits User.Util.String.Digits
---@field capitalize fun(s: string, use_dot: boolean?, triggers: string[]?): (new_str: string)

Expand Down
10 changes: 5 additions & 5 deletions lua/user_api/util/string.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,29 +120,29 @@ M.alphabet.lower_map = {
}

---@diagnostic disable-next-line:missing-fields
M.vowels = {}
M.vowels.upper_list = {
M.alphabet.vowcals = {}
M.alphabet.vowcals.upper_list = {
'A',
'E',
'I',
'O',
'U',
}
M.vowels.lower_list = {
M.alphabet.vowcals.lower_list = {
'a',
'e',
'i',
'o',
'u',
}
M.vowels.upper_map = {
M.alphabet.vowcals.upper_map = {
A = 'A',
E = 'E',
I = 'I',
O = 'O',
U = 'U',
}
M.vowels.lower_map = {
M.alphabet.vowcals.lower_map = {
a = 'a',
e = 'e',
i = 'i',
Expand Down

0 comments on commit 65bdc44

Please sign in to comment.