Skip to content

Commit

Permalink
release: v1.52.6
Browse files Browse the repository at this point in the history
  • Loading branch information
zrwusa committed Oct 29, 2024
1 parent a29dc27 commit aece11b
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 155 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
- [`auto-changelog`](https://github.com/CookPete/auto-changelog)

## [v1.52.4](https://github.com/zrwusa/data-structure-typed/compare/v1.51.5...main) (upcoming)
## [v1.52.6](https://github.com/zrwusa/data-structure-typed/compare/v1.51.5...main) (upcoming)

### Changes

Expand Down
26 changes: 13 additions & 13 deletions README.md

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-structure-typed",
"version": "1.52.5",
"version": "1.52.6",
"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/mjs/index.js",
Expand Down Expand Up @@ -66,11 +66,11 @@
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"auto-changelog": "^2.4.0",
"avl-tree-typed": "^1.52.3",
"avl-tree-typed": "^1.52.5",
"benchmark": "^2.1.4",
"binary-tree-typed": "^1.52.3",
"bst-typed": "^1.52.3",
"data-structure-typed": "^1.52.3",
"binary-tree-typed": "^1.52.5",
"bst-typed": "^1.52.5",
"data-structure-typed": "^1.52.5",
"dependency-cruiser": "^14.1.0",
"doctoc": "^2.2.1",
"eslint": "^8.50.0",
Expand All @@ -79,7 +79,7 @@
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"fast-glob": "^3.3.1",
"heap-typed": "^1.52.3",
"heap-typed": "^1.52.5",
"istanbul-badges-readme": "^1.8.5",
"jest": "^29.7.0",
"js-sdsl": "^4.4.2",
Expand Down
4 changes: 2 additions & 2 deletions src/data-structures/binary-tree/binary-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ export class BinaryTree<
* @returns a boolean value.
*/
isRealNodeOrNull(node: R | BTNKeyOrNodeOrEntry<K, V, NODE>): node is NODE | null {
return this.isRealNode(node) || node === null;
return node === null || this.isRealNode(node);
}

/**
Expand Down Expand Up @@ -1843,7 +1843,7 @@ export class BinaryTree<
if (includeNull) return this.isRealNodeOrNull(node);
return this.isRealNode(node);
},
shouldProcessRoot: (node: OptBTNOrNull<NODE>) => boolean = node => true
shouldProcessRoot: (node: OptBTNOrNull<NODE>) => boolean = node => this.isRealNodeOrNull(node)
): ReturnType<C>[] {
beginRoot = this.ensureNode(beginRoot);
if (!beginRoot) return [];
Expand Down
1 change: 1 addition & 0 deletions src/data-structures/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class TreeNode<V = any> {
constructor(key: string, value?: V, children?: TreeNode<V>[]) {
this._key = key;
this._value = value || undefined;
if (children) this._children = children;
}

protected _key: string;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/all-in-one.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('AVL Tree Test from data-structure-typed', () => {
expect(getMinNodeByRoot?.key).toBe(1);

const node15 = tree.getNode(15);
const getMinNodeBySpecificNode = node15 && tree.getLeftMost(node15);
const getMinNodeBySpecificNode = node15 && tree.getLeftMost(node => node, node15);
expect(getMinNodeBySpecificNode?.key).toBe(12);

let subTreeSum = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/avl-tree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('AVL Tree Test', () => {
expect(getMinNodeByRoot?.key).toBe(1);

const node15 = tree.getNode(15);
const getMinNodeBySpecificNode = node15 && tree.getLeftMost(node15);
const getMinNodeBySpecificNode = node15 && tree.getLeftMost(node => node, node15);
expect(getMinNodeBySpecificNode?.key).toBe(12);

let subTreeSum = 0;
Expand Down
4 changes: 2 additions & 2 deletions test/integration/bst.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('Individual package BST operations test', () => {
expect(leftMost?.key).toBe(1);

const node15 = bst.getNode(15);
const minNodeBySpecificNode = node15 && bst.getLeftMost(node15);
const minNodeBySpecificNode = node15 && bst.getLeftMost(node => node, node15);
expect(minNodeBySpecificNode?.key).toBe(12);

let subTreeSum = 0;
Expand Down Expand Up @@ -230,7 +230,7 @@ describe('Individual package BST operations test', () => {
key: 15,
keyA: 15
});
const minNodeBySpecificNode = node15 && objBST.getLeftMost(node15);
const minNodeBySpecificNode = node15 && objBST.getLeftMost(node => node, node15);
expect(minNodeBySpecificNode?.key).toBe(12);

let subTreeSum = 0;
Expand Down
Loading

0 comments on commit aece11b

Please sign in to comment.