Skip to content

Commit

Permalink
Defaulted transitionTime to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Maarten van Meersbergen committed Feb 1, 2019
1 parent 1816507 commit a947597
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/ProvenanceGraphTraverser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class ProvenanceGraphTraverser implements IProvenanceGraphTraverser {
*/
async toStateNode(
id: NodeIdentifier,
transtionTime: number
transtionTime?: number
): Promise<ProvenanceNode | undefined> {
const currentNode = this.graph.current;
const targetNode = this.graph.getNode(id);
Expand All @@ -144,9 +144,8 @@ export class ProvenanceGraphTraverser implements IProvenanceGraphTraverser {
const arg = this.getFunctionsAndArgsFromTrack(trackToTarget);
functionsToDo = arg.functionsToDo;
argumentsToDo = arg.argumentsToDo;
const transitionTimePerAction = transtionTime / functionsToDo.length;
functionsToDo.forEach((func: any) => {
transitionTimes.push(transitionTimePerAction);
transitionTimes.push(transtionTime || 0);
});
} catch (error) {
if (error.invalidTraversal) {
Expand Down
2 changes: 1 addition & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export interface IProvenanceGraphTraverser {
*
* @param id
*/
toStateNode(id: NodeIdentifier, transitionTime: number): Promise<ProvenanceNode | undefined>;
toStateNode(id: NodeIdentifier, transitionTime?: number): Promise<ProvenanceNode | undefined>;

/**
* Available events:
Expand Down

0 comments on commit a947597

Please sign in to comment.