Skip to content

Commit

Permalink
fix: use named CJS exports to improve tree shaking
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <[email protected]>
  • Loading branch information
Jérôme Benoit committed Jan 10, 2024
1 parent 2888ac3 commit d3e9f6b
Showing 1 changed file with 19 additions and 24 deletions.
43 changes: 19 additions & 24 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
* Exporting every data structure through a unified endpoint. Consumers
* of this library should prefer the modular access though.
*/
var Heap = require('./heap.js'),
FibonacciHeap = require('./fibonacci-heap.js'),
SuffixArray = require('./suffix-array.js'),
Vector = require('./vector.js');

module.exports = {
BiMap: require('./bi-map.js'),
BitSet: require('./bit-set.js'),
Expand All @@ -21,16 +16,16 @@ module.exports = {
DefaultWeakMap: require('./default-weak-map.js'),
FixedDeque: require('./fixed-deque.js'),
StaticDisjointSet: require('./static-disjoint-set.js'),
FibonacciHeap: FibonacciHeap,
MinFibonacciHeap: FibonacciHeap.MinFibonacciHeap,
MaxFibonacciHeap: FibonacciHeap.MaxFibonacciHeap,
FibonacciHeap: require('./fibonacci-heap.js'),
MinFibonacciHeap: require('./fibonacci-heap.js').MinFibonacciHeap,
MaxFibonacciHeap: require('./fibonacci-heap.js').MaxFibonacciHeap,
FixedReverseHeap: require('./fixed-reverse-heap.js'),
FuzzyMap: require('./fuzzy-map.js'),
FuzzyMultiMap: require('./fuzzy-multi-map.js'),
HashedArrayTree: require('./hashed-array-tree.js'),
Heap: Heap,
MinHeap: Heap.MinHeap,
MaxHeap: Heap.MaxHeap,
Heap: require('./heap.js'),
MinHeap: require('./heap.js').MinHeap,
MaxHeap: require('./heap.js').MaxHeap,
StaticIntervalTree: require('./static-interval-tree.js'),
InvertedIndex: require('./inverted-index.js'),
KDTree: require('./kd-tree.js'),
Expand All @@ -45,25 +40,25 @@ module.exports = {
Queue: require('./queue.js'),
FixedStack: require('./fixed-stack.js'),
Stack: require('./stack.js'),
SuffixArray: SuffixArray,
GeneralizedSuffixArray: SuffixArray.GeneralizedSuffixArray,
SuffixArray: require('./suffix-array.js'),
GeneralizedSuffixArray: require('./suffix-array.js').GeneralizedSuffixArray,
set: require('./set.js'),
SparseQueueSet: require('./sparse-queue-set.js'),
SparseMap: require('./sparse-map.js'),
SparseSet: require('./sparse-set.js'),
SymSpell: require('./symspell.js'),
Trie: require('./trie.js'),
TrieMap: require('./trie-map.js'),
Vector: Vector,
Uint8Vector: Vector.Uint8Vector,
Uint8ClampedVector: Vector.Uint8ClampedVector,
Int8Vector: Vector.Int8Vector,
Uint16Vector: Vector.Uint16Vector,
Int16Vector: Vector.Int16Vector,
Uint32Vector: Vector.Uint32Vector,
Int32Vector: Vector.Int32Vector,
Float32Vector: Vector.Float32Vector,
Float64Vector: Vector.Float64Vector,
PointerVector: Vector.PointerVector,
Vector: require('./vector.js'),
Uint8Vector: require('./vector.js').Uint8Vector,
Uint8ClampedVector: require('./vector.js').Uint8ClampedVector,
Int8Vector: require('./vector.js').Int8Vector,
Uint16Vector: require('./vector.js').Uint16Vector,
Int16Vector: require('./vector.js').Int16Vector,
Uint32Vector: require('./vector.js').Uint32Vector,
Int32Vector: require('./vector.js').Int32Vector,
Float32Vector: require('./vector.js').Float32Vector,
Float64Vector: require('./vector.js').Float64Vector,
PointerVector: require('./vector.js').PointerVector,
VPTree: require('./vp-tree.js')
};

0 comments on commit d3e9f6b

Please sign in to comment.