Skip to content

Commit

Permalink
fix: 'dedent' wrapper function to fix unwanted indentation when escap…
Browse files Browse the repository at this point in the history
…ing new lines
  • Loading branch information
EgizianoEG committed Sep 25, 2024
1 parent f441b89 commit 8107ae4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/Utilities/Classes/LOAEventLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ import { LeaveOfAbsence } from "@Typings/Utilities/Database.js";
import { isAfter } from "date-fns";

import GuildModel from "@Models/Guild.js";
import Dedent from "dedent";
import RegularDedent from "dedent";

const Dedent = (Str: string) => {
return RegularDedent(Str)
.replace(/\.\s{2,}(\w)/g, ". $1")
.replace(/(\w)\s{2,}(\w)/g, "$1 $2");
};

type LOADocument = LeaveOfAbsence.LeaveOfAbsenceHydratedDocument;
type ManagementInteraction = ButtonInteraction<"cached"> | ModalSubmitInteraction<"cached">;
Expand Down

0 comments on commit 8107ae4

Please sign in to comment.