two-stroke 5.7.0 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -11,14 +11,14 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@cloudflare/vitest-pool-workers": "^0.8.65",
14
- "@cloudflare/workers-types": "^4.20250816.0",
14
+ "@cloudflare/workers-types": "^4.20250819.0",
15
15
  "@sentry/cli": "^2.52.0",
16
16
  "@types/node": "^24.3.0",
17
17
  "@typescript-eslint/eslint-plugin": "^8.40.0",
18
18
  "@typescript-eslint/parser": "^8.40.0",
19
19
  "@vitest/coverage-istanbul": "^3.2.4",
20
20
  "eslint-config-prettier": "^10.1.8",
21
- "eslint-config-two-stroke": "^1.2.6",
21
+ "eslint-config-two-stroke": "^1.2.7",
22
22
  "eslint-config-typescript": "^3.0.0",
23
23
  "jose": "^6.0.12",
24
24
  "jwk-subtle": "^1.0.7",
@@ -52,7 +52,7 @@
52
52
  "name": "two-stroke",
53
53
  "packageManager": "yarn@4.6.0",
54
54
  "type": "module",
55
- "version": "5.7.0",
55
+ "version": "5.8.1",
56
56
  "devDependencies": {
57
57
  "@types/eslint": "^9.6.1",
58
58
  "eslint": "^9.33.0",
package/src/index.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { verify as jwkVerify } from "jwk-subtle";
2
2
  import { verify as pbkdfVerify } from "pbkdf-subtle";
3
3
  import { Toucan } from "toucan-js";
4
- import { ZodSafeParseResult, ZodObject, z, ZodType } from "zod/v4";
4
+ import { type ZodSafeParseResult, ZodObject, z, ZodType } from "zod/v4";
5
5
  import { openAPI } from "./open-api";
6
- import { Env, Handler, Route } from "./types";
6
+ import { type Env, type Handler, type Route } from "./types";
7
7
 
8
8
  // eslint-disable-next-line @typescript-eslint/require-await
9
9
  const noAuth = async () => null;
@@ -51,7 +51,10 @@ export function twoStroke<T extends Env>(
51
51
  ): Promise<Response> {
52
52
  const defaultHeaders = {
53
53
  "Access-Control-Allow-Origin": origin
54
- ? origin(req.headers.get("Origin"))
54
+ ? env.SENTRY_ENVIRONMENT === "staging" &&
55
+ req.headers.get("Origin")?.split(":")[1]?.endsWith("localhost")
56
+ ? (req.headers.get("Origin") ?? "")
57
+ : origin(req.headers.get("Origin"))
55
58
  : "*",
56
59
  };
57
60
  const sentry = new Toucan({
package/src/open-api.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z, ZodType } from "zod/v4";
2
- import { Env, Route } from "./types";
2
+ import { type Env, type Route } from "./types";
3
3
 
4
4
  export const openAPI =
5
5
  <T extends Env, A>(
package/src/test.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JWTPayload, SignJWT, exportJWK, generateKeyPair } from "jose";
1
+ import { type JWTPayload, SignJWT, exportJWK, generateKeyPair } from "jose";
2
2
  import { fetchMock, SELF, env } from "cloudflare:test";
3
3
  import createClient from "openapi-fetch";
4
4
 
package/tsconfig.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "erasableSyntaxOnly": true,
3
4
  "esModuleInterop": true,
4
5
  "isolatedModules": true,
5
6
  "lib": ["ESNext"],
@@ -14,7 +15,8 @@
14
15
  "@cloudflare/workers-types",
15
16
  "vitest/globals",
16
17
  "@cloudflare/vitest-pool-workers"
17
- ]
18
+ ],
19
+ "verbatimModuleSyntax": true
18
20
  },
19
21
  "exclude": ["../../dist"]
20
22
  }