We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// Using specialized getters const StaticIntervalTree = require("mnemonist/static-interval-tree");
const figures = [ { name: "John II of Cyprus", birth: 1418, death: 1458 }, { name: "Helena Palaiologina", birth: 1428, death: 1458 }, { name: "Ashikaga Yoshikatsu", birth: 1434, death: 1443 }, ];
const tree = StaticIntervalTree.from(figures, [(f) => f.birth, (f) => f.death]);
const result = tree.intervalsOverlappingInterval([1420, 1430]); //Expected [ { name: "Helena Palaiologina", birth: 1428, death: 1458 }, { name: "John II of Cyprus", birth: 1418, death: 1458 } ] result [ ]
console.log(result);
// Using specialized getters
const figures2 = [ [1418, 1458], [1428, 1458], [1434, 1443], ];
const tree2 = StaticIntervalTree.from(figures2);
const result2 = tree2.intervalsOverlappingInterval([1420, 1430]);
console.log(result2); //Expected [ [ 1428, 1458 ], [ 1418, 1458 ] ] result [ [ 1428, 1458 ], [ 1418, 1458 ] ]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
// Using specialized getters
const StaticIntervalTree = require("mnemonist/static-interval-tree");
const figures = [
{ name: "John II of Cyprus", birth: 1418, death: 1458 },
{ name: "Helena Palaiologina", birth: 1428, death: 1458 },
{ name: "Ashikaga Yoshikatsu", birth: 1434, death: 1443 },
];
const tree = StaticIntervalTree.from(figures, [(f) => f.birth, (f) => f.death]);
const result = tree.intervalsOverlappingInterval([1420, 1430]); //Expected [ { name: "Helena Palaiologina", birth: 1428, death: 1458 }, { name: "John II of Cyprus", birth: 1418, death: 1458 } ] result [ ]
console.log(result);
// Using specialized getters
const figures2 = [
[1418, 1458],
[1428, 1458],
[1434, 1443],
];
const tree2 = StaticIntervalTree.from(figures2);
const result2 = tree2.intervalsOverlappingInterval([1420, 1430]);
console.log(result2); //Expected [ [ 1428, 1458 ], [ 1418, 1458 ] ] result [ [ 1428, 1458 ], [ 1418, 1458 ] ]
The text was updated successfully, but these errors were encountered: