Skip to content

Commit

Permalink
lib: tune calculate output for childs conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
narekhovhannisyan committed Jan 16, 2024
1 parent 51d2b1d commit 637daae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/lib/supercomputer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,19 @@ export class Supercomputer {
childrenObject: Children,
childName: string
) {
this.childAmount++;
const itHasChildren = 'children' in childrenObject[childName];
const itHasInputs = 'inputs' in childrenObject[childName];

if ('children' in childrenObject[childName]) {
await this.compute(childrenObject[childName].children);
if (itHasChildren) {
return this.compute(childrenObject[childName].children);
}

if (!('inputs' in childrenObject[childName])) {
if (!(itHasChildren || itHasInputs)) {
throw new ImplValidationError(STRUCTURE_MALFORMED(childName));
}

this.childAmount++;

const {pipeline, config} = this.parent;
const {inputs} = childrenObject[childName];

Expand Down

0 comments on commit 637daae

Please sign in to comment.