File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 1
1
import type { StdioSingleOption , StdioOptionCommon } from '../stdio/type.js' ;
2
2
import type { FdStdioOption } from '../stdio/option.js' ;
3
3
import type { CommonOptions } from '../arguments/options.js' ;
4
- import type { GeneratorTransformFull , DuplexTransform , WebTransform } from './normalize.js' ;
4
+ import type { DuplexTransform } from './normalize.js' ;
5
5
6
6
// Whether a file descriptor is in object mode
7
7
// I.e. whether `result.stdout|stderr|stdio|all` is an array of `unknown` due to `objectMode: true`
@@ -15,14 +15,10 @@ type IsObjectStdioOption<StdioOptionType extends StdioOptionCommon> = IsObjectSt
15
15
: StdioOptionType
16
16
> ;
17
17
18
- type IsObjectStdioSingleOption < StdioSingleOptionType extends StdioSingleOption > = StdioSingleOptionType extends GeneratorTransformFull < boolean > | WebTransform
18
+ type IsObjectStdioSingleOption < StdioSingleOptionType extends StdioSingleOption > = StdioSingleOptionType extends { objectMode ?: boolean }
19
19
? BooleanObjectMode < StdioSingleOptionType [ 'objectMode' ] >
20
20
: StdioSingleOptionType extends DuplexTransform
21
- ? DuplexObjectMode < StdioSingleOptionType >
21
+ ? StdioSingleOptionType [ 'transform' ] [ 'readableObjectMode' ]
22
22
: false ;
23
23
24
24
type BooleanObjectMode < ObjectModeOption extends boolean | undefined > = ObjectModeOption extends true ? true : false ;
25
-
26
- type DuplexObjectMode < OutputOption extends DuplexTransform > = OutputOption [ 'objectMode' ] extends boolean
27
- ? OutputOption [ 'objectMode' ]
28
- : OutputOption [ 'transform' ] [ 'readableObjectMode' ] ;
You can’t perform that action at this time.
0 commit comments