Skip to content

chore: migrate src/app.ts to Express 5 query param types #112

@salishforge

Description

@salishforge

Context

Dependabot PR #91 (Express 4.22.1 → 5.2.1) was closed because Express 5 changes `req.query` param types, causing ~15 TypeScript compilation errors in `src/app.ts`.

Breaking change

In Express 5, query params are typed as `string | string[]` instead of `string`, so passing `req.query.foo` directly where a `string` is expected fails to compile.

Affected locations in src/app.ts

Lines ~877, 881, 887, 907, 923, 936, 939, 976, 984, 991, 1009, 1020, 1030 — all query-param extraction sites.

Fix pattern

Add a small helper and use it at every extraction site:

```typescript
function qstr(v: unknown): string | undefined {
return typeof v === 'string' ? v : undefined;
}
// then: const q = qstr(req.query.q);
```

Re-open the Dependabot bump once this migration is done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions