chore: merge dev
to main
#181
2 changed files with 4 additions and 5 deletions
|
@ -52,14 +52,13 @@ export const splitTime = (time: string) => {
|
|||
[OptionReminder.Mention]: "@",
|
||||
};
|
||||
|
||||
const lowered = time.toLowerCase();
|
||||
const trimmed = lowered.replaceAll(
|
||||
RegexC(Object.values(mapping).join("|"), RegExpFlags.Global),
|
||||
const trimmed = time.replaceAll(
|
||||
RegexC(Object.values(mapping).join("|"), RegExpFlags.Global | RegExpFlags.Insensitive),
|
||||
"",
|
||||
);
|
||||
|
||||
// Depending of the last character of the string
|
||||
switch (lowered.slice(-1)) {
|
||||
switch (time.toLowerCase().slice(-1)) {
|
||||
case mapping[OptionReminder.Mention]:
|
||||
return { time: trimmed, option: OptionReminder.Mention };
|
||||
case mapping[OptionReminder.DirectMessage]:
|
||||
|
|
|
@ -53,7 +53,7 @@ export const strToSeconds = (time: string) => {
|
|||
RegExpFlags.Global | RegExpFlags.Insensitive,
|
||||
);
|
||||
|
||||
const data = Object.assign({}, regex.exec(time.toLowerCase())?.groups);
|
||||
const data = Object.assign({}, regex.exec(time)?.groups);
|
||||
|
||||
if (Object.keys(data).length === 0) {
|
||||
// Regex returned an invalid time
|
||||
|
|
Loading…
Reference in a new issue