summaryrefslogtreecommitdiff
path: root/src/utils/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/index.ts')
-rw-r--r--src/utils/index.ts19
1 files changed, 19 insertions, 0 deletions
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<T> = Promise<T> | T;