Skip to content

Commit 8e8ede4

Browse files
committed
chore: update node types, axios and remove dead deps
1 parent a09436f commit 8e8ede4

File tree

6 files changed

+28
-188
lines changed

6 files changed

+28
-188
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.20.0

bun.lock

Lines changed: 16 additions & 174 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@
5252
"typecheck": "tsc --noEmit"
5353
},
5454
"devDependencies": {
55-
"@babel/core": "7.23.2",
56-
"@babel/traverse": "7.28.5",
5755
"@eslint/js": "9.38.0",
5856
"@tsconfig/strictest": "2.0.7",
5957
"@types/bun": "1.3.1",
60-
"@types/node": "18.7.18",
58+
"@types/node": "22.18.4",
6159
"@types/ws": "8.18.1",
6260
"@typescript-eslint/eslint-plugin": "8.46.2",
6361
"@typescript-eslint/parser": "8.46.2",
@@ -67,8 +65,6 @@
6765
"eslint-plugin-simple-import-sort": "12.1.1",
6866
"globals": "16.4.0",
6967
"jiti": "2.6.1",
70-
"jsdom": "20.0.0",
71-
"jsdom-global": "3.0.2",
7268
"path": "0.12.7",
7369
"prettier": "3.6.2",
7470
"tsup": "8.5.0",
@@ -79,11 +75,7 @@
7975
"dependencies": {
8076
"@polymarket/builder-signing-sdk": "^0.0.8",
8177
"@polymarket/order-utils": "^2.1.0",
82-
"axios": "^0.27.2",
83-
"browser-or-node": "^2.1.1",
78+
"axios": "^0.30.2",
8479
"ethers": "^5.7.1"
85-
},
86-
"resolutions": {
87-
"@babel/traverse": ">=7.23.2"
8880
}
8981
}

src/http-helpers/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import axios, { type AxiosRequestHeaders, type Method } from "axios";
2-
import { isBrowser } from "browser-or-node";
3-
import type { DropNotificationParams, OrdersScoringParams } from "src/types";
2+
3+
import type { DropNotificationParams, OrdersScoringParams } from "../types";
4+
import { isBrowser } from "../utilities";
45

56
export const GET = "GET";
67
export const POST = "POST";
78
export const DELETE = "DELETE";
89
export const PUT = "PUT";
910

1011
const overloadHeaders = (method: Method, headers?: Record<string, string | number | boolean>) => {
11-
if (isBrowser) {
12+
if (isBrowser()) {
1213
return;
1314
}
1415

src/utilities.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { createHash } from "crypto";
33

44
import { type NewOrder, type OrderBookSummary, OrderType, Side, type TickSize } from "./types";
55

6+
export const isBrowser = () => {
7+
return typeof window !== "undefined" && typeof window.document !== "undefined";
8+
};
9+
610
export function orderToJson<T extends OrderType>(
711
order: SignedOrder,
812
owner: string,

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"skipLibCheck": true,
99
"target": "ESNext",
1010
"module": "ESNext",
11-
"lib": ["ESNext"],
11+
"lib": ["ESNext", "DOM"],
1212
"allowJs": true,
1313
"resolveJsonModule": true,
1414
"moduleResolution": "Bundler",

0 commit comments

Comments
 (0)