@@ -46,12 +46,12 @@ export type ObjectChain<Input extends ChainTagged,
46
46
Steps extends cons . NRConsList < UPObjectStepSpec > ,
47
47
// this param is only here so that a chain value's IntelliSense
48
48
// shows the chain's return type
49
- _Return = ObjectChainStepsReturn < Steps , Input > > = {
49
+ _Return = ObjectChainStepsReturn < Steps , Input > > = {
50
50
51
51
readonly tag : ChainTag < Input >
52
52
readonly tagStr : Input [ '_tag' ]
53
53
54
- readonly steps : ObjectChainSteps < Steps , Input > extends Steps
54
+ readonly steps : Steps extends ObjectChainSteps < Steps , Input >
55
55
? Steps
56
56
: ObjectChainSteps < Steps , Input >
57
57
@@ -207,18 +207,19 @@ export function makePureStep
207
207
export function concatSteps
208
208
< Input extends ChainTagged ,
209
209
const ChainSteps extends cons . NRConsList < UPObjectStepSpec > ,
210
- const NewSteps extends cons . NRConsList < UPObjectStepSpec > >
210
+ const AddSteps extends cons . NRConsList < UPObjectStepSpec > >
211
211
( chain : ObjectChain < Input , ChainSteps > ,
212
- addSteps : NewSteps ) {
213
-
214
- const newSteps =
212
+ addSteps : AddSteps extends cons . ConsList < UPObjectStepSpec , AddSteps >
213
+ ? AddSteps
214
+ : cons . ConsList < UPObjectStepSpec , AddSteps > ) {
215
+
216
+ const newSteps =
215
217
// deno-lint-ignore no-explicit-any
216
218
cons . concat < UPObjectStepSpec > ( ) ( chain . steps as any , addSteps as any )
217
-
219
+
218
220
// deno-lint-ignore no-explicit-any
219
221
return objectChain < Input > ( ) ( chain . tag , newSteps as any ) as
220
- ObjectChain < Input , cons . Concat < UPObjectStepSpec , ChainSteps , NewSteps > >
221
-
222
+ ObjectChain < Input , cons . Concat < UPObjectStepSpec , ChainSteps , AddSteps > >
222
223
}
223
224
224
225
////////////////////////////////// recursion support ////////////////////
0 commit comments