Skip to content

Commit

Permalink
fix: use @supabase/node-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Aug 23, 2023
1 parent 8d3f1e9 commit d7b7eaf
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 76 deletions.
131 changes: 58 additions & 73 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"db:run": "cd test/db && docker-compose up --detach && wait-for-localhost 3000"
},
"dependencies": {
"cross-fetch": "^3.1.5"
"@supabase/node-fetch": "^2.6.13"
},
"devDependencies": {
"@types/jest": "^27.5.1",
Expand Down
5 changes: 3 additions & 2 deletions src/PostgrestBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import crossFetch from 'cross-fetch'
// @ts-ignore
import nodeFetch from '@supabase/node-fetch'

import type { Fetch, PostgrestSingleResponse } from './types'

Expand Down Expand Up @@ -28,7 +29,7 @@ export default abstract class PostgrestBuilder<Result>
if (builder.fetch) {
this.fetch = builder.fetch
} else if (typeof fetch === 'undefined') {
this.fetch = crossFetch
this.fetch = nodeFetch
} else {
this.fetch = fetch
}
Expand Down

0 comments on commit d7b7eaf

Please sign in to comment.