Skip to content

Commit

Permalink
toJSON for node
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed May 7, 2020
1 parent b599f2c commit 5d6b8a4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ module.exports = class ProcessGraphNode {
this.computedResult = null;
}

toJSON() {
let args = {};
for(var key in this.arguments) {
let arg = this.arguments[key];
args[key] = typeof arg.toJSON === 'function' ? arg.toJSON() : arg;
}
return {
process_id: this.process_id,
description: this.description,
arguments: args,
result: this.isResultNode
};
}

getProcessGraph() {
return this.processGraph;
}
Expand Down

0 comments on commit 5d6b8a4

Please sign in to comment.