@@ -39,7 +39,6 @@ function functionModule (srcOutputDir, forNode, interfaceJson, modulePascalCase,
39
39
let functionContent = `import {\n`
40
40
const usedInterfaceTypes = new Set ( )
41
41
let needMountDirs = false
42
- let needJsonCompatible = false
43
42
const pipelineComponents = [ 'inputs' , 'outputs' , 'parameters' ]
44
43
pipelineComponents . forEach ( ( pipelineComponent ) => {
45
44
interfaceJson [ pipelineComponent ] . forEach ( ( value ) => {
@@ -49,10 +48,6 @@ function functionModule (srcOutputDir, forNode, interfaceJson, modulePascalCase,
49
48
needMountDirs = true
50
49
return
51
50
}
52
- if ( interfaceType === 'JsonCompatible' && pipelineComponent === 'inputs' ) {
53
- needJsonCompatible = true
54
- return
55
- }
56
51
if ( ! ( pipelineComponent === 'inputs' && interfaceType === 'BinaryStream' ) ) {
57
52
usedInterfaceTypes . add ( interfaceType )
58
53
}
@@ -65,9 +60,6 @@ function functionModule (srcOutputDir, forNode, interfaceJson, modulePascalCase,
65
60
functionContent += ' InterfaceTypes,\n'
66
61
functionContent += ' PipelineOutput,\n'
67
62
functionContent += ' PipelineInput,\n'
68
- if ( needJsonCompatible ) {
69
- functionContent += ' JsonCompatible,\n'
70
- }
71
63
if ( forNode ) {
72
64
functionContent += ' runPipelineNode\n'
73
65
} else {
@@ -331,7 +323,9 @@ function functionModule (srcOutputDir, forNode, interfaceJson, modulePascalCase,
331
323
}
332
324
}
333
325
functionContent += '\n'
334
- outputCount ++
326
+ if ( ! interfaceType . includes ( 'File' ) ) {
327
+ outputCount ++
328
+ }
335
329
} else {
336
330
functionContent += ` args.push(${ camel } .toString())\n\n`
337
331
}
@@ -436,10 +430,11 @@ function functionModule (srcOutputDir, forNode, interfaceJson, modulePascalCase,
436
430
if ( ! forNode ) {
437
431
functionContent += ' webWorker: usedWebWorker as Worker,\n'
438
432
}
439
- interfaceJson . outputs . forEach ( ( output , index ) => {
433
+ outputCount = 0
434
+ interfaceJson . outputs . forEach ( ( output ) => {
440
435
const camel = camelCase ( output . name )
441
436
const interfaceType = interfaceJsonTypeToInterfaceType . get ( output . type )
442
- const outputIndex = haveArray ? `${ camel } Index` : index . toString ( )
437
+ const outputIndex = haveArray ? `${ camel } Index` : outputCount . toString ( )
443
438
if ( interfaceType . includes ( 'TextStream' ) || interfaceType . includes ( 'BinaryStream' ) ) {
444
439
if ( haveArray ) {
445
440
const isArray = output . itemsExpectedMax > 1
@@ -465,6 +460,9 @@ function functionModule (srcOutputDir, forNode, interfaceJson, modulePascalCase,
465
460
functionContent += ` ${ camel } : outputs[${ outputIndex } ].data as ${ interfaceType } ,\n`
466
461
}
467
462
}
463
+ if ( ! interfaceType . includes ( 'File' ) ) {
464
+ outputCount ++
465
+ }
468
466
} )
469
467
functionContent += ' }\n'
470
468
functionContent += ' return result\n'
0 commit comments