Skip to content

Commit

Permalink
Update examples to use @steelbreeze/graph
Browse files Browse the repository at this point in the history
  • Loading branch information
mesmo committed Jul 12, 2018
1 parent 5231311 commit 05e2a9c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules

.nyc_output
8 changes: 4 additions & 4 deletions examples/lca.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use strict";
exports.__esModule = true;
var index_1 = require("../lib/node/index");
var graph_1 = require("@steelbreeze/graph");
function test(node1, node2) {
var ancestry1 = index_1.Tree.ancestors(node1);
var ancestry2 = index_1.Tree.ancestors(node2);
var i = index_1.Tree.lowestCommonAncestorIndex(ancestry1, ancestry2);
var ancestry1 = graph_1.Tree.ancestors(node1);
var ancestry2 = graph_1.Tree.ancestors(node2);
var i = graph_1.Tree.lowestCommonAncestorIndex(ancestry1, ancestry2);
if (i !== -1) {
var ancestor = ancestry1[i];
console.log("Common ancestor of " + node1 + " and " + node2 + " is " + ancestor);
Expand Down
2 changes: 1 addition & 1 deletion examples/lca.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tree } from "../lib/node/index";
import { Tree } from "@steelbreeze/graph";

function test<TNode extends { parent: TNode | undefined }>(node1: TNode, node2): void {
const ancestry1 = Tree.ancestors(node1);
Expand Down

0 comments on commit 05e2a9c

Please sign in to comment.