Skip to content

Commit

Permalink
Refactor: use native fetch (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh authored Sep 1, 2023
1 parent a816d76 commit 04c9733
Show file tree
Hide file tree
Showing 4 changed files with 570 additions and 597 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"repository": "git@github.com:safe-global/safe-gateway-typescript-sdk.git",
"author": "katspaugh",
"license": "MIT",
"dependencies": {
"cross-fetch": "^3.1.5"
"engines": {
"node": ">=16"
},
"devDependencies": {
"@types/jest": "^29.2.1",
Expand Down
2 changes: 0 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import fetch from 'cross-fetch'

export type Params = Record<string, string | number | boolean | null>

export type ErrorResponse = {
Expand Down
5 changes: 1 addition & 4 deletions tests/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import fetch from 'cross-fetch'
import { fetchData, insertParams, stringifyQuery } from '../src/utils'

jest.mock('cross-fetch')

const fetchMock = fetch as typeof fetch & jest.Mock
const fetchMock = jest.spyOn(global, 'fetch') as typeof fetch & jest.Mock

describe('utils', () => {
describe('insertParams', () => {
Expand Down
Loading

0 comments on commit 04c9733

Please sign in to comment.