data-structure-typed 1.32.0 → 1.32.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +12 -1
- package/.prettierrc.js +1 -1
- package/CHANGELOG.md +1 -1
- package/README.md +63 -176
- package/coverage/clover.xml +717 -717
- package/coverage/coverage-final.json +21 -21
- package/coverage/coverage-summary.json +68 -0
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/binary-tree/aa-tree.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/binary-tree/abstract-binary-tree.ts.html +19 -7
- package/coverage/lcov-report/src/data-structures/binary-tree/avl-tree.ts.html +5 -5
- package/coverage/lcov-report/src/data-structures/binary-tree/b-tree.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/binary-tree/binary-indexed-tree.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/binary-tree/binary-tree.ts.html +4 -4
- package/coverage/lcov-report/src/data-structures/binary-tree/bst.ts.html +7 -25
- package/coverage/lcov-report/src/data-structures/binary-tree/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/binary-tree/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/binary-tree/rb-tree.ts.html +4 -4
- package/coverage/lcov-report/src/data-structures/binary-tree/segment-tree.ts.html +2 -2
- package/coverage/lcov-report/src/data-structures/binary-tree/splay-tree.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/binary-tree/tree-multiset.ts.html +9 -9
- package/coverage/lcov-report/src/data-structures/binary-tree/two-three-tree.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/graph/abstract-graph.ts.html +17 -17
- package/coverage/lcov-report/src/data-structures/graph/directed-graph.ts.html +5 -5
- package/coverage/lcov-report/src/data-structures/graph/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/graph/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/graph/map-graph.ts.html +3 -3
- package/coverage/lcov-report/src/data-structures/graph/undirected-graph.ts.html +5 -5
- package/coverage/lcov-report/src/data-structures/hash/coordinate-map.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/hash/coordinate-set.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/hash/hash-table.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/hash/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/hash/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/hash/pair.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/hash/tree-map.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/hash/tree-set.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/heap/heap.ts.html +4 -4
- package/coverage/lcov-report/src/data-structures/heap/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/heap/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/heap/max-heap.ts.html +4 -4
- package/coverage/lcov-report/src/data-structures/heap/min-heap.ts.html +4 -4
- package/coverage/lcov-report/src/data-structures/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/linked-list/doubly-linked-list.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/linked-list/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/linked-list/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/linked-list/singly-linked-list.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/linked-list/skip-linked-list.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/matrix/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/matrix/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/matrix/matrix.ts.html +3 -3
- package/coverage/lcov-report/src/data-structures/matrix/matrix2d.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/matrix/navigator.ts.html +4 -4
- package/coverage/lcov-report/src/data-structures/matrix/vector2d.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/priority-queue/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/priority-queue/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/priority-queue/max-priority-queue.ts.html +6 -6
- package/coverage/lcov-report/src/data-structures/priority-queue/min-priority-queue.ts.html +3 -3
- package/coverage/lcov-report/src/data-structures/priority-queue/priority-queue.ts.html +32 -32
- package/coverage/lcov-report/src/data-structures/queue/deque.ts.html +5 -5
- package/coverage/lcov-report/src/data-structures/queue/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/queue/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/queue/queue.ts.html +2 -2
- package/coverage/lcov-report/src/data-structures/stack/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/stack/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/stack/stack.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/tree/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/tree/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/tree/tree.ts.html +2 -2
- package/coverage/lcov-report/src/data-structures/trie/index.html +1 -1
- package/coverage/lcov-report/src/data-structures/trie/index.ts.html +1 -1
- package/coverage/lcov-report/src/data-structures/trie/trie.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov-report/src/interfaces/index.html +1 -1
- package/coverage/lcov-report/src/interfaces/index.ts.html +1 -1
- package/coverage/lcov-report/src/types/data-structures/abstract-binary-tree.ts.html +1 -1
- package/coverage/lcov-report/src/types/data-structures/bst.ts.html +1 -1
- package/coverage/lcov-report/src/types/data-structures/directed-graph.ts.html +1 -1
- package/coverage/lcov-report/src/types/data-structures/index.html +1 -1
- package/coverage/lcov-report/src/types/data-structures/index.ts.html +1 -1
- package/coverage/lcov-report/src/types/data-structures/rb-tree.ts.html +1 -1
- package/coverage/lcov-report/src/types/index.html +1 -1
- package/coverage/lcov-report/src/types/index.ts.html +1 -1
- package/coverage/lcov-report/src/types/utils/index.html +1 -1
- package/coverage/lcov-report/src/types/utils/index.ts.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/coverage/lcov-report/src/utils/index.ts.html +1 -1
- package/coverage/lcov-report/src/utils/utils.ts.html +4 -4
- package/coverage/lcov-report/test/utils/index.html +1 -1
- package/coverage/lcov-report/test/utils/index.ts.html +1 -1
- package/coverage/lcov-report/test/utils/magnitude.ts.html +1 -1
- package/coverage/lcov-report/test/utils/number.ts.html +1 -1
- package/coverage/lcov.info +1329 -1329
- package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/tree-multiset.js.map +1 -1
- package/dist/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/data-structures/graph/map-graph.js.map +1 -1
- package/dist/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/data-structures/heap/heap.js.map +1 -1
- package/dist/data-structures/heap/max-heap.js.map +1 -1
- package/dist/data-structures/heap/min-heap.js.map +1 -1
- package/dist/data-structures/matrix/matrix.js.map +1 -1
- package/dist/data-structures/matrix/navigator.js.map +1 -1
- package/dist/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/data-structures/queue/deque.js.map +1 -1
- package/dist/data-structures/queue/queue.js.map +1 -1
- package/dist/data-structures/tree/tree.js.map +1 -1
- package/dist/utils/utils.js.map +1 -1
- package/docs/classes/AVLTree.html +85 -85
- package/docs/classes/AVLTreeNode.html +15 -15
- package/docs/classes/AaTree.html +1 -1
- package/docs/classes/AbstractBinaryTree.html +78 -78
- package/docs/classes/AbstractBinaryTreeNode.html +21 -21
- package/docs/classes/AbstractEdge.html +11 -11
- package/docs/classes/AbstractGraph.html +36 -36
- package/docs/classes/AbstractVertex.html +8 -8
- package/docs/classes/ArrayDeque.html +14 -14
- package/docs/classes/BST.html +78 -78
- package/docs/classes/BSTNode.html +15 -15
- package/docs/classes/BTree.html +1 -1
- package/docs/classes/BinaryIndexedTree.html +9 -9
- package/docs/classes/BinaryTree.html +71 -71
- package/docs/classes/BinaryTreeNode.html +15 -15
- package/docs/classes/Character.html +4 -4
- package/docs/classes/CoordinateMap.html +9 -9
- package/docs/classes/CoordinateSet.html +8 -8
- package/docs/classes/Deque.html +34 -34
- package/docs/classes/DirectedEdge.html +15 -15
- package/docs/classes/DirectedGraph.html +52 -52
- package/docs/classes/DirectedVertex.html +6 -6
- package/docs/classes/DoublyLinkedList.html +37 -37
- package/docs/classes/DoublyLinkedListNode.html +11 -11
- package/docs/classes/HashTable.html +1 -1
- package/docs/classes/Heap.html +26 -26
- package/docs/classes/HeapItem.html +8 -8
- package/docs/classes/LinkedListQueue.html +35 -35
- package/docs/classes/MapEdge.html +13 -13
- package/docs/classes/MapGraph.html +56 -56
- package/docs/classes/MapVertex.html +12 -12
- package/docs/classes/Matrix2D.html +16 -16
- package/docs/classes/MatrixNTI2D.html +4 -4
- package/docs/classes/MaxHeap.html +26 -26
- package/docs/classes/MaxPriorityQueue.html +34 -34
- package/docs/classes/MinHeap.html +26 -26
- package/docs/classes/MinPriorityQueue.html +34 -34
- package/docs/classes/Navigator.html +10 -10
- package/docs/classes/ObjectDeque.html +25 -25
- package/docs/classes/Pair.html +1 -1
- package/docs/classes/PriorityQueue.html +32 -32
- package/docs/classes/Queue.html +22 -22
- package/docs/classes/RBTree.html +78 -78
- package/docs/classes/RBTreeNode.html +18 -18
- package/docs/classes/SegmentTree.html +17 -17
- package/docs/classes/SegmentTreeNode.html +20 -20
- package/docs/classes/SinglyLinkedList.html +35 -35
- package/docs/classes/SinglyLinkedListNode.html +8 -8
- package/docs/classes/SkipLinkedList.html +1 -1
- package/docs/classes/SplayTree.html +1 -1
- package/docs/classes/Stack.html +12 -12
- package/docs/classes/TreeMap.html +1 -1
- package/docs/classes/TreeMultiset.html +99 -99
- package/docs/classes/TreeMultisetNode.html +18 -18
- package/docs/classes/TreeNode.html +13 -13
- package/docs/classes/TreeSet.html +1 -1
- package/docs/classes/Trie.html +13 -13
- package/docs/classes/TrieNode.html +11 -11
- package/docs/classes/TwoThreeTree.html +1 -1
- package/docs/classes/UndirectedEdge.html +12 -12
- package/docs/classes/UndirectedGraph.html +40 -40
- package/docs/classes/UndirectedVertex.html +6 -6
- package/docs/classes/Vector2D.html +28 -28
- package/docs/enums/CP.html +4 -4
- package/docs/enums/FamilyPosition.html +8 -8
- package/docs/enums/LoopType.html +3 -3
- package/docs/enums/RBColor.html +3 -3
- package/docs/enums/TopologicalProperty.html +4 -4
- package/docs/functions/arrayRemove.html +1 -1
- package/docs/functions/isThunk.html +1 -1
- package/docs/functions/toThunk.html +1 -1
- package/docs/functions/trampoline.html +1 -1
- package/docs/functions/trampolineAsync.html +1 -1
- package/docs/functions/uuidV4.html +1 -1
- package/docs/index.html +21 -26
- package/docs/interfaces/IAVLTree.html +77 -77
- package/docs/interfaces/IAbstractBinaryTree.html +72 -72
- package/docs/interfaces/IAbstractBinaryTreeNode.html +14 -14
- package/docs/interfaces/IAbstractGraph.html +15 -15
- package/docs/interfaces/IBST.html +77 -77
- package/docs/interfaces/IDirectedGraph.html +23 -23
- package/docs/interfaces/IRBTree.html +77 -77
- package/docs/interfaces/IUNDirectedGraph.html +16 -16
- package/docs/types/AVLTreeNodeNested.html +1 -1
- package/docs/types/AVLTreeOptions.html +1 -1
- package/docs/types/AbstractBinaryTreeNodeNested.html +1 -1
- package/docs/types/AbstractBinaryTreeNodeProperties.html +1 -1
- package/docs/types/AbstractBinaryTreeNodeProperty.html +1 -1
- package/docs/types/AbstractBinaryTreeOptions.html +1 -1
- package/docs/types/BSTComparator.html +1 -1
- package/docs/types/BSTNodeNested.html +1 -1
- package/docs/types/BSTOptions.html +1 -1
- package/docs/types/BinaryTreeDeletedResult.html +1 -1
- package/docs/types/BinaryTreeNodeId.html +1 -1
- package/docs/types/BinaryTreeNodeNested.html +1 -1
- package/docs/types/BinaryTreeNodePropertyName.html +1 -1
- package/docs/types/BinaryTreeOptions.html +1 -1
- package/docs/types/DFSOrderPattern.html +1 -1
- package/docs/types/DijkstraResult.html +1 -1
- package/docs/types/Direction.html +1 -1
- package/docs/types/DummyAny.html +1 -1
- package/docs/types/EdgeId.html +1 -1
- package/docs/types/HeapOptions.html +1 -1
- package/docs/types/IAVLTreeNode.html +1 -1
- package/docs/types/IBSTNode.html +1 -1
- package/docs/types/IBinaryTree.html +1 -1
- package/docs/types/IBinaryTreeNode.html +1 -1
- package/docs/types/IRBTreeNode.html +1 -1
- package/docs/types/ITreeMultiset.html +1 -1
- package/docs/types/ITreeMultisetNode.html +1 -1
- package/docs/types/KeyValueObject.html +1 -1
- package/docs/types/KeyValueObjectWithId.html +1 -1
- package/docs/types/MapGraphCoordinate.html +1 -1
- package/docs/types/NavigatorParams.html +1 -1
- package/docs/types/NodeOrPropertyName.html +1 -1
- package/docs/types/NonNumberNonObjectButDefined.html +1 -1
- package/docs/types/ObjectWithNonNumberId.html +1 -1
- package/docs/types/ObjectWithNumberId.html +1 -1
- package/docs/types/ObjectWithoutId.html +1 -1
- package/docs/types/PriorityQueueComparator.html +1 -1
- package/docs/types/PriorityQueueDFSOrderPattern.html +1 -1
- package/docs/types/PriorityQueueOptions.html +1 -1
- package/docs/types/RBTreeNodeNested.html +1 -1
- package/docs/types/RBTreeOptions.html +1 -1
- package/docs/types/RestrictValById.html +1 -1
- package/docs/types/SegmentTreeNodeVal.html +1 -1
- package/docs/types/SpecifyOptional.html +1 -1
- package/docs/types/Thunk.html +1 -1
- package/docs/types/ToThunkFn.html +1 -1
- package/docs/types/TopologicalStatus.html +1 -1
- package/docs/types/TreeMultisetNodeNested.html +1 -1
- package/docs/types/TreeMultisetOptions.html +1 -1
- package/docs/types/TrlAsyncFn.html +1 -1
- package/docs/types/TrlFn.html +1 -1
- package/docs/types/Turning.html +1 -1
- package/docs/types/VertexId.html +1 -1
- package/docs/variables/THUNK_SYMBOL.html +1 -1
- package/jest.config.js +1 -0
- package/package.json +18 -6
- package/.auto-changelog-template.hbs +0 -36
- package/rename_clear_files.sh +0 -29
- package/tsconfig.build.json +0 -33
|
@@ -2150,10 +2150,10 @@
|
|
|
2150
2150
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
2151
2151
|
* @license MIT License
|
|
2152
2152
|
*/
|
|
2153
|
-
import {
|
|
2154
|
-
import {
|
|
2155
|
-
import type {
|
|
2156
|
-
import {
|
|
2153
|
+
import {arrayRemove, uuidV4} from '../../utils';
|
|
2154
|
+
import {PriorityQueue} from '../priority-queue';
|
|
2155
|
+
import type {DijkstraResult, VertexId} from '../../types';
|
|
2156
|
+
import {IAbstractGraph} from '../../interfaces';
|
|
2157
2157
|
|
|
2158
2158
|
export abstract class AbstractVertex<T = any> {
|
|
2159
2159
|
/**
|
|
@@ -2675,7 +2675,7 @@ export abstract class AbstractGraph<
|
|
|
2675
2675
|
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (genPaths) {</span>
|
|
2676
2676
|
<span class="cstat-no" title="statement not covered" > getPaths(destVertex);</span>
|
|
2677
2677
|
}
|
|
2678
|
-
<span class="cstat-no" title="statement not covered" > return {
|
|
2678
|
+
<span class="cstat-no" title="statement not covered" > return {distMap, preMap, seen, paths, minDist, minPath};</span>
|
|
2679
2679
|
}
|
|
2680
2680
|
const neighbors = this.getNeighbors(cur);
|
|
2681
2681
|
for (const neighbor of neighbors) {
|
|
@@ -2709,7 +2709,7 @@ export abstract class AbstractGraph<
|
|
|
2709
2709
|
|
|
2710
2710
|
genPaths && getPaths(minDest);
|
|
2711
2711
|
|
|
2712
|
-
return {
|
|
2712
|
+
return {distMap, preMap, seen, paths, minDist, minPath};
|
|
2713
2713
|
}
|
|
2714
2714
|
|
|
2715
2715
|
/**
|
|
@@ -2762,10 +2762,10 @@ export abstract class AbstractGraph<
|
|
|
2762
2762
|
if (vertexOrId instanceof AbstractVertex) distMap.set(vertexOrId, Infinity);
|
|
2763
2763
|
}
|
|
2764
2764
|
|
|
2765
|
-
const heap = new PriorityQueue<{
|
|
2765
|
+
const heap = new PriorityQueue<{id: number; val: V}>({
|
|
2766
2766
|
comparator: (a, b) => a.id - b.id
|
|
2767
2767
|
});
|
|
2768
|
-
heap.add({
|
|
2768
|
+
heap.add({id: 0, val: srcVertex});
|
|
2769
2769
|
|
|
2770
2770
|
distMap.set(srcVertex, 0);
|
|
2771
2771
|
preMap.set(srcVertex, null);
|
|
@@ -2806,7 +2806,7 @@ export abstract class AbstractGraph<
|
|
|
2806
2806
|
if (genPaths) {
|
|
2807
2807
|
getPaths(destVertex);
|
|
2808
2808
|
}
|
|
2809
|
-
return {
|
|
2809
|
+
return {distMap, preMap, seen, paths, minDist, minPath};
|
|
2810
2810
|
}
|
|
2811
2811
|
const neighbors = this.getNeighbors(cur);
|
|
2812
2812
|
for (const neighbor of neighbors) {
|
|
@@ -2816,7 +2816,7 @@ export abstract class AbstractGraph<
|
|
|
2816
2816
|
const distSrcToNeighbor = distMap.get(neighbor);
|
|
2817
2817
|
if (distSrcToNeighbor) {
|
|
2818
2818
|
if (dist + weight < distSrcToNeighbor) {
|
|
2819
|
-
heap.add({
|
|
2819
|
+
heap.add({id: dist + weight, val: neighbor});
|
|
2820
2820
|
preMap.set(neighbor, cur);
|
|
2821
2821
|
distMap.set(neighbor, dist + weight);
|
|
2822
2822
|
}
|
|
@@ -2843,7 +2843,7 @@ export abstract class AbstractGraph<
|
|
|
2843
2843
|
getPaths(minDest);
|
|
2844
2844
|
}
|
|
2845
2845
|
|
|
2846
|
-
return {
|
|
2846
|
+
return {distMap, preMap, seen, paths, minDist, minPath};
|
|
2847
2847
|
}
|
|
2848
2848
|
|
|
2849
2849
|
/**
|
|
@@ -2880,7 +2880,7 @@ export abstract class AbstractGraph<
|
|
|
2880
2880
|
// TODO
|
|
2881
2881
|
let hasNegativeCycle: boolean | undefined;
|
|
2882
2882
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (scanNegativeCycle) <span class="cstat-no" title="statement not covered" >hasNegativeCycle = false;</span>
|
|
2883
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (!srcVertex) <span class="cstat-no" title="statement not covered" >return {
|
|
2883
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (!srcVertex) <span class="cstat-no" title="statement not covered" >return {hasNegativeCycle, distMap, preMap, paths, min, minPath};</span>
|
|
2884
2884
|
|
|
2885
2885
|
const vertices = this._vertices;
|
|
2886
2886
|
const numOfVertices = vertices.size;
|
|
@@ -2952,7 +2952,7 @@ export abstract class AbstractGraph<
|
|
|
2952
2952
|
}
|
|
2953
2953
|
}
|
|
2954
2954
|
|
|
2955
|
-
return {
|
|
2955
|
+
return {hasNegativeCycle, distMap, preMap, paths, min, minPath};
|
|
2956
2956
|
}
|
|
2957
2957
|
|
|
2958
2958
|
/**
|
|
@@ -2993,7 +2993,7 @@ export abstract class AbstractGraph<
|
|
|
2993
2993
|
* `predecessor` property is a 2D array of vertices (or `null`) representing the predecessor vertices in the shortest
|
|
2994
2994
|
* path between vertices in the
|
|
2995
2995
|
*/
|
|
2996
|
-
floyd(): {
|
|
2996
|
+
floyd(): {costs: number[][]; predecessor: (V | null)[][]} {
|
|
2997
2997
|
const idAndVertices = [...this._vertices];
|
|
2998
2998
|
const n = idAndVertices.length;
|
|
2999
2999
|
|
|
@@ -3025,7 +3025,7 @@ export abstract class AbstractGraph<
|
|
|
3025
3025
|
}
|
|
3026
3026
|
}
|
|
3027
3027
|
}
|
|
3028
|
-
return {
|
|
3028
|
+
return {costs, predecessor};
|
|
3029
3029
|
}
|
|
3030
3030
|
|
|
3031
3031
|
/**
|
|
@@ -3156,7 +3156,7 @@ export abstract class AbstractGraph<
|
|
|
3156
3156
|
});
|
|
3157
3157
|
}
|
|
3158
3158
|
|
|
3159
|
-
<span class="cstat-no" title="statement not covered" > return {
|
|
3159
|
+
<span class="cstat-no" title="statement not covered" > return {dfnMap, lowMap, bridges, articulationPoints, SCCs, cycles};</span>
|
|
3160
3160
|
}
|
|
3161
3161
|
|
|
3162
3162
|
protected abstract _addEdgeOnly(edge: E): boolean;
|
|
@@ -3190,7 +3190,7 @@ export abstract class AbstractGraph<
|
|
|
3190
3190
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
3191
3191
|
Code coverage generated by
|
|
3192
3192
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
3193
|
-
at 2023-09-
|
|
3193
|
+
at 2023-09-22T03:26:43.997Z
|
|
3194
3194
|
</div>
|
|
3195
3195
|
<script src="../../../prettify.js"></script>
|
|
3196
3196
|
<script>
|
|
@@ -1010,10 +1010,10 @@
|
|
|
1010
1010
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
1011
1011
|
* @license MIT License
|
|
1012
1012
|
*/
|
|
1013
|
-
import {
|
|
1014
|
-
import {
|
|
1015
|
-
import type {
|
|
1016
|
-
import {
|
|
1013
|
+
import {arrayRemove} from '../../utils';
|
|
1014
|
+
import {AbstractEdge, AbstractGraph, AbstractVertex} from './abstract-graph';
|
|
1015
|
+
import type {TopologicalStatus, VertexId} from '../../types';
|
|
1016
|
+
import {IDirectedGraph} from '../../interfaces';
|
|
1017
1017
|
|
|
1018
1018
|
export class DirectedVertex<T = number> extends AbstractVertex<T> {
|
|
1019
1019
|
/**
|
|
@@ -1480,7 +1480,7 @@ export class DirectedGraph<V extends DirectedVertex<any> = DirectedVert
|
|
|
1480
1480
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1481
1481
|
Code coverage generated by
|
|
1482
1482
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1483
|
-
at 2023-09-
|
|
1483
|
+
at 2023-09-22T03:26:43.997Z
|
|
1484
1484
|
</div>
|
|
1485
1485
|
<script src="../../../prettify.js"></script>
|
|
1486
1486
|
<script>
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
162
162
|
Code coverage generated by
|
|
163
163
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
164
|
-
at 2023-09-
|
|
164
|
+
at 2023-09-22T03:26:43.997Z
|
|
165
165
|
</div>
|
|
166
166
|
<script src="../../../prettify.js"></script>
|
|
167
167
|
<script>
|
|
@@ -82,7 +82,7 @@ export * from './map-graph';
|
|
|
82
82
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
83
83
|
Code coverage generated by
|
|
84
84
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
85
|
-
at 2023-09-
|
|
85
|
+
at 2023-09-22T03:26:43.997Z
|
|
86
86
|
</div>
|
|
87
87
|
<script src="../../../prettify.js"></script>
|
|
88
88
|
<script>
|
|
@@ -321,8 +321,8 @@
|
|
|
321
321
|
<span class="cline-any cline-yes">13x</span>
|
|
322
322
|
<span class="cline-any cline-neutral"> </span>
|
|
323
323
|
<span class="cline-any cline-neutral"> </span>
|
|
324
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {
|
|
325
|
-
import {
|
|
324
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {MapGraphCoordinate, VertexId} from '../../types';
|
|
325
|
+
import {DirectedEdge, DirectedGraph, DirectedVertex} from './directed-graph';
|
|
326
326
|
|
|
327
327
|
export class MapVertex<T = any> extends DirectedVertex<T> {
|
|
328
328
|
/**
|
|
@@ -457,7 +457,7 @@ export class MapGraph<V extends MapVertex<V['val']> = MapVertex, E exte
|
|
|
457
457
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
458
458
|
Code coverage generated by
|
|
459
459
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
460
|
-
at 2023-09-
|
|
460
|
+
at 2023-09-22T03:26:43.997Z
|
|
461
461
|
</div>
|
|
462
462
|
<script src="../../../prettify.js"></script>
|
|
463
463
|
<script>
|
|
@@ -618,10 +618,10 @@
|
|
|
618
618
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
619
619
|
* @license MIT License
|
|
620
620
|
*/
|
|
621
|
-
import {
|
|
622
|
-
import {
|
|
623
|
-
import type {
|
|
624
|
-
import {
|
|
621
|
+
import {arrayRemove} from '../../utils';
|
|
622
|
+
import {AbstractEdge, AbstractGraph, AbstractVertex} from './abstract-graph';
|
|
623
|
+
import type {VertexId} from '../../types';
|
|
624
|
+
import {IUNDirectedGraph} from '../../interfaces';
|
|
625
625
|
|
|
626
626
|
export class UndirectedVertex<T = number> extends AbstractVertex<T> {
|
|
627
627
|
/**
|
|
@@ -892,7 +892,7 @@ export class UndirectedGraph<
|
|
|
892
892
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
893
893
|
Code coverage generated by
|
|
894
894
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
895
|
-
at 2023-09-
|
|
895
|
+
at 2023-09-22T03:26:43.997Z
|
|
896
896
|
</div>
|
|
897
897
|
<script src="../../../prettify.js"></script>
|
|
898
898
|
<script>
|
|
@@ -271,7 +271,7 @@ export class CoordinateMap<V> extends Map<any, V> {
|
|
|
271
271
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
272
272
|
Code coverage generated by
|
|
273
273
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
274
|
-
at 2023-09-
|
|
274
|
+
at 2023-09-22T03:26:43.997Z
|
|
275
275
|
</div>
|
|
276
276
|
<script src="../../../prettify.js"></script>
|
|
277
277
|
<script>
|
|
@@ -238,7 +238,7 @@ export class CoordinateSet extends Set<any> {
|
|
|
238
238
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
239
239
|
Code coverage generated by
|
|
240
240
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
241
|
-
at 2023-09-
|
|
241
|
+
at 2023-09-22T03:26:43.997Z
|
|
242
242
|
</div>
|
|
243
243
|
<script src="../../../prettify.js"></script>
|
|
244
244
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2023-09-
|
|
76
|
+
at 2023-09-22T03:26:43.997Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../../../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
192
192
|
Code coverage generated by
|
|
193
193
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
194
|
-
at 2023-09-
|
|
194
|
+
at 2023-09-22T03:26:43.997Z
|
|
195
195
|
</div>
|
|
196
196
|
<script src="../../../prettify.js"></script>
|
|
197
197
|
<script>
|
|
@@ -88,7 +88,7 @@ export * from './tree-set';
|
|
|
88
88
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
89
89
|
Code coverage generated by
|
|
90
90
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
91
|
-
at 2023-09-
|
|
91
|
+
at 2023-09-22T03:26:43.997Z
|
|
92
92
|
</div>
|
|
93
93
|
<script src="../../../prettify.js"></script>
|
|
94
94
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2023-09-
|
|
76
|
+
at 2023-09-22T03:26:43.997Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../../../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2023-09-
|
|
76
|
+
at 2023-09-22T03:26:43.997Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../../../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2023-09-
|
|
76
|
+
at 2023-09-22T03:26:43.997Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../../../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -494,8 +494,8 @@
|
|
|
494
494
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
495
495
|
* @license MIT License
|
|
496
496
|
*/
|
|
497
|
-
import {
|
|
498
|
-
import type {
|
|
497
|
+
import {PriorityQueue} from '../priority-queue';
|
|
498
|
+
import type {HeapOptions} from '../../types';
|
|
499
499
|
|
|
500
500
|
export class HeapItem<T = number> {
|
|
501
501
|
/**
|
|
@@ -539,7 +539,7 @@ export abstract class Heap<T = number> {
|
|
|
539
539
|
*/
|
|
540
540
|
protected constructor(options?: HeapOptions<T>) {
|
|
541
541
|
<span class="missing-if-branch" title="if path not taken" >I</span>if (options) {
|
|
542
|
-
const {
|
|
542
|
+
const {priorityExtractor} = <span class="cstat-no" title="statement not covered" >options;</span>
|
|
543
543
|
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (priorityExtractor !== undefined && typeof priorityExtractor !== 'function') {</span>
|
|
544
544
|
<span class="cstat-no" title="statement not covered" > throw new Error('.constructor expects a valid priority function');</span>
|
|
545
545
|
}
|
|
@@ -706,7 +706,7 @@ export abstract class Heap<T = number> {
|
|
|
706
706
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
707
707
|
Code coverage generated by
|
|
708
708
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
709
|
-
at 2023-09-
|
|
709
|
+
at 2023-09-22T03:26:43.997Z
|
|
710
710
|
</div>
|
|
711
711
|
<script src="../../../prettify.js"></script>
|
|
712
712
|
<script>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
147
147
|
Code coverage generated by
|
|
148
148
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
149
|
-
at 2023-09-
|
|
149
|
+
at 2023-09-22T03:26:43.997Z
|
|
150
150
|
</div>
|
|
151
151
|
<script src="../../../prettify.js"></script>
|
|
152
152
|
<script>
|
|
@@ -79,7 +79,7 @@ export * from './heap';
|
|
|
79
79
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
80
80
|
Code coverage generated by
|
|
81
81
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
82
|
-
at 2023-09-
|
|
82
|
+
at 2023-09-22T03:26:43.997Z
|
|
83
83
|
</div>
|
|
84
84
|
<script src="../../../prettify.js"></script>
|
|
85
85
|
<script>
|
|
@@ -133,9 +133,9 @@
|
|
|
133
133
|
* @license MIT License
|
|
134
134
|
*/
|
|
135
135
|
|
|
136
|
-
import {
|
|
137
|
-
import {
|
|
138
|
-
import type {
|
|
136
|
+
import {Heap, HeapItem} from './heap';
|
|
137
|
+
import {PriorityQueue} from '../priority-queue';
|
|
138
|
+
import type {HeapOptions} from '../../types';
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
141
|
* @class MaxHeap
|
|
@@ -163,7 +163,7 @@ export class MaxHeap<T = number> extends Heap<T> {
|
|
|
163
163
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
164
164
|
Code coverage generated by
|
|
165
165
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
166
|
-
at 2023-09-
|
|
166
|
+
at 2023-09-22T03:26:43.997Z
|
|
167
167
|
</div>
|
|
168
168
|
<script src="../../../prettify.js"></script>
|
|
169
169
|
<script>
|
|
@@ -135,9 +135,9 @@
|
|
|
135
135
|
* @license MIT License
|
|
136
136
|
*/
|
|
137
137
|
|
|
138
|
-
import {
|
|
139
|
-
import {
|
|
140
|
-
import type {
|
|
138
|
+
import {Heap, HeapItem} from './heap';
|
|
139
|
+
import {PriorityQueue} from '../priority-queue';
|
|
140
|
+
import type {HeapOptions} from '../../types';
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
143
|
* @class MinHeap
|
|
@@ -166,7 +166,7 @@ export class MinHeap<T = number> extends Heap<T> {
|
|
|
166
166
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
167
167
|
Code coverage generated by
|
|
168
168
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
169
|
-
at 2023-09-
|
|
169
|
+
at 2023-09-22T03:26:43.997Z
|
|
170
170
|
</div>
|
|
171
171
|
<script src="../../../prettify.js"></script>
|
|
172
172
|
<script>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at 2023-09-
|
|
104
|
+
at 2023-09-22T03:26:43.997Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -103,7 +103,7 @@ export * from './trie';
|
|
|
103
103
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
104
104
|
Code coverage generated by
|
|
105
105
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
106
|
-
at 2023-09-
|
|
106
|
+
at 2023-09-22T03:26:43.997Z
|
|
107
107
|
</div>
|
|
108
108
|
<script src="../../prettify.js"></script>
|
|
109
109
|
<script>
|
|
@@ -1789,7 +1789,7 @@ export class DoublyLinkedList<T = any> {
|
|
|
1789
1789
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1790
1790
|
Code coverage generated by
|
|
1791
1791
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1792
|
-
at 2023-09-
|
|
1792
|
+
at 2023-09-22T03:26:43.997Z
|
|
1793
1793
|
</div>
|
|
1794
1794
|
<script src="../../../prettify.js"></script>
|
|
1795
1795
|
<script>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
147
147
|
Code coverage generated by
|
|
148
148
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
149
|
-
at 2023-09-
|
|
149
|
+
at 2023-09-22T03:26:43.997Z
|
|
150
150
|
</div>
|
|
151
151
|
<script src="../../../prettify.js"></script>
|
|
152
152
|
<script>
|
|
@@ -79,7 +79,7 @@ export * from './skip-linked-list';
|
|
|
79
79
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
80
80
|
Code coverage generated by
|
|
81
81
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
82
|
-
at 2023-09-
|
|
82
|
+
at 2023-09-22T03:26:43.997Z
|
|
83
83
|
</div>
|
|
84
84
|
<script src="../../../prettify.js"></script>
|
|
85
85
|
<script>
|
|
@@ -1573,7 +1573,7 @@ export class SinglyLinkedList<T = any> {
|
|
|
1573
1573
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1574
1574
|
Code coverage generated by
|
|
1575
1575
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1576
|
-
at 2023-09-
|
|
1576
|
+
at 2023-09-22T03:26:43.997Z
|
|
1577
1577
|
</div>
|
|
1578
1578
|
<script src="../../../prettify.js"></script>
|
|
1579
1579
|
<script>
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
74
74
|
Code coverage generated by
|
|
75
75
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
76
|
-
at 2023-09-
|
|
76
|
+
at 2023-09-22T03:26:43.997Z
|
|
77
77
|
</div>
|
|
78
78
|
<script src="../../../prettify.js"></script>
|
|
79
79
|
<script>
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
162
162
|
Code coverage generated by
|
|
163
163
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
164
|
-
at 2023-09-
|
|
164
|
+
at 2023-09-22T03:26:43.997Z
|
|
165
165
|
</div>
|
|
166
166
|
<script src="../../../prettify.js"></script>
|
|
167
167
|
<script>
|
|
@@ -82,7 +82,7 @@ export * from './navigator';
|
|
|
82
82
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
83
83
|
Code coverage generated by
|
|
84
84
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
85
|
-
at 2023-09-
|
|
85
|
+
at 2023-09-22T03:26:43.997Z
|
|
86
86
|
</div>
|
|
87
87
|
<script src="../../../prettify.js"></script>
|
|
88
88
|
<script>
|
|
@@ -133,8 +133,8 @@ export class MatrixNTI2D<T = number> {
|
|
|
133
133
|
* given initial value or 0 if not provided.
|
|
134
134
|
* @param options - An object containing the following properties:
|
|
135
135
|
*/
|
|
136
|
-
<span class="fstat-no" title="function not covered" > constructor(o</span>ptions: {
|
|
137
|
-
const {
|
|
136
|
+
<span class="fstat-no" title="function not covered" > constructor(o</span>ptions: {row: number; col: number; initialVal?: T}) {
|
|
137
|
+
const {row, col, initialVal} = <span class="cstat-no" title="statement not covered" >options;</span>
|
|
138
138
|
<span class="cstat-no" title="statement not covered" > this._matrix = new Array(row).fill(undefined).map(<span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >new Array(col).fill(initialVal || 0))</span>;</span>
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -151,7 +151,7 @@ export class MatrixNTI2D<T = number> {
|
|
|
151
151
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
152
152
|
Code coverage generated by
|
|
153
153
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
154
|
-
at 2023-09-
|
|
154
|
+
at 2023-09-22T03:26:43.997Z
|
|
155
155
|
</div>
|
|
156
156
|
<script src="../../../prettify.js"></script>
|
|
157
157
|
<script>
|
|
@@ -706,7 +706,7 @@ export default Matrix2D;
|
|
|
706
706
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
707
707
|
Code coverage generated by
|
|
708
708
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
709
|
-
at 2023-09-
|
|
709
|
+
at 2023-09-22T03:26:43.997Z
|
|
710
710
|
</div>
|
|
711
711
|
<script src="../../../prettify.js"></script>
|
|
712
712
|
<script>
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
* @copyright Copyright (c) 2022 Tyler Zeng <zrwusa@gmail.com>
|
|
313
313
|
* @license MIT License
|
|
314
314
|
*/
|
|
315
|
-
import type {
|
|
315
|
+
import type {Direction, NavigatorParams, Turning} from '../../types';
|
|
316
316
|
|
|
317
317
|
export class Character {
|
|
318
318
|
direction: Direction;
|
|
@@ -344,7 +344,7 @@ export class Navigator<T = number> {
|
|
|
344
344
|
* in the matrix.
|
|
345
345
|
* @param - - `matrix`: a 2D array representing the grid or map
|
|
346
346
|
*/
|
|
347
|
-
<span class="fstat-no" title="function not covered" > constructor({</span>
|
|
347
|
+
<span class="fstat-no" title="function not covered" > constructor({</span>matrix, turning, onMove, init: {cur, charDir, VISITED}}: NavigatorParams<T>) {
|
|
348
348
|
<span class="cstat-no" title="statement not covered" > this._matrix = matrix;</span>
|
|
349
349
|
<span class="cstat-no" title="statement not covered" > this._cur = cur;</span>
|
|
350
350
|
<span class="cstat-no" title="statement not covered" > this._character = new Character(charDir, turning);</span>
|
|
@@ -360,7 +360,7 @@ export class Navigator<T = number> {
|
|
|
360
360
|
*/
|
|
361
361
|
<span class="fstat-no" title="function not covered" > start(</span>) {
|
|
362
362
|
<span class="cstat-no" title="statement not covered" > while (this.check(this._character.direction) || this.check(this._character.turn().direction)) {</span>
|
|
363
|
-
const {
|
|
363
|
+
const {direction} = <span class="cstat-no" title="statement not covered" >this._character;</span>
|
|
364
364
|
<span class="cstat-no" title="statement not covered" > if (this.check(direction)) {</span>
|
|
365
365
|
<span class="cstat-no" title="statement not covered" > this.move(direction);</span>
|
|
366
366
|
} else <span class="cstat-no" title="statement not covered" ><span class="missing-if-branch" title="if path not taken" >I</span>if (this.check(this._character.turn().direction)) {</span>
|
|
@@ -433,7 +433,7 @@ export class Navigator<T = number> {
|
|
|
433
433
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
434
434
|
Code coverage generated by
|
|
435
435
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
436
|
-
at 2023-09-
|
|
436
|
+
at 2023-09-22T03:26:43.997Z
|
|
437
437
|
</div>
|
|
438
438
|
<script src="../../../prettify.js"></script>
|
|
439
439
|
<script>
|
|
@@ -1018,7 +1018,7 @@ export default Vector2D;
|
|
|
1018
1018
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1019
1019
|
Code coverage generated by
|
|
1020
1020
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1021
|
-
at 2023-09-
|
|
1021
|
+
at 2023-09-22T03:26:43.997Z
|
|
1022
1022
|
</div>
|
|
1023
1023
|
<script src="../../../prettify.js"></script>
|
|
1024
1024
|
<script>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
147
147
|
Code coverage generated by
|
|
148
148
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
149
|
-
at 2023-09-
|
|
149
|
+
at 2023-09-22T03:26:43.997Z
|
|
150
150
|
</div>
|
|
151
151
|
<script src="../../../prettify.js"></script>
|
|
152
152
|
<script>
|
|
@@ -79,7 +79,7 @@ export * from './max-priority-queue';
|
|
|
79
79
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
80
80
|
Code coverage generated by
|
|
81
81
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
82
|
-
at 2023-09-
|
|
82
|
+
at 2023-09-22T03:26:43.997Z
|
|
83
83
|
</div>
|
|
84
84
|
<script src="../../../prettify.js"></script>
|
|
85
85
|
<script>
|