From f9a77c5c27aede4e5978eb55d9b7af781b680a1d Mon Sep 17 00:00:00 2001 From: João Augusto Costa Branco Marado Torres Date: Tue, 24 Jun 2025 12:08:41 -0300 Subject: feat!: initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Augusto Costa Branco Marado Torres --- src/utils/index.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/utils/index.ts (limited to 'src/utils/index.ts') diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..5a083d5 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,19 @@ +import { trailingSlash } from "astro:config/client"; + +export function addForwardSlash(path: string): string { + if (trailingSlash === "always") { + return path.endsWith("/") ? path : path + "/"; + } else { + return path; + } +} + +export const enum Level { + OK, + INFO, + WARN, + DEBUG, + ERROR, +} + +export type MaybePromise = Promise | T; -- cgit v1.2.3