From a0a2f932adbdc50f07798678693de6ebc8ffc98f Mon Sep 17 00:00:00 2001 From: Person Date: Wed, 11 Sep 2024 01:17:51 -0400 Subject: [PATCH] example update --- examples/custom_fetch/libsql_isomorphic_fetch.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/custom_fetch/libsql_isomorphic_fetch.ts b/examples/custom_fetch/libsql_isomorphic_fetch.ts index 243bdff..0f36e8b 100644 --- a/examples/custom_fetch/libsql_isomorphic_fetch.ts +++ b/examples/custom_fetch/libsql_isomorphic_fetch.ts @@ -1,5 +1,5 @@ //@ts-nocheck -//USENG THE SAME TRANSPORT AS @libsql/client +//USEND THE SAME TRANSPORT AS @libsql/client import { fetch as iso_fetch, Request as iso_Request, Headers as iso_Headers} from '@libsql/isomorphic-fetch'; import { createClient, libsqlFetchLike } from 'libsql-stateless-easy'; import { conf } from './conf'; @@ -15,8 +15,11 @@ import { conf } from './conf'; args[0], { body: args[1]?.body, method: args[1]?.method, - //@ts-ignore - headers: new iso_Headers(args[1]?.headers) + headers: (() => { + const h = new iso_Headers(); + for (const k in args[1]?.headers) h.append(k, args[1]?.headers[k]); + return h; + })() } ) );