Skip to content

Commit fee011d

Browse files
authoredMay 9, 2024··
Fix complexity type error (#1035)
1 parent 3bdab60 commit fee011d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed
 

‎types/transform/object-mode.d.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type {StdioSingleOption, StdioOptionCommon} from '../stdio/type.js';
22
import type {FdStdioOption} from '../stdio/option.js';
33
import type {CommonOptions} from '../arguments/options.js';
4-
import type {GeneratorTransformFull, DuplexTransform, WebTransform} from './normalize.js';
4+
import type {DuplexTransform} from './normalize.js';
55

66
// Whether a file descriptor is in object mode
77
// 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
1515
: StdioOptionType
1616
>;
1717

18-
type IsObjectStdioSingleOption<StdioSingleOptionType extends StdioSingleOption> = StdioSingleOptionType extends GeneratorTransformFull<boolean> | WebTransform
18+
type IsObjectStdioSingleOption<StdioSingleOptionType extends StdioSingleOption> = StdioSingleOptionType extends {objectMode?: boolean}
1919
? BooleanObjectMode<StdioSingleOptionType['objectMode']>
2020
: StdioSingleOptionType extends DuplexTransform
21-
? DuplexObjectMode<StdioSingleOptionType>
21+
? StdioSingleOptionType['transform']['readableObjectMode']
2222
: false;
2323

2424
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'];

0 commit comments

Comments
 (0)
Please sign in to comment.