[node] Allow object-mode implementations of write and writev in WritableOptions#25263
[node] Allow object-mode implementations of write and writev in WritableOptions#252631 commit merged intoDefinitelyTyped:masterfrom fluggo:master
Conversation
|
I don't understand what happened here. My changes had nothing to do with the failures found in the test. |
|
@fluggo Thank you for submitting this PR! 🔔 @eps1lon @WilcoBakker @inlined @Alorel @parambirs @tellnes @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e @ajafff - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
|
@fluggo The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
|
On my system, the tests fail even on upstream 54a59cd, and in the exact same way as seen in travis-ci. |
|
Blocked on #25271. |
| objectMode?: boolean; | ||
| write?: (chunk: string | Buffer, encoding: string, callback: Function) => any; | ||
| writev?: (chunks: Array<{ chunk: string | Buffer, encoding: string }>, callback: Function) => any; | ||
| write?: (chunk: any, encoding: string, callback: Function) => any; |
There was a problem hiding this comment.
is it really any here or should this be something like {} to avoid null and undefined?
There was a problem hiding this comment.
I wrote "any" to match the definition of write on the stream. The documentation also says <any>; I know of no reason it couldn't be null or undefined on an object-mode stream.
There was a problem hiding this comment.
I have read here https://nodejs.org/dist/latest/docs/api/stream.html#stream_writable_write_chunk_encoding_callback that null is not allowed in object mode. But you are right the APIs should be symmetric.
Writable's write function accepts chunks of type any to permit object-mode usage. The implementations you can provide to Writable's constructor should do the same.
|
A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped! |
…elyTyped#25263) Writable's write function accepts chunks of type any to permit object-mode usage. The implementations you can provide to Writable's constructor should do the same.
Writable's write function accepts chunks of type any to permit object-mode usage. The implementations you can provide to Writable's constructor should do the same.
npm test.)npm run lint package-name(ortscif notslint.jsonis present).If changing an existing definition:
tslint.jsoncontaining{ "extends": "dtslint/dt.json" }.