Skip to content

Incorrect rename of express's Request & Response types #353

@nfriedly

Description

@nfriedly

Bug report

express-rate-limit uses express's Request & Response types, which I believe extend nodejs's Request & Response types.

When we switched from dts-bundle-generator v8.0.1 to v9.5.1, it started renaming these to Request$1, and Response$1, but all of the other types still reference them as Request & Response - nothing references Request$1 or Response$1.

Input code

import type { Request, Response } from 'express'

export function foo(request: Request, response: Response) {
    console.log(request, response)
}

Expected output

(Actual output with the old version)

// Generated by dts-bundle-generator v8.0.1

import { Request, Response } from 'express';

export declare function foo(request: Request, response: Response): void;

export {};

Actual output

// Generated by dts-bundle-generator v9.5.1

import { Request as Request$1, Response as Response$1 } from 'express';

export declare function foo(request: Request, response: Response): void;

export {};

Additional context
The sample code above was done in a test.ts file in the source directory, it's possible that it depends on our tsconfig.json or our node_modules (or the fact that they were installed via pnpm rather than npm).

First reported at express-rate-limit/express-rate-limit#530

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions