Skip to content

Commit 9e082dd

Browse files
committed
type check
1 parent a13ff4e commit 9e082dd

File tree

6 files changed

+28
-3
lines changed

6 files changed

+28
-3
lines changed

apps/browser-proxy/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"type": "module",
44
"scripts": {
55
"start": "node --env-file=.env --experimental-strip-types src/index.ts",
6-
"dev": "node --watch --env-file=.env --experimental-strip-types src/index.ts"
6+
"dev": "node --watch --env-file=.env --experimental-strip-types src/index.ts",
7+
"type-check": "tsc"
78
},
89
"dependencies": {
910
"@aws-sdk/client-s3": "^3.645.0",
@@ -13,6 +14,7 @@
1314
"ws": "^8.18.0"
1415
},
1516
"devDependencies": {
17+
"@total-typescript/tsconfig": "^1.0.4",
1618
"@types/debug": "^4.1.12",
1719
"@types/node": "^22.5.4",
1820
"typescript": "^5.5.4"

apps/browser-proxy/src/extract-ip.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function extractIP(address: string): string {
88
// Check if it's an IPv4-mapped IPv6 address
99
const ipv4 = address.match(/::ffff:(\d+\.\d+\.\d+\.\d+)/)
1010
if (ipv4) {
11-
return ipv4[1]
11+
return ipv4[1]!
1212
}
1313

1414
// We assume it's an IPv6 address
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module 'findhit-proxywrap' {
2+
const module = {
3+
proxy: (net: typeof import('node:net')) => typeof net,
4+
}
5+
export default module
6+
}

apps/browser-proxy/src/servername.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const regexPattern = new RegExp(`^([^.]+)\\.${escapedDomain}$`)
88

99
export function extractDatabaseId(servername: string): string {
1010
const match = servername.match(regexPattern)
11-
return match![1]
11+
return match![1]!
1212
}
1313

1414
export function isValidServername(servername: string): boolean {

apps/browser-proxy/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "@total-typescript/tsconfig/tsc/no-dom/app",
3+
"include": ["src/**/*.ts"],
4+
"compilerOptions": {
5+
"noEmit": true,
6+
"allowImportingTsExtensions": true,
7+
"outDir": "dist"
8+
}
9+
}

package-lock.json

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

0 commit comments

Comments
 (0)