UNPKG

@tylerbu/sorted-btree-es6

Version:

A sorted list of key-value pairs in a fast, typed in-memory B+ tree with a powerful API.

2 lines (1 loc) 1.19 kB
Object.defineProperty(exports,"__esModule",{value:!0}),exports.BTreeEx=void 0;let b_tree_1=require("../b+tree"),diffAgainst_1=require("./diffAgainst"),forEachKeyInBoth_1=require("./forEachKeyInBoth"),forEachKeyNotIn_1=require("./forEachKeyNotIn"),intersect_1=require("./intersect"),subtract_1=require("./subtract"),union_1=require("./union"),bulkLoad_1=require("./bulkLoad");class BTreeEx extends b_tree_1.BTree{static bulkLoad(e,r,t,o){o=o??b_tree_1.defaultComparator,e=(0,bulkLoad_1.bulkLoadRoot)(e,r,t,o),r=new BTreeEx(void 0,o,t);return r._root=e,r}clone(){this._root.isShared=!0;var e=new BTreeEx(void 0,this._compare,this._maxNodeSize);return e._root=this._root,e}greedyClone(e){var r=new BTreeEx(void 0,this._compare,this._maxNodeSize);return r._root=this._root.greedyClone(e),r}diffAgainst(e,r,t,o){return(0,diffAgainst_1.diffAgainst)(this,e,r,t,o)}forEachKeyInBoth(e,r){return(0,forEachKeyInBoth_1.forEachKeyInBoth)(this,e,r)}forEachKeyNotIn(e,r){return(0,forEachKeyNotIn_1.forEachKeyNotIn)(this,e,r)}intersect(e,r){return(0,intersect_1.intersect)(this,e,r)}union(e,r){return(0,union_1.union)(this,e,r)}subtract(e){return(0,subtract_1.subtract)(this,e)}}exports.BTreeEx=BTreeEx;