[pkg] code quality improved to 99%

This commit is contained in:
Revone 2023-10-06 20:51:55 +08:00
parent a1cd24aeeb
commit 8659e1d09d
5 changed files with 566 additions and 1447 deletions

View file

@ -4,34 +4,19 @@
.dependency-cruiser.js
.editorconfig
.gitattributes
.gitignore
.prettierignore
/notes
/backup
/package-lock.json
/webpack.config.js
/rename_clear_files.sh
/tsconfig.prod.json
/docs
#/docs/assets
#/docs/classes
#/docs/enums
#/docs/functions
#/docs/interfaces
#/docs/types
#/docs/variables
/coverage
#/coverage/lcov-report
#/coverage/clover.xml
#/coverage/lcov.info
jest.config.js
.prettierrc.js
tsconfig.json
#/test
#/src

View file

@ -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.33.9](https://github.com/zrwusa/data-structure-typed/compare/v1.33.4...main) (upcoming)
## [v1.33.10](https://github.com/zrwusa/data-structure-typed/compare/v1.33.4...main) (upcoming)
## [v1.33.4](https://github.com/zrwusa/data-structure-typed/compare/v1.33.3...v1.33.4) (26 September 2023)

1941
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "data-structure-typed",
"version": "1.33.10",
"version": "1.34.1",
"description": "Data Structures of Javascript & TypeScript. Binary Tree, BST, Graph, Heap, Priority Queue, Linked List, Queue, Deque, Stack, AVL Tree, Tree Multiset, Trie, Directed Graph, Undirected Graph, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue.",
"main": "dist/index.js",
"module": "lib/index.js",
@ -41,48 +41,32 @@
"bugs": {
"url": "https://github.com/zrwusa/data-structure-typed/issues"
},
"homepage": "https://github.com/zrwusa/data-structure-typed#readme",
"homepage": "https://data-structure-typed-docs.vercel.app",
"devDependencies": {
"@types/benchmark": "^2.1.3",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.9",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.11.0",
"@types/jest": "^29.5.5",
"@types/node": "^20.8.2",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"auto-changelog": "^2.4.0",
"avl-tree-typed": "^1.33.7",
"avl-tree-typed": "^1.33.8",
"benchmark": "^2.1.4",
"binary-tree-typed": "^1.33.7",
"bst-typed": "^1.33.7",
"dependency-cruiser": "^13.1.2",
"deque-typed": "^1.33.7",
"directed-graph-typed": "^1.33.7",
"doubly-linked-list-typed": "^1.33.7",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"binary-tree-typed": "^1.33.8",
"bst-typed": "^1.33.8",
"dependency-cruiser": "^14.1.0",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.25.4",
"graph-typed": "^1.33.7",
"heap-typed": "^1.33.7",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.28.1",
"heap-typed": "^1.33.8",
"istanbul-badges-readme": "^1.8.5",
"jest": "^29.6.2",
"linked-list-typed": "^1.33.7",
"max-heap-typed": "^1.33.7",
"max-priority-queue-typed": "^1.33.7",
"min-heap-typed": "^1.33.7",
"min-priority-queue-typed": "^1.33.7",
"jest": "^29.7.0",
"prettier": "^3.0.3",
"priority-queue-typed": "^1.33.7",
"queue-typed": "^1.33.7",
"singly-linked-list-typed": "^1.33.7",
"stack-typed": "^1.33.7",
"tree-multiset-typed": "^1.33.7",
"trie-typed": "^1.33.7",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"typedoc": "^0.24.8",
"typescript": "^4.9.5",
"undirected-graph-typed": "^1.33.7",
"typedoc": "^0.25.1",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
},

View file

@ -87,7 +87,6 @@ export class SegmentTree {
* included in the range. If not provided, it defaults to the index of the last element in the "values" array.
*/
constructor(values: number[], start?: number, end?: number) {
console.log('values.length:', values.length);
start = start || 0;
end = end || values.length - 1;
this._values = values;
@ -95,10 +94,8 @@ export class SegmentTree {
this._end = end;
if (values.length > 0) {
console.log('Initializing with non-empty array');
this._root = this.build(start, end);
} else {
console.log('Initializing with empty array');
this._root = null;
this._values = [];
}