data-structure-typed 1.33.2 → 1.33.6
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/{.eslintrc.json → .eslintrc.js} +2 -1
- package/.github/workflows/ci.yml +15 -3
- package/.github/workflows/release-package.yml +32 -0
- package/{.prettierrc → .prettierrc.js} +1 -1
- package/CHANGELOG.md +5 -1
- package/README.md +2 -3
- package/coverage/coverage-final.json +64 -64
- package/coverage/coverage-summary.json +2 -2
- package/dist/data-structures/graph/abstract-graph.js +12 -12
- package/dist/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/data-structures/priority-queue/priority-queue.js +6 -6
- package/dist/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/docs/index.html +2 -3
- package/package.json +68 -60
- package/src/data-structures/binary-tree/aa-tree.ts +1 -0
- package/src/data-structures/binary-tree/abstract-binary-tree.ts +1608 -0
- package/src/data-structures/binary-tree/avl-tree.ts +307 -0
- package/src/data-structures/binary-tree/b-tree.ts +1 -0
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +76 -0
- package/src/data-structures/binary-tree/binary-tree.ts +47 -0
- package/src/data-structures/binary-tree/bst.ts +537 -0
- package/src/data-structures/binary-tree/index.ts +12 -0
- package/src/data-structures/binary-tree/rb-tree.ts +366 -0
- package/src/data-structures/binary-tree/segment-tree.ts +242 -0
- package/src/data-structures/binary-tree/splay-tree.ts +1 -0
- package/src/data-structures/binary-tree/tree-multiset.ts +700 -0
- package/src/data-structures/binary-tree/two-three-tree.ts +1 -0
- package/src/data-structures/graph/abstract-graph.ts +1040 -0
- package/src/data-structures/graph/directed-graph.ts +470 -0
- package/src/data-structures/graph/index.ts +4 -0
- package/src/data-structures/graph/map-graph.ts +129 -0
- package/src/data-structures/graph/undirected-graph.ts +274 -0
- package/src/data-structures/hash/coordinate-map.ts +67 -0
- package/src/data-structures/hash/coordinate-set.ts +56 -0
- package/src/data-structures/hash/hash-table.ts +157 -0
- package/src/data-structures/hash/index.ts +6 -0
- package/src/data-structures/hash/pair.ts +1 -0
- package/src/data-structures/hash/tree-map.ts +1 -0
- package/src/data-structures/hash/tree-set.ts +1 -0
- package/src/data-structures/heap/heap.ts +212 -0
- package/src/data-structures/heap/index.ts +3 -0
- package/src/data-structures/heap/max-heap.ts +31 -0
- package/src/data-structures/heap/min-heap.ts +32 -0
- package/src/data-structures/index.ts +11 -0
- package/src/data-structures/linked-list/doubly-linked-list.ts +636 -0
- package/src/data-structures/linked-list/index.ts +3 -0
- package/src/data-structures/linked-list/singly-linked-list.ts +501 -0
- package/src/data-structures/linked-list/skip-linked-list.ts +1 -0
- package/src/data-structures/matrix/index.ts +4 -0
- package/src/data-structures/matrix/matrix.ts +27 -0
- package/src/data-structures/matrix/matrix2d.ts +213 -0
- package/src/data-structures/matrix/navigator.ts +121 -0
- package/src/data-structures/matrix/vector2d.ts +316 -0
- package/src/data-structures/priority-queue/index.ts +3 -0
- package/src/data-structures/priority-queue/max-priority-queue.ts +56 -0
- package/src/data-structures/priority-queue/min-priority-queue.ts +57 -0
- package/src/data-structures/priority-queue/priority-queue.ts +359 -0
- package/src/data-structures/queue/deque.ts +297 -0
- package/src/data-structures/queue/index.ts +2 -0
- package/src/data-structures/queue/queue.ts +191 -0
- package/src/data-structures/stack/index.ts +1 -0
- package/src/data-structures/stack/stack.ts +98 -0
- package/src/data-structures/tree/index.ts +1 -0
- package/src/data-structures/tree/tree.ts +69 -0
- package/src/data-structures/trie/index.ts +1 -0
- package/src/data-structures/trie/trie.ts +225 -0
- package/src/index.ts +4 -0
- package/src/interfaces/abstract-binary-tree.ts +189 -0
- package/src/interfaces/abstract-graph.ts +31 -0
- package/src/interfaces/avl-tree.ts +25 -0
- package/src/interfaces/binary-tree.ts +6 -0
- package/src/interfaces/bst.ts +31 -0
- package/src/interfaces/directed-graph.ts +20 -0
- package/src/interfaces/doubly-linked-list.ts +1 -0
- package/src/interfaces/heap.ts +1 -0
- package/src/interfaces/index.ts +15 -0
- package/src/interfaces/navigator.ts +1 -0
- package/src/interfaces/priority-queue.ts +1 -0
- package/src/interfaces/rb-tree.ts +9 -0
- package/src/interfaces/segment-tree.ts +1 -0
- package/src/interfaces/singly-linked-list.ts +1 -0
- package/src/interfaces/tree-multiset.ts +7 -0
- package/src/interfaces/undirected-graph.ts +6 -0
- package/src/types/data-structures/abstract-binary-tree.ts +50 -0
- package/src/types/data-structures/abstract-graph.ts +11 -0
- package/src/types/data-structures/avl-tree.ts +5 -0
- package/src/types/data-structures/binary-tree.ts +5 -0
- package/src/types/data-structures/bst.ts +13 -0
- package/src/types/data-structures/directed-graph.ts +8 -0
- package/src/types/data-structures/doubly-linked-list.ts +1 -0
- package/src/types/data-structures/heap.ts +5 -0
- package/src/types/data-structures/index.ts +15 -0
- package/src/types/data-structures/map-graph.ts +1 -0
- package/src/types/data-structures/navigator.ts +13 -0
- package/src/types/data-structures/priority-queue.ts +9 -0
- package/src/types/data-structures/rb-tree.ts +8 -0
- package/src/types/data-structures/segment-tree.ts +1 -0
- package/src/types/data-structures/singly-linked-list.ts +1 -0
- package/src/types/data-structures/tree-multiset.ts +6 -0
- package/src/types/helpers.ts +1 -0
- package/src/types/index.ts +3 -0
- package/src/types/utils/index.ts +2 -0
- package/src/types/utils/utils.ts +6 -0
- package/src/types/utils/validate-type.ts +35 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/utils.ts +79 -0
- package/test/integration/avl-tree.test.ts +14 -17
- package/test/integration/bst.test.ts +50 -41
- package/test/integration/heap.test.js +0 -3
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +14 -17
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +0 -4
- package/test/unit/data-structures/binary-tree/bst.test.ts +50 -41
- package/test/unit/data-structures/binary-tree/overall.test.ts +36 -28
- package/test/unit/data-structures/binary-tree/rb-tree.test.ts +0 -1
- package/test/unit/data-structures/binary-tree/tree-multiset.test.ts +23 -12
- package/test/unit/data-structures/graph/directed-graph.test.ts +27 -25
- package/test/unit/data-structures/graph/map-graph.test.ts +4 -5
- package/test/unit/data-structures/graph/overall.test.ts +10 -11
- package/test/unit/data-structures/graph/undirected-graph.test.ts +0 -1
- package/test/unit/data-structures/heap/heap.test.ts +7 -8
- package/test/unit/data-structures/heap/max-heap.test.ts +7 -5
- package/test/unit/data-structures/heap/min-heap.test.ts +6 -5
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +9 -10
- package/test/unit/data-structures/linked-list/linked-list.test.ts +1 -1
- package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +4 -7
- package/test/unit/data-structures/linked-list/skip-linked-list.test.ts +3 -3
- package/test/unit/data-structures/matrix/matrix.test.ts +4 -4
- package/test/unit/data-structures/matrix/navigator.test.ts +4 -5
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +5 -7
- package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +13 -13
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +8 -8
- package/test/unit/data-structures/queue/deque.test.ts +0 -1
- package/test/unit/data-structures/queue/queue.test.ts +1 -5
- package/test/unit/data-structures/trie/trie.test.ts +2 -2
- package/test/utils/magnitude.ts +3 -3
- package/tsconfig.json +3 -12
- package/tsconfig.prod.json +25 -0
- package/.auto-changelog +0 -9
- package/.gitattributes +0 -112
- package/.idea/codeStyles/Project.xml +0 -61
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/data-structure-typed.iml +0 -19
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.prettierignore +0 -6
- package/webpack.config.js +0 -28
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
1
|
+
module.exports = {
|
|
2
2
|
"extends": [
|
|
3
3
|
"plugin:@typescript-eslint/recommended",
|
|
4
4
|
"prettier"
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"@typescript-eslint/no-unused-vars": "error",
|
|
9
9
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
10
10
|
"@typescript-eslint/no-explicit-any": "off",
|
|
11
|
+
"@typescript-eslint/no-var-requires": "off",
|
|
11
12
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
12
13
|
"lines-around-comment": [
|
|
13
14
|
"error",
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
runs-on: ubuntu-latest
|
|
22
22
|
strategy:
|
|
23
23
|
matrix:
|
|
24
|
-
node-version: [19.
|
|
24
|
+
node-version: [19.9.0]
|
|
25
25
|
steps:
|
|
26
26
|
- name: Checkout code
|
|
27
27
|
uses: actions/checkout@v4
|
|
@@ -34,8 +34,20 @@ jobs:
|
|
|
34
34
|
- name: Install dependencies
|
|
35
35
|
run: npm install
|
|
36
36
|
|
|
37
|
-
- name:
|
|
37
|
+
- name: Print Environment Variables
|
|
38
|
+
run: env
|
|
39
|
+
|
|
40
|
+
- name: Lint
|
|
41
|
+
run: npm run lint
|
|
42
|
+
|
|
43
|
+
- name: Build and documentation
|
|
38
44
|
run: npm run build
|
|
39
45
|
|
|
40
|
-
- name: Run tests
|
|
46
|
+
- name: Run tests
|
|
41
47
|
run: npm test
|
|
48
|
+
|
|
49
|
+
- name: Fetch Tags
|
|
50
|
+
run: git fetch --tags
|
|
51
|
+
|
|
52
|
+
- name: Changelog
|
|
53
|
+
run: npm run changelog
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: data-structure-typed
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [created]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- uses: actions/setup-node@v3
|
|
13
|
+
with:
|
|
14
|
+
node-version: 19
|
|
15
|
+
- run: npm ci
|
|
16
|
+
|
|
17
|
+
publish-gpr:
|
|
18
|
+
needs: build
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
permissions:
|
|
21
|
+
packages: write
|
|
22
|
+
contents: read
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: actions/setup-node@v3
|
|
26
|
+
with:
|
|
27
|
+
node-version: 19
|
|
28
|
+
registry-url: https://npm.pkg.github.com/
|
|
29
|
+
- run: npm publish
|
|
30
|
+
env:
|
|
31
|
+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
32
|
+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/CHANGELOG.md
CHANGED
|
@@ -8,7 +8,11 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
- [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
|
|
9
9
|
- [`auto-changelog`](https://github.com/CookPete/auto-changelog)
|
|
10
10
|
|
|
11
|
-
## [v1.33.
|
|
11
|
+
## [v1.33.5](https://github.com/zrwusa/data-structure-typed/compare/v1.33.4...main) (upcoming)
|
|
12
|
+
|
|
13
|
+
## [v1.33.4](https://github.com/zrwusa/data-structure-typed/compare/v1.33.3...v1.33.4) (26 September 2023)
|
|
14
|
+
|
|
15
|
+
## [v1.33.3](https://github.com/zrwusa/data-structure-typed/compare/v1.12.9...v1.33.3) (26 September 2023)
|
|
12
16
|
|
|
13
17
|
## [v1.12.9](https://github.com/zrwusa/data-structure-typed/compare/v1.12.8...v1.12.9) (14 August 2023)
|
|
14
18
|
|
package/README.md
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Data Structures of Javascript & TypeScript.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
classic algorithms.
|
|
5
|
+
Do you envy languages like C++ with [std](), Python with [collections](), and Java with [java.util]() ? Well, no need to envy anymore! JavaScript and TypeScript now have [data-structure-typed]().
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
Now you can use this library in Node.js and browser environments in CommonJS(require export.modules = ), ESModule(import export), Typescript(import export), UMD(var Queue = dataStructureTyped.Queue)
|
|
9
8
|
|
|
10
9
|

|
|
11
10
|

|