From ca3cca1d6fa0e7c6d8eb0b63554c0b31e300ba8b Mon Sep 17 00:00:00 2001 From: ohmree <13455401+ohmree@users.noreply.github.com> Date: Fri, 22 Jul 2022 19:57:18 +0300 Subject: [PATCH] Properly export and import the `mergePath` helper (#75) * Correctly import `mergePath` * Export `mergePath` --- src/client/helpers.ts | 2 +- src/client/signIn.ts | 1 + src/client/signOut.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/helpers.ts b/src/client/helpers.ts index 320ef4e..182cb65 100644 --- a/src/client/helpers.ts +++ b/src/client/helpers.ts @@ -1,4 +1,4 @@ -function mergePath(basePaths: (string | null)[], path: string) { +export function mergePath(basePaths: (string | null)[], path: string) { if (path.startsWith("/")) { path = path.slice(1); } diff --git a/src/client/signIn.ts b/src/client/signIn.ts index 7eb347e..9da70aa 100644 --- a/src/client/signIn.ts +++ b/src/client/signIn.ts @@ -2,6 +2,7 @@ import { page } from "@sveltejs/kit/assets/runtime/app/stores"; */ import type { LoadInput } from "@sveltejs/kit"; import type { ClientRequestConfig } from "./types"; +import { mergePath } from "./helpers"; interface SignInConfig extends ClientRequestConfig { redirectUrl?: string; diff --git a/src/client/signOut.ts b/src/client/signOut.ts index 6354689..5e0c9c9 100644 --- a/src/client/signOut.ts +++ b/src/client/signOut.ts @@ -1,6 +1,7 @@ /* import { session as session$ } from "$app/stores"; */ import type { ClientRequestConfig } from "./types"; +import { mergePath } from "./helpers"; export async function signOut(config?: ClientRequestConfig) { let res = await fetch(mergePath(["/api/auth", config?.basePath ?? null], "signout"), {