Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit dde7e11

Browse files
soedirgoinian
authored andcommitted
fix: prefer global fetch over cross-fetch
1 parent 8529e1a commit dde7e11

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lib/types.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ export abstract class PostgrestBuilder<T> implements PromiseLike<PostgrestRespon
6262

6363
constructor(builder: PostgrestBuilder<T>) {
6464
Object.assign(this, builder)
65-
this.fetch = builder.fetch || crossFetch
65+
if (builder.fetch) {
66+
this.fetch = builder.fetch
67+
} else if (typeof fetch === 'undefined') {
68+
this.fetch = crossFetch
69+
} else {
70+
this.fetch = fetch
71+
}
6672
}
6773

6874
/**
@@ -130,7 +136,7 @@ export abstract class PostgrestBuilder<T> implements PromiseLike<PostgrestRespon
130136
error = JSON.parse(body)
131137
} catch {
132138
error = {
133-
message: body
139+
message: body,
134140
}
135141
}
136142

0 commit comments

Comments
 (0)