heap-typed 1.38.2 → 1.38.4

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.
Files changed (40) hide show
  1. package/.dependency-cruiser.js +422 -422
  2. package/.eslintrc.js +59 -59
  3. package/.prettierrc.js +14 -14
  4. package/README.md +3 -0
  5. package/coverage/clover.xml +10 -7
  6. package/coverage/coverage-final.json +165 -1
  7. package/coverage/coverage-summary.json +59 -2
  8. package/coverage/lcov-report/base.css +278 -99
  9. package/coverage/lcov-report/index.html +69 -65
  10. package/coverage/lcov-report/index.ts.html +38 -36
  11. package/coverage/lcov-report/sorter.js +15 -5
  12. package/dist/data-structures/binary-tree/binary-tree.d.ts +9 -9
  13. package/dist/data-structures/binary-tree/bst.d.ts +4 -4
  14. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
  15. package/dist/types/helpers.d.ts +1 -1
  16. package/jest.config.js +6 -6
  17. package/package.json +4 -1
  18. package/src/data-structures/binary-tree/avl-tree.ts +1 -1
  19. package/src/data-structures/binary-tree/binary-indexed-tree.ts +1 -1
  20. package/src/data-structures/binary-tree/binary-tree.ts +21 -21
  21. package/src/data-structures/binary-tree/bst.ts +7 -7
  22. package/src/data-structures/binary-tree/tree-multiset.ts +2 -1
  23. package/src/data-structures/graph/abstract-graph.ts +11 -10
  24. package/src/data-structures/graph/directed-graph.ts +2 -1
  25. package/src/data-structures/graph/undirected-graph.ts +5 -4
  26. package/src/data-structures/hash/hash-map.ts +1 -1
  27. package/src/data-structures/hash/tree-map.ts +1 -2
  28. package/src/data-structures/hash/tree-set.ts +1 -2
  29. package/src/data-structures/linked-list/singly-linked-list.ts +1 -1
  30. package/src/data-structures/matrix/matrix.ts +1 -1
  31. package/src/data-structures/matrix/vector2d.ts +1 -2
  32. package/src/data-structures/queue/deque.ts +4 -5
  33. package/src/data-structures/queue/queue.ts +1 -1
  34. package/src/types/data-structures/binary-tree/binary-tree.ts +1 -1
  35. package/src/types/data-structures/matrix/navigator.ts +1 -1
  36. package/src/types/helpers.ts +1 -1
  37. package/src/types/utils/utils.ts +1 -1
  38. package/src/types/utils/validate-type.ts +2 -2
  39. package/test/index.test.ts +3 -3
  40. package/tsconfig.json +1 -2
