@@ -235,3 +235,65 @@ instanceOverride.write = function(chunk) {
235235 return true ;
236236} ;
237237Readable . from ( [ source ( "instance-override" ) ] ) . pipe ( instanceOverride ) ;
238+
239+ const writableOptions = {
240+ objectMode : true ,
241+ write ( chunk , encoding , callback ) {
242+ consumeChunk ( chunk ) ; // $ MISSING: flow=options-write
243+ consumeChunk ( this . value ) ; // $ MISSING: flow=options-receiver
244+ consumeChunk ( encoding ) ;
245+ consumeChunk ( callback ) ;
246+ callback ( ) ;
247+ }
248+ } ;
249+ const optionsDestination = new Writable ( writableOptions ) ;
250+ optionsDestination . value = source ( "options-receiver" ) ;
251+ Readable . from ( [ source ( "options-write" ) ] ) . pipe ( optionsDestination ) ;
252+
253+ const transformOptions = {
254+ transform ( chunk , encoding , callback ) {
255+ consumeChunk ( chunk ) ; // $ MISSING: flow=options-transform
256+ consumeChunk ( encoding ) ;
257+ consumeChunk ( callback ) ;
258+ callback ( null , chunk ) ;
259+ }
260+ } ;
261+ const transformOptionsAlias = transformOptions ;
262+ const { Transform : ImportedTransform } = require ( "node:stream" ) ;
263+ const optionsTransform = new ImportedTransform ( transformOptionsAlias ) ;
264+ Readable . from ( [ source ( "options-transform" ) ] ) . pipe ( optionsTransform ) ;
265+
266+ const optionsDuplex = new Duplex ( {
267+ read ( ) { } ,
268+ write ( chunk , encoding , callback ) {
269+ consumeChunk ( chunk ) ; // $ MISSING: flow=options-duplex
270+ callback ( ) ;
271+ }
272+ } ) ;
273+ Readable . from ( [ source ( "options-duplex" ) ] ) . pipe ( optionsDuplex ) ;
274+
275+ function writeTransformOption ( chunk , encoding , callback ) {
276+ consumeChunk ( chunk ) ; // $ MISSING: flow=options-transform-write
277+ callback ( ) ;
278+ }
279+ const writeTransformAlias = writeTransformOption ;
280+ const optionsTransformWrite = new Transform ( {
281+ write : writeTransformAlias ,
282+ transform ( chunk , encoding , callback ) {
283+ consumeChunk ( chunk ) ;
284+ callback ( null , chunk ) ;
285+ }
286+ } ) ;
287+ Readable . from ( [ source ( "options-transform-write" ) ] ) . pipe ( optionsTransformWrite ) ;
288+
289+ const overriddenOptionsDestination = new Writable ( {
290+ write ( chunk , encoding , callback ) {
291+ consumeChunk ( chunk ) ;
292+ callback ( ) ;
293+ }
294+ } ) ;
295+ overriddenOptionsDestination . write = function ( chunk ) {
296+ consumeChunk ( chunk ) ; // $ flow=options-public-write
297+ return true ;
298+ } ;
299+ Readable . from ( [ source ( "options-public-write" ) ] ) . pipe ( overriddenOptionsDestination ) ;
0 commit comments