diff --git a/package.json b/package.json index 42d8f89..4f00104 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skyleague/event-horizon-dev", - "version": "4.0.4", + "version": "4.0.11", "description": "The accompanying development package for @skyleague/event-horizon.", "repository": { "type": "git", @@ -26,7 +26,7 @@ "package.json" ], "scripts": { - "build": "npx ts-node --esm build.config.ts", + "build": "npx tsx build.config.ts", "build:docs": "npx typedoc", "check:cost": "npx cost-of-modules --no-install --include-dev", "check:coverage": "npx vitest run --coverage=true", @@ -85,7 +85,8 @@ "node-standards": { "extends": "yargs-cli", "rules": { - "exports": false + "exports": false, + "scripts": false } } } diff --git a/src/lib/event-horizon/http/http.ts b/src/lib/event-horizon/http/http.ts index 061627b..8680785 100644 --- a/src/lib/event-horizon/http/http.ts +++ b/src/lib/event-horizon/http/http.ts @@ -42,6 +42,17 @@ export function httpEvent< event.raw.isBase64Encoded ? Buffer.from(b.toString()).toString('base64') : b ) as typeof event.raw.body } + + // force coercion + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + http.schema.body?.is?.(event.body) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + http.schema.headers?.is?.(event.headers) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + http.schema.query?.is?.(event.query) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + http.schema.path?.is?.(event.path) + event.raw.headers ??= (event.headers as typeof event.raw.headers) ?? {} event.raw.queryStringParameters ??= (event.query as typeof event.raw.queryStringParameters) ?? {} const rawEvent = event.raw