From 29e06fdf915af1b4ff46050013cf2685a59f7020 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Wed, 28 Aug 2024 16:13:11 +0200 Subject: [PATCH] Our own `MaybePromise` --- src/lib/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/index.ts b/src/lib/index.ts index c2c405a..84ebbc6 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,7 +1,6 @@ // place files you want to import through the `$lib` alias in this folder. import path from 'path'; import bunyan from 'bunyan'; -import type { MaybePromise } from '@sveltejs/kit'; export const log = bunyan.createLogger({ name: 'fotochallenge', @@ -33,6 +32,8 @@ export const requestIdHeader = 'x-request-id'; export default safePath; +export type MaybePromise = T | Promise; + export async function timedExecution( fn: () => MaybePromise ): Promise<{ executionTime: number; result: T }> {