package/.eslintrc.js CHANGED
@@ -1,65 +1,65 @@
1
1
  module.exports = {
2
- 'extends': [
3
- 'plugin:@typescript-eslint/recommended',
4
- 'prettier'
5
- ],
6
- 'rules': {
7
- 'react/display-name': 'off',
8
- '@next/next/no-img-element': 'off',
9
- 'react/no-unescaped-entities': 'off',
10
- 'import/no-anonymous-default-export': 'off',
11
- '@typescript-eslint/no-unused-vars': 'error',
12
- '@typescript-eslint/ban-ts-comment': 'off',
13
- '@typescript-eslint/no-explicit-any': 'off',
14
- '@typescript-eslint/no-non-null-assertion': 'off',
15
- // add new line above comment
16
- 'lines-around-comment': [
17
- 'error',
18
- {
19
- 'beforeLineComment': false,
20
- 'beforeBlockComment': true,
21
- 'allowBlockStart': true,
22
- 'allowClassStart': true,
23
- 'allowObjectStart': true,
24
- 'allowArrayStart': true
25
- }
2
+ 'extends': [
3
+ 'plugin:@typescript-eslint/recommended',
4
+ 'prettier'
26
5
  ],
27
- // add new line above return
28
- 'newline-before-return': 'off',
29
- // add new line below import
30
- 'import/newline-after-import': [
31
- 'error',
32
- {
33
- 'count': 1
34
- }
6
+ 'rules': {
7
+ 'react/display-name': 'off',
8
+ '@next/next/no-img-element': 'off',
9
+ 'react/no-unescaped-entities': 'off',
10
+ 'import/no-anonymous-default-export': 'off',
11
+ '@typescript-eslint/no-unused-vars': 'error',
12
+ '@typescript-eslint/ban-ts-comment': 'off',
13
+ '@typescript-eslint/no-explicit-any': 'off',
14
+ '@typescript-eslint/no-non-null-assertion': 'off',
15
+ // add new line above comment
16
+ 'lines-around-comment': [
17
+ 'error',
18
+ {
19
+ 'beforeLineComment': false,
20
+ 'beforeBlockComment': true,
21
+ 'allowBlockStart': true,
22
+ 'allowClassStart': true,
23
+ 'allowObjectStart': true,
24
+ 'allowArrayStart': true
25
+ }
26
+ ],
27
+ // add new line above return
28
+ 'newline-before-return': 'off',
29
+ // add new line below import
30
+ 'import/newline-after-import': [
31
+ 'error',
32
+ {
33
+ 'count': 1
34
+ }
35
+ ],
36
+ '@typescript-eslint/ban-types': [
37
+ 'error',
38
+ {
39
+ 'extendDefaults': true,
40
+ 'types': {
41
+ '{}': false
42
+ }
43
+ }
44
+ ]
45
+ },
46
+ 'plugins': [
47
+ 'import'
35
48
  ],
36
- '@typescript-eslint/ban-types': [
37
- 'error',
38
- {
39
- 'extendDefaults': true,
40
- 'types': {
41
- '{}': false
49
+ 'settings': {
50
+ 'import/parsers': {
51
+ '@typescript-eslint/parser': [
52
+ '.ts',
53
+ '.tsx'
54
+ ]
55
+ },
56
+ 'import/resolver': {
57
+ 'typescript': {
58
+ 'alwaysTryTypes': true,
59
+ 'project': [
60
+ './tsconfig.json'
61
+ ]
62
+ }
42
63
  }
43
- }
44
- ]
45
- },
46
- 'plugins': [
47
- 'import'
48
- ],
49
- 'settings': {
50
- 'import/parsers': {
51
- '@typescript-eslint/parser': [
52
- '.ts',
53
- '.tsx'
54
- ]
55
- },
56
- 'import/resolver': {
57
- 'typescript': {
58
- 'alwaysTryTypes': true,
59
- 'project': [
60
- './tsconfig.json'
61
- ]
62
- }
63
64
  }
64
- }
65
65
  }
package/.prettierrc.js CHANGED
@@ -1,16 +1,16 @@
1
1
  module.exports = {
2
- arrowParens: 'avoid',
3
- bracketSpacing: true,
4
- htmlWhitespaceSensitivity: 'css',
5
- insertPragma: false,
6
- bracketSameLine: false,
7
- jsxSingleQuote: true,
8
- printWidth: 120,
9
- proseWrap: 'preserve',
10
- quoteProps: 'as-needed',
11
- requirePragma: false,
12
- singleQuote: true,
13
- tabWidth: 2,
14
- trailingComma: 'none',
15
- useTabs: false
2
+ arrowParens: 'avoid',
3
+ bracketSpacing: true,
4
+ htmlWhitespaceSensitivity: 'css',
5
+ insertPragma: false,
6
+ bracketSameLine: false,
7
+ jsxSingleQuote: true,
8
+ printWidth: 120,
9
+ proseWrap: 'preserve',
10
+ quoteProps: 'as-needed',
11
+ requirePragma: false,
12
+ singleQuote: true,
13
+ tabWidth: 2,
14
+ trailingComma: 'none',
15
+ useTabs: false
16
16
  }
package/README.md CHANGED
@@ -29,11 +29,14 @@ npm i heap-typed --save
29
29
  ```bash
30
30
  yarn add heap-typed
31
31
  ```
32
+
32
33
  ### methods
34
+
33
35
  Min Heap
34
36
  ![](https://github.com/zrwusa/assets/blob/master/images/data-structure-typed/methods-8bit/min-heap.png?raw=true)
35
37
  Max Heap
36
38
  ![](https://github.com/zrwusa/assets/blob/master/images/data-structure-typed/methods-8bit/max-heap.png?raw=true)
39
+
37
40
  ### snippet
38
41
 
39
42
  #### TS
@@ -1,10 +1,13 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <coverage generated="1696760567971" clover="3.2.0">
3
- <project timestamp="1696760567971" name="All files">
4
- <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="4" coveredmethods="2" elements="5" coveredelements="3" complexity="0" loc="1" ncloc="1" packages="1" files="1" classes="1"/>
5
- <file name="index.ts" path="/Users/revone/projects/data-structure-typed-individuals/heap-typed/src/index.ts">
6
- <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="4" coveredmethods="2"/>
7
- <line num="8" count="3" type="stmt"/>
8
- </file>
9
- </project>
3
+ <project timestamp="1696760567971" name="All files">
4
+ <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="4"
5
+ coveredmethods="2" elements="5" coveredelements="3" complexity="0" loc="1" ncloc="1" packages="1"
6
+ files="1" classes="1"/>
7
+ <file name="index.ts" path="/Users/revone/projects/data-structure-typed-individuals/heap-typed/src/index.ts">
8
+ <metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="4"
9
+ coveredmethods="2"/>
10
+ <line num="8" count="3" type="stmt"/>
11
+ </file>
12
+ </project>
10
13
  </coverage>
@@ -1,2 +1,166 @@
1
- {"/Users/revone/projects/data-structure-typed-individuals/heap-typed/src/index.ts": {"path":"/Users/revone/projects/data-structure-typed-individuals/heap-typed/src/index.ts","statementMap":{"0":{"start":{"line":8,"column":0},"end":{"line":8,"column":9}},"1":{"start":{"line":8,"column":9},"end":{"line":8,"column":19}},"2":{"start":{"line":8,"column":19},"end":{"line":8,"column":25}},"3":{"start":{"line":8,"column":25},"end":{"line":8,"column":34}},"4":{"start":{"line":8,"column":34},"end":{"line":8,"column":72}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":8,"column":9},"end":{"line":8,"column":17}},"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":19}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":8,"column":19},"end":{"line":8,"column":23}},"loc":{"start":{"line":8,"column":19},"end":{"line":8,"column":25}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":8,"column":25},"end":{"line":8,"column":32}},"loc":{"start":{"line":8,"column":25},"end":{"line":8,"column":34}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":8,"column":34},"end":{"line":8,"column":41}},"loc":{"start":{"line":8,"column":34},"end":{"line":8,"column":72}}}},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":2,"4":3},"f":{"0":0,"1":0,"2":1,"3":2},"b":{}}
1
+ {
2
+ "/Users/revone/projects/data-structure-typed-individuals/heap-typed/src/index.ts": {
3
+ "path": "/Users/revone/projects/data-structure-typed-individuals/heap-typed/src/index.ts",
4
+ "statementMap": {
5
+ "0": {
6
+ "start": {
7
+ "line": 8,
8
+ "column": 0
9
+ },
10
+ "end": {
11
+ "line": 8,
12
+ "column": 9
13
+ }
14
+ },
15
+ "1": {
16
+ "start": {
17
+ "line": 8,
18
+ "column": 9
19
+ },
20
+ "end": {
21
+ "line": 8,
22
+ "column": 19
23
+ }
24
+ },
25
+ "2": {
26
+ "start": {
27
+ "line": 8,
28
+ "column": 19
29
+ },
30
+ "end": {
31
+ "line": 8,
32
+ "column": 25
33
+ }
34
+ },
35
+ "3": {
36
+ "start": {
37
+ "line": 8,
38
+ "column": 25
39
+ },
40
+ "end": {
41
+ "line": 8,
42
+ "column": 34
43
+ }
44
+ },
45
+ "4": {
46
+ "start": {
47
+ "line": 8,
48
+ "column": 34
49
+ },
50
+ "end": {
51
+ "line": 8,
52
+ "column": 72
53
+ }
54
+ }
55
+ },
56
+ "fnMap": {
57
+ "0": {
58
+ "name": "(anonymous_0)",
59
+ "decl": {
60
+ "start": {
61
+ "line": 8,
62
+ "column": 9
63
+ },
64
+ "end": {
65
+ "line": 8,
66
+ "column": 17
67
+ }
68
+ },
69
+ "loc": {
70
+ "start": {
71
+ "line": 8,
72
+ "column": 9
73
+ },
74
+ "end": {
75
+ "line": 8,
76
+ "column": 19
77
+ }
78
+ }
79
+ },
80
+ "1": {
81
+ "name": "(anonymous_1)",
82
+ "decl": {
83
+ "start": {
84
+ "line": 8,
85
+ "column": 19
86
+ },
87
+ "end": {
88
+ "line": 8,
89
+ "column": 23
90
+ }
91
+ },
92
+ "loc": {
93
+ "start": {
94
+ "line": 8,
95
+ "column": 19
96
+ },
97
+ "end": {
98
+ "line": 8,
99
+ "column": 25
100
+ }
101
+ }
102
+ },
103
+ "2": {
104
+ "name": "(anonymous_2)",
105
+ "decl": {
106
+ "start": {
107
+ "line": 8,
108
+ "column": 25
109
+ },
110
+ "end": {
111
+ "line": 8,
112
+ "column": 32
113
+ }
114
+ },
115
+ "loc": {
116
+ "start": {
117
+ "line": 8,
118
+ "column": 25
119
+ },
120
+ "end": {
121
+ "line": 8,
122
+ "column": 34
123
+ }
124
+ }
125
+ },
126
+ "3": {
127
+ "name": "(anonymous_3)",
128
+ "decl": {
129
+ "start": {
130
+ "line": 8,
131
+ "column": 34
132
+ },
133
+ "end": {
134
+ "line": 8,
135
+ "column": 41
136
+ }
137
+ },
138
+ "loc": {
139
+ "start": {
140
+ "line": 8,
141
+ "column": 34
142
+ },
143
+ "end": {
144
+ "line": 8,
145
+ "column": 72
146
+ }
147
+ }
148
+ }
149
+ },
150
+ "branchMap": {},
151
+ "s": {
152
+ "0": 1,
153
+ "1": 1,
154
+ "2": 1,
155
+ "3": 2,
156
+ "4": 3
157
+ },
158
+ "f": {
159
+ "0": 0,
160
+ "1": 0,
161
+ "2": 1,
162
+ "3": 2
163
+ },
164
+ "b": {}
165
+ }
2
166
  }
@@ -1,3 +1,60 @@
1
- {"total": {"lines":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":5,"covered":5,"skipped":0,"pct":100},"functions":{"total":4,"covered":2,"skipped":0,"pct":50},"branches":{"total":0,"covered":0,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
2
- ,"/Users/revone/projects/data-structure-typed-individuals/heap-typed/src/index.ts": {"lines":{"total":1,"covered":1,"skipped":0,"pct":100},"functions":{"total":4,"covered":2,"skipped":0,"pct":50},"statements":{"total":5,"covered":5,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}}
1
+ {
2
+ "total": {
3
+ "lines": {
4
+ "total": 1,
5
+ "covered": 1,
6
+ "skipped": 0,
7
+ "pct": 100
8
+ },
9
+ "statements": {
10
+ "total": 5,
11
+ "covered": 5,
12
+ "skipped": 0,
13
+ "pct": 100
14
+ },
15
+ "functions": {
16
+ "total": 4,
17
+ "covered": 2,
18
+ "skipped": 0,
19
+ "pct": 50
20
+ },
21
+ "branches": {
22
+ "total": 0,
23
+ "covered": 0,
24
+ "skipped": 0,
25
+ "pct": 100
26
+ },
27
+ "branchesTrue": {
28
+ "total": 0,
29
+ "covered": 0,
30
+ "skipped": 0,
31
+ "pct": "Unknown"
32
+ }
33
+ },
34
+ "/Users/revone/projects/data-structure-typed-individuals/heap-typed/src/index.ts": {
35
+ "lines": {
36
+ "total": 1,
37
+ "covered": 1,
38
+ "skipped": 0,
39
+ "pct": 100
40
+ },
41
+ "functions": {
42
+ "total": 4,
43
+ "covered": 2,
44
+ "skipped": 0,
45
+ "pct": 50
46
+ },
47
+ "statements": {
48
+ "total": 5,
49
+ "covered": 5,
50
+ "skipped": 0,
51
+ "pct": 100
52
+ },
53
+ "branches": {
54
+ "total": 0,
55
+ "covered": 0,
56
+ "skipped": 0,
57
+ "pct": 100
58
+ }
59
+ }
3
60
  }