data-structure-typed 2.2.0 → 2.2.1
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/CHANGELOG.md +1 -1
- package/README.md +66 -21
- package/benchmark/report.html +1 -1
- package/benchmark/report.json +145 -169
- package/dist/cjs/index.cjs +20 -20
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs-legacy/index.cjs +20 -20
- package/dist/cjs-legacy/index.cjs.map +1 -1
- package/dist/esm/index.mjs +20 -20
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm-legacy/index.mjs +20 -20
- package/dist/esm-legacy/index.mjs.map +1 -1
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +3 -1
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +1 -0
- package/dist/types/data-structures/binary-tree/bst.d.ts +1 -0
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +1 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1 -0
- package/dist/types/types/data-structures/base/base.d.ts +1 -1
- package/dist/umd/data-structure-typed.js +20 -20
- package/dist/umd/data-structure-typed.js.map +1 -1
- package/dist/umd/data-structure-typed.min.js +2 -2
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +2 -2
- package/src/data-structures/base/iterable-entry-base.ts +4 -4
- package/src/data-structures/binary-tree/avl-tree-counter.ts +1 -1
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +1 -1
- package/src/data-structures/binary-tree/avl-tree.ts +4 -2
- package/src/data-structures/binary-tree/binary-tree.ts +3 -2
- package/src/data-structures/binary-tree/bst.ts +2 -1
- package/src/data-structures/binary-tree/red-black-tree.ts +2 -1
- package/src/data-structures/binary-tree/tree-counter.ts +1 -1
- package/src/data-structures/binary-tree/tree-multi-map.ts +2 -1
- package/src/data-structures/graph/abstract-graph.ts +3 -3
- package/src/data-structures/hash/hash-map.ts +4 -4
- package/src/types/data-structures/base/base.ts +1 -1
- package/test/performance/data-structures/binary-tree/red-black-tree.test.ts +39 -36
- package/test/performance/runner-config.json +4 -4
- package/test/unit/data-structures/binary-tree/avl-tree-counter.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/bst.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/tree-counter.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/tree-multi-map.test.ts +3 -3
- package/test/unit/data-structures/graph/directed-graph.test.ts +3 -3
- package/test/unit/data-structures/hash/hash-map.test.ts +14 -14
- package/test/performance/reportor.mjs +0 -505
package/benchmark/report.json
CHANGED
|
@@ -1,120 +1,164 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"red-black-tree": {
|
|
3
3
|
"benchmarks": [
|
|
4
4
|
{
|
|
5
|
-
"test name": "
|
|
6
|
-
"time taken (ms)": "
|
|
7
|
-
"sample mean (secs)": "0.
|
|
8
|
-
"sample deviation": "
|
|
5
|
+
"test name": "1,000,000 add",
|
|
6
|
+
"time taken (ms)": "410.34",
|
|
7
|
+
"sample mean (secs)": "0.41",
|
|
8
|
+
"sample deviation": "0.01"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"test name": "
|
|
12
|
-
"time taken (ms)": "
|
|
13
|
-
"sample mean (secs)": "0.
|
|
14
|
-
"sample deviation": "
|
|
11
|
+
"test name": "1,000,000 get",
|
|
12
|
+
"time taken (ms)": "5.20",
|
|
13
|
+
"sample mean (secs)": "0.01",
|
|
14
|
+
"sample deviation": "8.16e-5"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"test name": "1,000,000 iterator",
|
|
18
|
+
"time taken (ms)": "154.25",
|
|
19
|
+
"sample mean (secs)": "0.15",
|
|
20
|
+
"sample deviation": "0.02"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"test name": "CPT 1,000,000 add",
|
|
24
|
+
"time taken (ms)": "656.43",
|
|
25
|
+
"sample mean (secs)": "0.66",
|
|
26
|
+
"sample deviation": "0.00"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"test name": "CPT 1,000,000 add",
|
|
30
|
+
"time taken (ms)": "684.17",
|
|
31
|
+
"sample mean (secs)": "0.68",
|
|
32
|
+
"sample deviation": "0.01"
|
|
15
33
|
}
|
|
16
34
|
]
|
|
17
35
|
},
|
|
18
|
-
"
|
|
36
|
+
"queue": {
|
|
19
37
|
"benchmarks": [
|
|
20
38
|
{
|
|
21
|
-
"test name": "
|
|
22
|
-
"time taken (ms)": "
|
|
23
|
-
"sample mean (secs)": "0.
|
|
24
|
-
"sample deviation": "0.
|
|
39
|
+
"test name": "1,000,000 push",
|
|
40
|
+
"time taken (ms)": "26.97",
|
|
41
|
+
"sample mean (secs)": "0.03",
|
|
42
|
+
"sample deviation": "0.00"
|
|
25
43
|
},
|
|
26
44
|
{
|
|
27
|
-
"test name": "100,000
|
|
28
|
-
"time taken (ms)": "
|
|
29
|
-
"sample mean (secs)": "0.
|
|
30
|
-
"sample deviation": "
|
|
45
|
+
"test name": "100,000 push & shift",
|
|
46
|
+
"time taken (ms)": "2.87",
|
|
47
|
+
"sample mean (secs)": "0.00",
|
|
48
|
+
"sample deviation": "2.71e-4"
|
|
31
49
|
},
|
|
32
50
|
{
|
|
33
|
-
"test name": "100,000
|
|
34
|
-
"time taken (ms)": "
|
|
35
|
-
"sample mean (secs)": "
|
|
36
|
-
"sample deviation": "
|
|
51
|
+
"test name": "Native JS Array 100,000 push & shift",
|
|
52
|
+
"time taken (ms)": "1120.94",
|
|
53
|
+
"sample mean (secs)": "1.12",
|
|
54
|
+
"sample deviation": "0.20"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"deque": {
|
|
59
|
+
"benchmarks": [
|
|
60
|
+
{
|
|
61
|
+
"test name": "1,000,000 push",
|
|
62
|
+
"time taken (ms)": "8.75",
|
|
63
|
+
"sample mean (secs)": "0.01",
|
|
64
|
+
"sample deviation": "6.99e-4"
|
|
37
65
|
},
|
|
38
66
|
{
|
|
39
|
-
"test name": "
|
|
40
|
-
"time taken (ms)": "
|
|
41
|
-
"sample mean (secs)": "0.
|
|
42
|
-
"sample deviation": "
|
|
67
|
+
"test name": "1,000,000 push & pop",
|
|
68
|
+
"time taken (ms)": "12.95",
|
|
69
|
+
"sample mean (secs)": "0.01",
|
|
70
|
+
"sample deviation": "4.21e-4"
|
|
43
71
|
},
|
|
44
72
|
{
|
|
45
|
-
"test name": "
|
|
46
|
-
"time taken (ms)": "13.
|
|
73
|
+
"test name": "1,000,000 push & shift",
|
|
74
|
+
"time taken (ms)": "13.73",
|
|
47
75
|
"sample mean (secs)": "0.01",
|
|
48
|
-
"sample deviation": "
|
|
76
|
+
"sample deviation": "4.53e-4"
|
|
49
77
|
},
|
|
50
78
|
{
|
|
51
|
-
"test name": "100,000
|
|
52
|
-
"time taken (ms)": "
|
|
53
|
-
"sample mean (secs)": "0.
|
|
54
|
-
"sample deviation": "
|
|
79
|
+
"test name": "100,000 push & shift",
|
|
80
|
+
"time taken (ms)": "1.36",
|
|
81
|
+
"sample mean (secs)": "0.00",
|
|
82
|
+
"sample deviation": "5.42e-5"
|
|
55
83
|
},
|
|
56
84
|
{
|
|
57
|
-
"test name": "100,000
|
|
58
|
-
"time taken (ms)": "
|
|
59
|
-
"sample mean (secs)": "
|
|
60
|
-
"sample deviation": "0.
|
|
85
|
+
"test name": "Native JS Array 100,000 push & shift",
|
|
86
|
+
"time taken (ms)": "1167.06",
|
|
87
|
+
"sample mean (secs)": "1.17",
|
|
88
|
+
"sample deviation": "0.26"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"test name": "100,000 unshift & shift",
|
|
92
|
+
"time taken (ms)": "1.31",
|
|
93
|
+
"sample mean (secs)": "0.00",
|
|
94
|
+
"sample deviation": "4.73e-5"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"test name": "Native JS Array 100,000 unshift & shift",
|
|
98
|
+
"time taken (ms)": "1911.47",
|
|
99
|
+
"sample mean (secs)": "1.91",
|
|
100
|
+
"sample deviation": "0.02"
|
|
61
101
|
}
|
|
62
102
|
]
|
|
63
103
|
},
|
|
64
|
-
"
|
|
104
|
+
"heap": {
|
|
105
|
+
"benchmarks": [
|
|
106
|
+
{
|
|
107
|
+
"test name": "100,000 add",
|
|
108
|
+
"time taken (ms)": "4.60",
|
|
109
|
+
"sample mean (secs)": "0.00",
|
|
110
|
+
"sample deviation": "1.07e-4"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"test name": "100,000 add & poll",
|
|
114
|
+
"time taken (ms)": "16.96",
|
|
115
|
+
"sample mean (secs)": "0.02",
|
|
116
|
+
"sample deviation": "3.45e-4"
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"avl-tree": {
|
|
65
121
|
"benchmarks": [
|
|
66
122
|
{
|
|
67
123
|
"test name": "100,000 add randomly",
|
|
68
|
-
"time taken (ms)": "
|
|
69
|
-
"sample mean (secs)": "0.
|
|
124
|
+
"time taken (ms)": "324.51",
|
|
125
|
+
"sample mean (secs)": "0.32",
|
|
70
126
|
"sample deviation": "0.01"
|
|
71
127
|
},
|
|
72
128
|
{
|
|
73
129
|
"test name": "100,000 add",
|
|
74
|
-
"time taken (ms)": "
|
|
75
|
-
"sample mean (secs)": "0.
|
|
76
|
-
"sample deviation": "0.
|
|
130
|
+
"time taken (ms)": "299.76",
|
|
131
|
+
"sample mean (secs)": "0.30",
|
|
132
|
+
"sample deviation": "0.02"
|
|
77
133
|
},
|
|
78
134
|
{
|
|
79
135
|
"test name": "100,000 get",
|
|
80
|
-
"time taken (ms)": "0.
|
|
81
|
-
"sample mean (secs)": "
|
|
82
|
-
"sample deviation": "
|
|
136
|
+
"time taken (ms)": "0.26",
|
|
137
|
+
"sample mean (secs)": "2.58e-4",
|
|
138
|
+
"sample deviation": "3.65e-6"
|
|
83
139
|
},
|
|
84
140
|
{
|
|
85
141
|
"test name": "100,000 getNode",
|
|
86
|
-
"time taken (ms)": "
|
|
87
|
-
"sample mean (secs)": "0.
|
|
88
|
-
"sample deviation": "0.
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"test name": "100,000 node mode add randomly",
|
|
92
|
-
"time taken (ms)": "58.79",
|
|
93
|
-
"sample mean (secs)": "0.06",
|
|
94
|
-
"sample deviation": "0.01"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"test name": "100,000 node mode get",
|
|
98
|
-
"time taken (ms)": "209.90",
|
|
99
|
-
"sample mean (secs)": "0.21",
|
|
100
|
-
"sample deviation": "0.03"
|
|
142
|
+
"time taken (ms)": "169.33",
|
|
143
|
+
"sample mean (secs)": "0.17",
|
|
144
|
+
"sample deviation": "0.00"
|
|
101
145
|
},
|
|
102
146
|
{
|
|
103
147
|
"test name": "100,000 iterator",
|
|
104
|
-
"time taken (ms)": "14.
|
|
148
|
+
"time taken (ms)": "14.43",
|
|
105
149
|
"sample mean (secs)": "0.01",
|
|
106
150
|
"sample deviation": "0.00"
|
|
107
151
|
},
|
|
108
152
|
{
|
|
109
153
|
"test name": "100,000 add & delete orderly",
|
|
110
|
-
"time taken (ms)": "
|
|
111
|
-
"sample mean (secs)": "0.
|
|
154
|
+
"time taken (ms)": "434.44",
|
|
155
|
+
"sample mean (secs)": "0.43",
|
|
112
156
|
"sample deviation": "0.01"
|
|
113
157
|
},
|
|
114
158
|
{
|
|
115
159
|
"test name": "100,000 add & delete randomly",
|
|
116
|
-
"time taken (ms)": "
|
|
117
|
-
"sample mean (secs)": "0.
|
|
160
|
+
"time taken (ms)": "541.78",
|
|
161
|
+
"sample mean (secs)": "0.54",
|
|
118
162
|
"sample deviation": "0.01"
|
|
119
163
|
}
|
|
120
164
|
]
|
|
@@ -123,57 +167,57 @@
|
|
|
123
167
|
"benchmarks": [
|
|
124
168
|
{
|
|
125
169
|
"test name": "1,000,000 set",
|
|
126
|
-
"time taken (ms)": "
|
|
170
|
+
"time taken (ms)": "43.23",
|
|
127
171
|
"sample mean (secs)": "0.04",
|
|
128
172
|
"sample deviation": "0.01"
|
|
129
173
|
},
|
|
130
174
|
{
|
|
131
175
|
"test name": "Native JS Map 1,000,000 set",
|
|
132
|
-
"time taken (ms)": "
|
|
176
|
+
"time taken (ms)": "147.12",
|
|
133
177
|
"sample mean (secs)": "0.15",
|
|
134
178
|
"sample deviation": "0.01"
|
|
135
179
|
},
|
|
136
180
|
{
|
|
137
181
|
"test name": "Native JS Set 1,000,000 add",
|
|
138
|
-
"time taken (ms)": "
|
|
182
|
+
"time taken (ms)": "116.18",
|
|
139
183
|
"sample mean (secs)": "0.12",
|
|
140
184
|
"sample deviation": "0.01"
|
|
141
185
|
},
|
|
142
186
|
{
|
|
143
187
|
"test name": "1,000,000 set & get",
|
|
144
|
-
"time taken (ms)": "
|
|
188
|
+
"time taken (ms)": "46.39",
|
|
145
189
|
"sample mean (secs)": "0.05",
|
|
146
190
|
"sample deviation": "0.01"
|
|
147
191
|
},
|
|
148
192
|
{
|
|
149
193
|
"test name": "Native JS Map 1,000,000 set & get",
|
|
150
|
-
"time taken (ms)": "
|
|
151
|
-
"sample mean (secs)": "0.
|
|
152
|
-
"sample deviation": "0.
|
|
194
|
+
"time taken (ms)": "196.92",
|
|
195
|
+
"sample mean (secs)": "0.20",
|
|
196
|
+
"sample deviation": "0.01"
|
|
153
197
|
},
|
|
154
198
|
{
|
|
155
199
|
"test name": "Native JS Set 1,000,000 add & has",
|
|
156
|
-
"time taken (ms)": "
|
|
157
|
-
"sample mean (secs)": "0.
|
|
158
|
-
"sample deviation": "0.
|
|
200
|
+
"time taken (ms)": "163.92",
|
|
201
|
+
"sample mean (secs)": "0.16",
|
|
202
|
+
"sample deviation": "0.01"
|
|
159
203
|
},
|
|
160
204
|
{
|
|
161
205
|
"test name": "1,000,000 ObjKey set & get",
|
|
162
|
-
"time taken (ms)": "
|
|
163
|
-
"sample mean (secs)": "0.
|
|
206
|
+
"time taken (ms)": "243.36",
|
|
207
|
+
"sample mean (secs)": "0.24",
|
|
164
208
|
"sample deviation": "0.03"
|
|
165
209
|
},
|
|
166
210
|
{
|
|
167
211
|
"test name": "Native JS Map 1,000,000 ObjKey set & get",
|
|
168
|
-
"time taken (ms)": "
|
|
169
|
-
"sample mean (secs)": "0.
|
|
170
|
-
"sample deviation": "0.
|
|
212
|
+
"time taken (ms)": "211.66",
|
|
213
|
+
"sample mean (secs)": "0.21",
|
|
214
|
+
"sample deviation": "0.02"
|
|
171
215
|
},
|
|
172
216
|
{
|
|
173
217
|
"test name": "Native JS Set 1,000,000 ObjKey add & has",
|
|
174
|
-
"time taken (ms)": "
|
|
175
|
-
"sample mean (secs)": "0.
|
|
176
|
-
"sample deviation": "0.
|
|
218
|
+
"time taken (ms)": "196.57",
|
|
219
|
+
"sample mean (secs)": "0.20",
|
|
220
|
+
"sample deviation": "0.01"
|
|
177
221
|
}
|
|
178
222
|
]
|
|
179
223
|
},
|
|
@@ -182,106 +226,38 @@
|
|
|
182
226
|
{
|
|
183
227
|
"test name": "1,000 addVertex",
|
|
184
228
|
"time taken (ms)": "0.05",
|
|
185
|
-
"sample mean (secs)": "4.
|
|
186
|
-
"sample deviation": "
|
|
229
|
+
"sample mean (secs)": "4.60e-5",
|
|
230
|
+
"sample deviation": "6.59e-7"
|
|
187
231
|
},
|
|
188
232
|
{
|
|
189
233
|
"test name": "1,000 addEdge",
|
|
190
|
-
"time taken (ms)": "3.
|
|
234
|
+
"time taken (ms)": "3.02",
|
|
191
235
|
"sample mean (secs)": "0.00",
|
|
192
|
-
"sample deviation": "
|
|
236
|
+
"sample deviation": "2.85e-4"
|
|
193
237
|
},
|
|
194
238
|
{
|
|
195
239
|
"test name": "1,000 getVertex",
|
|
196
240
|
"time taken (ms)": "0.04",
|
|
197
|
-
"sample mean (secs)": "
|
|
198
|
-
"sample deviation": "
|
|
241
|
+
"sample mean (secs)": "3.77e-5",
|
|
242
|
+
"sample deviation": "4.66e-7"
|
|
199
243
|
},
|
|
200
244
|
{
|
|
201
245
|
"test name": "1,000 getEdge",
|
|
202
|
-
"time taken (ms)": "
|
|
246
|
+
"time taken (ms)": "41.48",
|
|
203
247
|
"sample mean (secs)": "0.04",
|
|
204
248
|
"sample deviation": "0.01"
|
|
205
249
|
},
|
|
206
250
|
{
|
|
207
251
|
"test name": "tarjan",
|
|
208
|
-
"time taken (ms)": "
|
|
252
|
+
"time taken (ms)": "240.33",
|
|
209
253
|
"sample mean (secs)": "0.24",
|
|
210
|
-
"sample deviation": "0.
|
|
254
|
+
"sample deviation": "0.01"
|
|
211
255
|
},
|
|
212
256
|
{
|
|
213
257
|
"test name": "topologicalSort",
|
|
214
|
-
"time taken (ms)": "
|
|
215
|
-
"sample mean (secs)": "0.
|
|
216
|
-
"sample deviation": "0.
|
|
217
|
-
}
|
|
218
|
-
]
|
|
219
|
-
},
|
|
220
|
-
"queue": {
|
|
221
|
-
"benchmarks": [
|
|
222
|
-
{
|
|
223
|
-
"test name": "1,000,000 push",
|
|
224
|
-
"time taken (ms)": "26.75",
|
|
225
|
-
"sample mean (secs)": "0.03",
|
|
226
|
-
"sample deviation": "0.00"
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
"test name": "100,000 push & shift",
|
|
230
|
-
"time taken (ms)": "2.88",
|
|
231
|
-
"sample mean (secs)": "0.00",
|
|
232
|
-
"sample deviation": "2.58e-4"
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
"test name": "Native JS Array 100,000 push & shift",
|
|
236
|
-
"time taken (ms)": "1049.96",
|
|
237
|
-
"sample mean (secs)": "1.05",
|
|
238
|
-
"sample deviation": "0.14"
|
|
239
|
-
}
|
|
240
|
-
]
|
|
241
|
-
},
|
|
242
|
-
"deque": {
|
|
243
|
-
"benchmarks": [
|
|
244
|
-
{
|
|
245
|
-
"test name": "1,000,000 push",
|
|
246
|
-
"time taken (ms)": "8.49",
|
|
247
|
-
"sample mean (secs)": "0.01",
|
|
248
|
-
"sample deviation": "4.85e-4"
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
"test name": "1,000,000 push & pop",
|
|
252
|
-
"time taken (ms)": "12.92",
|
|
253
|
-
"sample mean (secs)": "0.01",
|
|
254
|
-
"sample deviation": "4.52e-4"
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
"test name": "1,000,000 push & shift",
|
|
258
|
-
"time taken (ms)": "13.96",
|
|
259
|
-
"sample mean (secs)": "0.01",
|
|
260
|
-
"sample deviation": "9.90e-4"
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
"test name": "100,000 push & shift",
|
|
264
|
-
"time taken (ms)": "1.35",
|
|
265
|
-
"sample mean (secs)": "0.00",
|
|
266
|
-
"sample deviation": "4.62e-5"
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
"test name": "Native JS Array 100,000 push & shift",
|
|
270
|
-
"time taken (ms)": "1133.01",
|
|
271
|
-
"sample mean (secs)": "1.13",
|
|
272
|
-
"sample deviation": "0.20"
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
"test name": "100,000 unshift & shift",
|
|
276
|
-
"time taken (ms)": "1.30",
|
|
277
|
-
"sample mean (secs)": "0.00",
|
|
278
|
-
"sample deviation": "5.14e-5"
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
"test name": "Native JS Array 100,000 unshift & shift",
|
|
282
|
-
"time taken (ms)": "1897.52",
|
|
283
|
-
"sample mean (secs)": "1.90",
|
|
284
|
-
"sample deviation": "0.06"
|
|
258
|
+
"time taken (ms)": "195.62",
|
|
259
|
+
"sample mean (secs)": "0.20",
|
|
260
|
+
"sample deviation": "0.01"
|
|
285
261
|
}
|
|
286
262
|
]
|
|
287
263
|
},
|
|
@@ -292,13 +268,13 @@
|
|
|
292
268
|
"benchmarks": [
|
|
293
269
|
{
|
|
294
270
|
"test name": "100,000 push",
|
|
295
|
-
"time taken (ms)": "27.
|
|
271
|
+
"time taken (ms)": "27.15",
|
|
296
272
|
"sample mean (secs)": "0.03",
|
|
297
|
-
"sample deviation": "
|
|
273
|
+
"sample deviation": "6.61e-4"
|
|
298
274
|
},
|
|
299
275
|
{
|
|
300
276
|
"test name": "100,000 getWords",
|
|
301
|
-
"time taken (ms)": "
|
|
277
|
+
"time taken (ms)": "41.18",
|
|
302
278
|
"sample mean (secs)": "0.04",
|
|
303
279
|
"sample deviation": "0.00"
|
|
304
280
|
}
|
|
@@ -308,13 +284,13 @@
|
|
|
308
284
|
"benchmarks": [
|
|
309
285
|
{
|
|
310
286
|
"test name": "1,000,000 push",
|
|
311
|
-
"time taken (ms)": "25.
|
|
287
|
+
"time taken (ms)": "25.21",
|
|
312
288
|
"sample mean (secs)": "0.03",
|
|
313
289
|
"sample deviation": "0.00"
|
|
314
290
|
},
|
|
315
291
|
{
|
|
316
292
|
"test name": "1,000,000 push & pop",
|
|
317
|
-
"time taken (ms)": "29.
|
|
293
|
+
"time taken (ms)": "29.12",
|
|
318
294
|
"sample mean (secs)": "0.03",
|
|
319
295
|
"sample deviation": "0.00"
|
|
320
296
|
}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -56,7 +56,7 @@ var IterableEntryBase = class {
|
|
|
56
56
|
every(predicate, thisArg) {
|
|
57
57
|
let index = 0;
|
|
58
58
|
for (const item of this) {
|
|
59
|
-
if (!predicate.call(thisArg, item[
|
|
59
|
+
if (!predicate.call(thisArg, item[1], item[0], index++, this)) {
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -72,7 +72,7 @@ var IterableEntryBase = class {
|
|
|
72
72
|
some(predicate, thisArg) {
|
|
73
73
|
let index = 0;
|
|
74
74
|
for (const item of this) {
|
|
75
|
-
if (predicate.call(thisArg, item[
|
|
75
|
+
if (predicate.call(thisArg, item[1], item[0], index++, this)) {
|
|
76
76
|
return true;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -88,7 +88,7 @@ var IterableEntryBase = class {
|
|
|
88
88
|
let index = 0;
|
|
89
89
|
for (const item of this) {
|
|
90
90
|
const [key, value] = item;
|
|
91
|
-
callbackfn.call(thisArg,
|
|
91
|
+
callbackfn.call(thisArg, value, key, index++, this);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
@@ -102,7 +102,7 @@ var IterableEntryBase = class {
|
|
|
102
102
|
let index = 0;
|
|
103
103
|
for (const item of this) {
|
|
104
104
|
const [key, value] = item;
|
|
105
|
-
if (callbackfn.call(thisArg,
|
|
105
|
+
if (callbackfn.call(thisArg, value, key, index++, this)) return item;
|
|
106
106
|
}
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
@@ -717,7 +717,7 @@ var HashMap = class extends IterableEntryBase {
|
|
|
717
717
|
map(callbackfn, thisArg) {
|
|
718
718
|
const out = this._createLike();
|
|
719
719
|
let index = 0;
|
|
720
|
-
for (const [key, value] of this) out.set(key, callbackfn.call(thisArg,
|
|
720
|
+
for (const [key, value] of this) out.set(key, callbackfn.call(thisArg, value, key, index++, this));
|
|
721
721
|
return out;
|
|
722
722
|
}
|
|
723
723
|
/**
|
|
@@ -730,7 +730,7 @@ var HashMap = class extends IterableEntryBase {
|
|
|
730
730
|
filter(predicate, thisArg) {
|
|
731
731
|
const out = this._createLike();
|
|
732
732
|
let index = 0;
|
|
733
|
-
for (const [key, value] of this) if (predicate.call(thisArg,
|
|
733
|
+
for (const [key, value] of this) if (predicate.call(thisArg, value, key, index++, this)) out.set(key, value);
|
|
734
734
|
return out;
|
|
735
735
|
}
|
|
736
736
|
/**
|
|
@@ -1055,7 +1055,7 @@ var LinkedHashMap = class extends IterableEntryBase {
|
|
|
1055
1055
|
const out = this._createLike();
|
|
1056
1056
|
let index = 0;
|
|
1057
1057
|
for (const [key, value] of this) {
|
|
1058
|
-
if (predicate.call(thisArg,
|
|
1058
|
+
if (predicate.call(thisArg, value, key, index, this)) out.set(key, value);
|
|
1059
1059
|
index++;
|
|
1060
1060
|
}
|
|
1061
1061
|
return out;
|
|
@@ -1073,7 +1073,7 @@ var LinkedHashMap = class extends IterableEntryBase {
|
|
|
1073
1073
|
const out = this._createLike();
|
|
1074
1074
|
let index = 0;
|
|
1075
1075
|
for (const [key, value] of this) {
|
|
1076
|
-
const [newKey, newValue] = callback.call(thisArg,
|
|
1076
|
+
const [newKey, newValue] = callback.call(thisArg, value, key, index, this);
|
|
1077
1077
|
out.set(newKey, newValue);
|
|
1078
1078
|
index++;
|
|
1079
1079
|
}
|
|
@@ -5692,7 +5692,7 @@ var AbstractGraph = class extends IterableEntryBase {
|
|
|
5692
5692
|
const filtered = [];
|
|
5693
5693
|
let index = 0;
|
|
5694
5694
|
for (const [key, value] of this) {
|
|
5695
|
-
if (predicate.call(thisArg,
|
|
5695
|
+
if (predicate.call(thisArg, value, key, index, this)) {
|
|
5696
5696
|
filtered.push([key, value]);
|
|
5697
5697
|
}
|
|
5698
5698
|
index++;
|
|
@@ -5707,7 +5707,7 @@ var AbstractGraph = class extends IterableEntryBase {
|
|
|
5707
5707
|
const filtered = [];
|
|
5708
5708
|
let index = 0;
|
|
5709
5709
|
for (const [key, value] of this) {
|
|
5710
|
-
if (predicate.call(thisArg,
|
|
5710
|
+
if (predicate.call(thisArg, value, key, index, this)) {
|
|
5711
5711
|
filtered.push([key, value]);
|
|
5712
5712
|
}
|
|
5713
5713
|
index++;
|
|
@@ -5718,7 +5718,7 @@ var AbstractGraph = class extends IterableEntryBase {
|
|
|
5718
5718
|
const mapped = [];
|
|
5719
5719
|
let index = 0;
|
|
5720
5720
|
for (const [key, value] of this) {
|
|
5721
|
-
mapped.push(callback.call(thisArg,
|
|
5721
|
+
mapped.push(callback.call(thisArg, value, key, index, this));
|
|
5722
5722
|
index++;
|
|
5723
5723
|
}
|
|
5724
5724
|
return mapped;
|
|
@@ -7994,7 +7994,7 @@ var BinaryTree = class extends IterableEntryBase {
|
|
|
7994
7994
|
filter(predicate, thisArg) {
|
|
7995
7995
|
const out = this._createInstance();
|
|
7996
7996
|
let i = 0;
|
|
7997
|
-
for (const [k, v] of this) if (predicate.call(thisArg,
|
|
7997
|
+
for (const [k, v] of this) if (predicate.call(thisArg, v, k, i++, this)) out.add([k, v]);
|
|
7998
7998
|
return out;
|
|
7999
7999
|
}
|
|
8000
8000
|
/**
|
|
@@ -8012,7 +8012,7 @@ var BinaryTree = class extends IterableEntryBase {
|
|
|
8012
8012
|
map(cb, options, thisArg) {
|
|
8013
8013
|
const out = this._createLike([], options);
|
|
8014
8014
|
let i = 0;
|
|
8015
|
-
for (const [k, v] of this) out.add(cb.call(thisArg,
|
|
8015
|
+
for (const [k, v] of this) out.add(cb.call(thisArg, v, k, i++, this));
|
|
8016
8016
|
return out;
|
|
8017
8017
|
}
|
|
8018
8018
|
/**
|
|
@@ -9118,7 +9118,7 @@ var BST = class extends BinaryTree {
|
|
|
9118
9118
|
const out = this._createLike([], options);
|
|
9119
9119
|
let index = 0;
|
|
9120
9120
|
for (const [key, value] of this) {
|
|
9121
|
-
out.add(callback.call(thisArg,
|
|
9121
|
+
out.add(callback.call(thisArg, value, key, index++, this));
|
|
9122
9122
|
}
|
|
9123
9123
|
return out;
|
|
9124
9124
|
}
|
|
@@ -10095,7 +10095,7 @@ var AVLTree = class extends BST {
|
|
|
10095
10095
|
const out = this._createLike([], options);
|
|
10096
10096
|
let index = 0;
|
|
10097
10097
|
for (const [key, value] of this) {
|
|
10098
|
-
out.add(callback.call(thisArg,
|
|
10098
|
+
out.add(callback.call(thisArg, value, key, index++, this));
|
|
10099
10099
|
}
|
|
10100
10100
|
return out;
|
|
10101
10101
|
}
|
|
@@ -10663,7 +10663,7 @@ var RedBlackTree = class extends BST {
|
|
|
10663
10663
|
const out = this._createLike([], options);
|
|
10664
10664
|
let index = 0;
|
|
10665
10665
|
for (const [key, value] of this) {
|
|
10666
|
-
out.add(callback.call(thisArg,
|
|
10666
|
+
out.add(callback.call(thisArg, value, key, index++, this));
|
|
10667
10667
|
}
|
|
10668
10668
|
return out;
|
|
10669
10669
|
}
|
|
@@ -11175,7 +11175,7 @@ var AVLTreeMultiMap = class extends AVLTree {
|
|
|
11175
11175
|
map(callback, options, thisArg) {
|
|
11176
11176
|
const out = this._createLike([], options);
|
|
11177
11177
|
let i = 0;
|
|
11178
|
-
for (const [k, v] of this) out.add(callback.call(thisArg,
|
|
11178
|
+
for (const [k, v] of this) out.add(callback.call(thisArg, v, k, i++, this));
|
|
11179
11179
|
return out;
|
|
11180
11180
|
}
|
|
11181
11181
|
/**
|
|
@@ -11454,7 +11454,7 @@ var TreeMultiMap = class extends RedBlackTree {
|
|
|
11454
11454
|
map(callback, options, thisArg) {
|
|
11455
11455
|
const out = this._createLike([], options);
|
|
11456
11456
|
let i = 0;
|
|
11457
|
-
for (const [k, v] of this) out.add(callback.call(thisArg,
|
|
11457
|
+
for (const [k, v] of this) out.add(callback.call(thisArg, v, k, i++, this));
|
|
11458
11458
|
return out;
|
|
11459
11459
|
}
|
|
11460
11460
|
/**
|
|
@@ -11835,7 +11835,7 @@ var TreeCounter = class extends RedBlackTree {
|
|
|
11835
11835
|
const out = this._createLike([], options);
|
|
11836
11836
|
let index = 0;
|
|
11837
11837
|
for (const [key, value] of this) {
|
|
11838
|
-
out.add(callback.call(thisArg,
|
|
11838
|
+
out.add(callback.call(thisArg, value, key, index++, this));
|
|
11839
11839
|
}
|
|
11840
11840
|
return out;
|
|
11841
11841
|
}
|
|
@@ -12260,7 +12260,7 @@ var AVLTreeCounter = class extends AVLTree {
|
|
|
12260
12260
|
const out = this._createLike([], options);
|
|
12261
12261
|
let index = 0;
|
|
12262
12262
|
for (const [key, value] of this) {
|
|
12263
|
-
out.add(callback.call(thisArg,
|
|
12263
|
+
out.add(callback.call(thisArg, value, key, index++, this));
|
|
12264
12264
|
}
|
|
12265
12265
|
return out;
|
|
12266
12266
|
}
|