Skip to content

IncommingMessage extends Readable, but it's destroy method not return this #32772

Closed
@LongTengDao

Description

@LongTengDao

Is your feature request related to a problem? Please describe.

DefinitelyTyped/DefinitelyTyped#43782

node doc said stream.destroy should return this, but in old node.d.ts, it was wrongly written void.

when I want to fix this, I found I can't pass the test, because IncommingMessage extends stream, and its destroy method return void.

when I check soure code for node, I found in fact IncommingMessage.prototype.destroy return void, here it's not wrong.

but they are conflict, and I can't fix them togethor only in node.d.ts.

Describe the solution you'd like

make IncommingMessage.prototype.destroy return this

Describe alternatives you've considered

make Readable.prototype.destroy and Writable.prototype.destroy return void

I'm not sure which will make a bigger break change, I think we must discuss carefully

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions