release: 1.49.4

This commit is contained in:
Revone 2023-12-21 10:08:59 +08:00
parent c3db558607
commit bc000105d8
2 changed files with 12 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "data-structure-typed",
"version": "1.49.3",
"version": "1.49.4",
"description": "Data Structures of Javascript & TypeScript. Heap, Binary Tree, Red Black Tree, Linked List, Deque, Trie, HashMap, Directed Graph, Undirected Graph, Binary Search Tree(BST), AVL Tree, Priority Queue, Graph, Queue, Tree Multiset, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue, Stack. Benchmark compared with C++ STL. API aligned with ES6 and Java.util. Usability is comparable to Python",
"main": "dist/cjs/index.js",
"module": "dist/mjs/index.js",

View file

@ -66,6 +66,17 @@ class MyGraph<
return edge ? undefined : undefined;
}
deleteVertex(vertexOrKey: VertexKey | VO): boolean {
let vertexKey: VertexKey;
if (this.isVertexKey(vertexOrKey)) {
vertexKey = vertexOrKey;
} else {
vertexKey = vertexOrKey.key;
}
this._vertexMap.delete(vertexKey);
return true;
}
protected _addEdge(edge: EO): boolean {
return edge ? true : true;
}