From 2a6480e2f1da51b6bf624966ef339ac5a3e9bba7 Mon Sep 17 00:00:00 2001 From: Fayorg Date: Tue, 5 Dec 2023 23:51:41 +0100 Subject: [PATCH] add: added fetcher for swr --- lib/fetcher.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 lib/fetcher.ts diff --git a/lib/fetcher.ts b/lib/fetcher.ts new file mode 100644 index 0000000..04852d0 --- /dev/null +++ b/lib/fetcher.ts @@ -0,0 +1,3 @@ +import { stat } from "fs"; + +export const fetcher = (input: URL | RequestInfo, init?: RequestInit | undefined) => fetch(input, init).then(res => res.json().then(data => ({...data, status: res.status}))); \ No newline at end of file