mirror of
https://github.com/zrwusa/data-structure-typed.git
synced 2025-01-18 11:14:05 +00:00
release: v1.54.1
This commit is contained in:
parent
cbda9c152b
commit
8b247456f5
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "data-structure-typed",
|
||||
"version": "1.54.0",
|
||||
"version": "1.54.1",
|
||||
"description": "Javascript Data Structure. 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/esm/index.js",
|
||||
|
|
|
@ -57,7 +57,7 @@ export class AVLTreeMultiMapNode<K = any, V = any> extends AVLTreeNode<K, V[]> {
|
|||
*/
|
||||
export class AVLTreeMultiMap<K = any, V = any, R = object, MK = any, MV = any, MR = object>
|
||||
extends AVLTree<K, V[], R, MK, MV[], MR>
|
||||
implements IBinaryTree<K, V[], R, MK, MV[], MR>
|
||||
implements IBinaryTree<K, V[], R, MK, MV, MR>
|
||||
{
|
||||
/**
|
||||
* The constructor initializes an AVLTreeMultiMap with the provided keys, nodes, entries, or raw data
|
||||
|
|
|
@ -63,7 +63,7 @@ export class TreeMultiMapNode<K = any, V = any> extends RedBlackTreeNode<K, V[]>
|
|||
*/
|
||||
export class TreeMultiMap<K = any, V = any, R = object, MK = any, MV = any, MR = object>
|
||||
extends RedBlackTree<K, V[], R, MK, MV[], MR>
|
||||
implements IBinaryTree<K, V[], R, MK, MV[], MR>
|
||||
implements IBinaryTree<K, V[], R, MK, MV, MR>
|
||||
{
|
||||
/**
|
||||
* The constructor initializes an TreeMultiMap with the provided keys, nodes, entries, or raw data
|
||||
|
|
|
@ -399,7 +399,7 @@ describe('AVLTreeMultiMap', () => {
|
|||
});
|
||||
|
||||
describe('AVLTreeMultiMap iterative methods test', () => {
|
||||
let avlTmm: AVLTreeMultiMap<number, string>;
|
||||
let avlTmm: AVLTreeMultiMap<number, string, object, string, string, object>;
|
||||
beforeEach(() => {
|
||||
avlTmm = new AVLTreeMultiMap();
|
||||
avlTmm.add([1, ['a']]);
|
||||
|
@ -435,7 +435,7 @@ describe('AVLTreeMultiMap iterative methods test', () => {
|
|||
});
|
||||
|
||||
it('map should return a new avlTmm with modified elements', () => {
|
||||
const avlTmmMapped = avlTmm.map((key, value) => [(key * 2).toString(), value]);
|
||||
const avlTmmMapped = avlTmm.map((key, value) => [(key * 2).toString(), value ? value :[]]);
|
||||
expect(avlTmmMapped.size).toBe(3);
|
||||
expect([...avlTmmMapped]).toEqual([
|
||||
['2', ['a']],
|
||||
|
|
|
@ -627,7 +627,7 @@ describe('TreeMultiMap 2', () => {
|
|||
});
|
||||
|
||||
describe('TreeMultiMap iterative methods test', () => {
|
||||
let tmm: TreeMultiMap<number, string>;
|
||||
let tmm: TreeMultiMap<number, string, object, string, string, object>;
|
||||
beforeEach(() => {
|
||||
tmm = new TreeMultiMap();
|
||||
tmm.add([1, ['a']]);
|
||||
|
@ -664,7 +664,7 @@ describe('TreeMultiMap 2', () => {
|
|||
});
|
||||
|
||||
it('map should return a new tmm with modified elements', () => {
|
||||
const tmmMapped = tmm.map((key, value) => [(key * 2).toString(), value]);
|
||||
const tmmMapped = tmm.map((key, value) => [(key * 2).toString(), value ? value :[]]);
|
||||
expect(tmmMapped.size).toBe(3);
|
||||
expect([...tmmMapped]).toEqual([
|
||||
['2', ['a']],
|
||||
|
|
Loading…
Reference in a new issue