alexrsagen/node-es6-request

Cant build my project

Opened this issue · 3 comments

Hello,
I am using es6-request module and can't build my project. When my files are transpiled from TS to JS i got an error with the line pipe(dest: stream.Writable, opt?: object): this; of index.d.ts . If I comment this line, I can build my project.

The error say "Property 'pipe' in type 'ES6Request' is not assignable to the same property in base type 'Duplex'."

Do you have an idea of what is causing my problem?

Thank you,

Hello,

The 'pipe' function signature in 'ES6Request' is not the same than his implementation in 'Duplex' which is :

pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;

New Typescript versions seems to have stricter rules about this.

An issue is currently open on Typescript lib about this. While waiting for answers, it will be great to change the pipe signature on node-es6-resquest.

Hey, I'm on holiday right now.

You're welcome to submit a PR updating the signature (and modifying any underlying code, if neccessary).

I have also asked my friend @Cyberuben to look into the issue, so if a PR is not submitted he might be able to fix it tonight or tomorrow.

Hello, I used your fix in index.d.ts from your repo:
" pipe(destination: T, options?: { end?: boolean; }): T; "
It works fine, thank you!
If you can publish a new version on NPM it would be great.