data-structure-typed 1.49.6 → 1.49.8

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 (198) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +16 -13
  3. package/README_zh-CN.md +2 -0
  4. package/benchmark/report.html +13 -13
  5. package/benchmark/report.json +148 -148
  6. package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +3 -3
  7. package/dist/cjs/data-structures/binary-tree/avl-tree.js +5 -5
  8. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
  9. package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +3 -3
  10. package/dist/cjs/data-structures/binary-tree/binary-tree.js +11 -13
  11. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
  12. package/dist/cjs/data-structures/binary-tree/bst.d.ts +3 -3
  13. package/dist/cjs/data-structures/binary-tree/bst.js +6 -7
  14. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
  15. package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +2 -2
  16. package/dist/cjs/data-structures/binary-tree/rb-tree.js +6 -6
  17. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
  18. package/dist/cjs/data-structures/binary-tree/tree-multimap.d.ts +1 -1
  19. package/dist/cjs/data-structures/binary-tree/tree-multimap.js +3 -3
  20. package/dist/cjs/data-structures/binary-tree/tree-multimap.js.map +1 -1
  21. package/dist/cjs/data-structures/hash/hash-map.d.ts +24 -27
  22. package/dist/cjs/data-structures/hash/hash-map.js +35 -35
  23. package/dist/cjs/data-structures/hash/hash-map.js.map +1 -1
  24. package/dist/cjs/data-structures/hash/index.d.ts +0 -1
  25. package/dist/cjs/data-structures/hash/index.js +0 -1
  26. package/dist/cjs/data-structures/hash/index.js.map +1 -1
  27. package/dist/cjs/data-structures/heap/heap.d.ts +2 -1
  28. package/dist/cjs/data-structures/heap/heap.js +13 -13
  29. package/dist/cjs/data-structures/heap/heap.js.map +1 -1
  30. package/dist/cjs/data-structures/heap/max-heap.js +1 -1
  31. package/dist/cjs/data-structures/heap/max-heap.js.map +1 -1
  32. package/dist/cjs/data-structures/heap/min-heap.js +1 -1
  33. package/dist/cjs/data-structures/heap/min-heap.js.map +1 -1
  34. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +1 -1
  35. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
  36. package/dist/cjs/data-structures/linked-list/singly-linked-list.js +1 -3
  37. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
  38. package/dist/cjs/data-structures/linked-list/skip-linked-list.d.ts +2 -8
  39. package/dist/cjs/data-structures/linked-list/skip-linked-list.js +15 -18
  40. package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -1
  41. package/dist/cjs/data-structures/matrix/matrix.d.ts +2 -7
  42. package/dist/cjs/data-structures/matrix/matrix.js +0 -7
  43. package/dist/cjs/data-structures/matrix/matrix.js.map +1 -1
  44. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +1 -1
  45. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -1
  46. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +1 -1
  47. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -1
  48. package/dist/cjs/data-structures/priority-queue/priority-queue.js +1 -1
  49. package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -1
  50. package/dist/cjs/data-structures/queue/deque.d.ts +2 -11
  51. package/dist/cjs/data-structures/queue/deque.js +9 -13
  52. package/dist/cjs/data-structures/queue/deque.js.map +1 -1
  53. package/dist/cjs/data-structures/queue/queue.d.ts +13 -13
  54. package/dist/cjs/data-structures/queue/queue.js +29 -25
  55. package/dist/cjs/data-structures/queue/queue.js.map +1 -1
  56. package/dist/cjs/data-structures/stack/stack.js +2 -3
  57. package/dist/cjs/data-structures/stack/stack.js.map +1 -1
  58. package/dist/cjs/data-structures/trie/trie.d.ts +2 -2
  59. package/dist/cjs/data-structures/trie/trie.js +9 -5
  60. package/dist/cjs/data-structures/trie/trie.js.map +1 -1
  61. package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +2 -2
  62. package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +1 -1
  63. package/dist/cjs/types/data-structures/binary-tree/rb-tree.d.ts +1 -1
  64. package/dist/cjs/types/data-structures/binary-tree/tree-multimap.d.ts +1 -1
  65. package/dist/cjs/types/data-structures/hash/hash-map.d.ts +5 -2
  66. package/dist/cjs/types/data-structures/hash/index.d.ts +0 -1
  67. package/dist/cjs/types/data-structures/hash/index.js +0 -1
  68. package/dist/cjs/types/data-structures/hash/index.js.map +1 -1
  69. package/dist/cjs/types/data-structures/heap/heap.d.ts +1 -1
  70. package/dist/cjs/types/data-structures/linked-list/index.d.ts +1 -0
  71. package/dist/cjs/types/data-structures/linked-list/index.js +1 -0
  72. package/dist/cjs/types/data-structures/linked-list/index.js.map +1 -1
  73. package/dist/cjs/types/data-structures/linked-list/skip-linked-list.d.ts +4 -1
  74. package/dist/cjs/types/data-structures/matrix/index.d.ts +1 -0
  75. package/dist/cjs/types/data-structures/matrix/index.js +1 -0
  76. package/dist/cjs/types/data-structures/matrix/index.js.map +1 -1
  77. package/dist/cjs/types/data-structures/matrix/matrix.d.ts +7 -1
  78. package/dist/cjs/types/data-structures/queue/deque.d.ts +3 -1
  79. package/dist/cjs/types/data-structures/trie/trie.d.ts +3 -1
  80. package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +3 -3
  81. package/dist/mjs/data-structures/binary-tree/avl-tree.js +5 -5
  82. package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +3 -3
  83. package/dist/mjs/data-structures/binary-tree/binary-tree.js +11 -13
  84. package/dist/mjs/data-structures/binary-tree/bst.d.ts +3 -3
  85. package/dist/mjs/data-structures/binary-tree/bst.js +6 -7
  86. package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +2 -2
  87. package/dist/mjs/data-structures/binary-tree/rb-tree.js +5 -6
  88. package/dist/mjs/data-structures/binary-tree/tree-multimap.d.ts +1 -1
  89. package/dist/mjs/data-structures/binary-tree/tree-multimap.js +3 -3
  90. package/dist/mjs/data-structures/hash/hash-map.d.ts +24 -27
  91. package/dist/mjs/data-structures/hash/hash-map.js +35 -37
  92. package/dist/mjs/data-structures/hash/index.d.ts +0 -1
  93. package/dist/mjs/data-structures/hash/index.js +0 -1
  94. package/dist/mjs/data-structures/heap/heap.d.ts +2 -1
  95. package/dist/mjs/data-structures/heap/heap.js +19 -20
  96. package/dist/mjs/data-structures/heap/max-heap.js +1 -1
  97. package/dist/mjs/data-structures/heap/min-heap.js +1 -1
  98. package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +1 -1
  99. package/dist/mjs/data-structures/linked-list/singly-linked-list.js +2 -5
  100. package/dist/mjs/data-structures/linked-list/skip-linked-list.d.ts +2 -8
  101. package/dist/mjs/data-structures/linked-list/skip-linked-list.js +16 -23
  102. package/dist/mjs/data-structures/matrix/matrix.d.ts +2 -7
  103. package/dist/mjs/data-structures/matrix/matrix.js +0 -7
  104. package/dist/mjs/data-structures/priority-queue/max-priority-queue.js +1 -1
  105. package/dist/mjs/data-structures/priority-queue/min-priority-queue.js +1 -1
  106. package/dist/mjs/data-structures/priority-queue/priority-queue.js +1 -1
  107. package/dist/mjs/data-structures/queue/deque.d.ts +2 -11
  108. package/dist/mjs/data-structures/queue/deque.js +9 -14
  109. package/dist/mjs/data-structures/queue/queue.d.ts +13 -13
  110. package/dist/mjs/data-structures/queue/queue.js +30 -28
  111. package/dist/mjs/data-structures/stack/stack.js +3 -5
  112. package/dist/mjs/data-structures/trie/trie.d.ts +2 -2
  113. package/dist/mjs/data-structures/trie/trie.js +10 -9
  114. package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +2 -2
  115. package/dist/mjs/types/data-structures/binary-tree/bst.d.ts +1 -1
  116. package/dist/mjs/types/data-structures/binary-tree/rb-tree.d.ts +1 -1
  117. package/dist/mjs/types/data-structures/binary-tree/tree-multimap.d.ts +1 -1
  118. package/dist/mjs/types/data-structures/hash/hash-map.d.ts +5 -2
  119. package/dist/mjs/types/data-structures/hash/index.d.ts +0 -1
  120. package/dist/mjs/types/data-structures/hash/index.js +0 -1
  121. package/dist/mjs/types/data-structures/heap/heap.d.ts +1 -1
  122. package/dist/mjs/types/data-structures/linked-list/index.d.ts +1 -0
  123. package/dist/mjs/types/data-structures/linked-list/index.js +1 -0
  124. package/dist/mjs/types/data-structures/linked-list/skip-linked-list.d.ts +4 -1
  125. package/dist/mjs/types/data-structures/matrix/index.d.ts +1 -0
  126. package/dist/mjs/types/data-structures/matrix/index.js +1 -0
  127. package/dist/mjs/types/data-structures/matrix/matrix.d.ts +7 -1
  128. package/dist/mjs/types/data-structures/queue/deque.d.ts +3 -1
  129. package/dist/mjs/types/data-structures/trie/trie.d.ts +3 -1
  130. package/dist/umd/data-structure-typed.js +151 -432
  131. package/dist/umd/data-structure-typed.min.js +2 -2
  132. package/dist/umd/data-structure-typed.min.js.map +1 -1
  133. package/package.json +1 -1
  134. package/src/data-structures/binary-tree/avl-tree.ts +4 -4
  135. package/src/data-structures/binary-tree/binary-tree.ts +10 -14
  136. package/src/data-structures/binary-tree/bst.ts +5 -7
  137. package/src/data-structures/binary-tree/rb-tree.ts +4 -5
  138. package/src/data-structures/binary-tree/tree-multimap.ts +2 -2
  139. package/src/data-structures/hash/hash-map.ts +46 -50
  140. package/src/data-structures/hash/index.ts +0 -1
  141. package/src/data-structures/heap/heap.ts +20 -19
  142. package/src/data-structures/heap/max-heap.ts +1 -1
  143. package/src/data-structures/heap/min-heap.ts +1 -1
  144. package/src/data-structures/linked-list/doubly-linked-list.ts +1 -1
  145. package/src/data-structures/linked-list/singly-linked-list.ts +2 -5
  146. package/src/data-structures/linked-list/skip-linked-list.ts +15 -16
  147. package/src/data-structures/matrix/matrix.ts +2 -10
  148. package/src/data-structures/priority-queue/max-priority-queue.ts +1 -1
  149. package/src/data-structures/priority-queue/min-priority-queue.ts +1 -1
  150. package/src/data-structures/priority-queue/priority-queue.ts +1 -1
  151. package/src/data-structures/queue/deque.ts +11 -15
  152. package/src/data-structures/queue/queue.ts +29 -28
  153. package/src/data-structures/stack/stack.ts +3 -6
  154. package/src/data-structures/trie/trie.ts +10 -11
  155. package/src/types/data-structures/binary-tree/binary-tree.ts +2 -2
  156. package/src/types/data-structures/binary-tree/bst.ts +1 -1
  157. package/src/types/data-structures/binary-tree/rb-tree.ts +1 -1
  158. package/src/types/data-structures/binary-tree/tree-multimap.ts +1 -1
  159. package/src/types/data-structures/hash/hash-map.ts +6 -2
  160. package/src/types/data-structures/hash/index.ts +0 -1
  161. package/src/types/data-structures/heap/heap.ts +1 -1
  162. package/src/types/data-structures/linked-list/index.ts +1 -0
  163. package/src/types/data-structures/linked-list/skip-linked-list.ts +1 -1
  164. package/src/types/data-structures/matrix/index.ts +1 -0
  165. package/src/types/data-structures/matrix/matrix.ts +7 -1
  166. package/src/types/data-structures/queue/deque.ts +1 -1
  167. package/src/types/data-structures/trie/trie.ts +1 -1
  168. package/test/integration/index.html +4 -4
  169. package/test/unit/data-structures/binary-tree/overall.test.ts +180 -1
  170. package/test/unit/data-structures/hash/hash-map.test.ts +19 -6
  171. package/test/unit/data-structures/linked-list/skip-list.test.ts +1 -1
  172. package/test/unit/data-structures/queue/deque.test.ts +5 -5
  173. package/test/unit/data-structures/trie/trie.test.ts +1 -1
  174. package/dist/cjs/data-structures/hash/hash-table.d.ts +0 -108
  175. package/dist/cjs/data-structures/hash/hash-table.js +0 -282
  176. package/dist/cjs/data-structures/hash/hash-table.js.map +0 -1
  177. package/dist/cjs/types/data-structures/hash/hash-table.d.ts +0 -1
  178. package/dist/cjs/types/data-structures/hash/hash-table.js +0 -3
  179. package/dist/cjs/types/data-structures/hash/hash-table.js.map +0 -1
  180. package/dist/cjs/types/data-structures/matrix/matrix2d.d.ts +0 -1
  181. package/dist/cjs/types/data-structures/matrix/matrix2d.js +0 -3
  182. package/dist/cjs/types/data-structures/matrix/matrix2d.js.map +0 -1
  183. package/dist/cjs/types/data-structures/matrix/vector2d.d.ts +0 -1
  184. package/dist/cjs/types/data-structures/matrix/vector2d.js +0 -3
  185. package/dist/cjs/types/data-structures/matrix/vector2d.js.map +0 -1
  186. package/dist/mjs/data-structures/hash/hash-table.d.ts +0 -108
  187. package/dist/mjs/data-structures/hash/hash-table.js +0 -283
  188. package/dist/mjs/types/data-structures/hash/hash-table.d.ts +0 -1
  189. package/dist/mjs/types/data-structures/hash/hash-table.js +0 -1
  190. package/dist/mjs/types/data-structures/matrix/matrix2d.d.ts +0 -1
  191. package/dist/mjs/types/data-structures/matrix/matrix2d.js +0 -1
  192. package/dist/mjs/types/data-structures/matrix/vector2d.d.ts +0 -1
  193. package/dist/mjs/types/data-structures/matrix/vector2d.js +0 -1
  194. package/src/data-structures/hash/hash-table.ts +0 -318
  195. package/src/types/data-structures/hash/hash-table.ts +0 -1
  196. package/src/types/data-structures/matrix/matrix2d.ts +0 -1
  197. package/src/types/data-structures/matrix/vector2d.ts +0 -1
  198. package/test/unit/data-structures/hash/hash-table.test.ts +0 -238
@@ -1,238 +0,0 @@
1
- import { HashTable, HashTableNode } from '../../../../src';
2
-
3
- describe('HashNode', () => {
4
- it('should create a HashNode with key and value', () => {
5
- const key = 'testKey';
6
- const value = 'testValue';
7
- const hashNode = new HashTableNode(key, value);
8
-
9
- expect(hashNode.key).toBe(key);
10
- expect(hashNode.value).toBe(value);
11
- expect(hashNode.next).toBe(undefined);
12
- });
13
- });
14
-
15
- describe('HashTable', () => {
16
- it('should initialize with default capacity', () => {
17
- const hashTable = new HashTable<string, string>();
18
- expect(hashTable.capacity).toBe(16);
19
- expect(hashTable.buckets).toEqual(new Array(16).fill(undefined));
20
- expect(hashTable.hashFn('a')).toBe(6);
21
- expect(hashTable.capacity).toBe(16);
22
- expect(hashTable.size).toBe(0);
23
- expect(hashTable.buckets.length).toBe(16);
24
- });
25
-
26
- it('should initialize with custom capacity', () => {
27
- const customCapacity = 500;
28
- const hashTable = new HashTable<string, string>(customCapacity);
29
-
30
- expect(hashTable.capacity).toBe(customCapacity);
31
- expect(hashTable.size).toBe(0);
32
- expect(hashTable.buckets.length).toBe(customCapacity);
33
- });
34
-
35
- it('should put and get values correctly', () => {
36
- const hashTable = new HashTable<string, string>();
37
- const key = 'testKey';
38
- const value = 'testValue';
39
-
40
- hashTable.set(key, value);
41
- const retrievedValue = hashTable.get(key);
42
-
43
- expect(retrievedValue).toBe(value);
44
- });
45
-
46
- it('should handle collisions by chaining', () => {
47
- const hashTable = new HashTable<string, string>();
48
- const key1 = 'testKey1';
49
- const value1 = 'testValue1';
50
- const key2 = 'testKey2';
51
- const value2 = 'testValue2';
52
-
53
- hashTable.set(key1, value1);
54
- hashTable.set(key2, value2);
55
-
56
- const retrievedValue1 = hashTable.get(key1);
57
- const retrievedValue2 = hashTable.get(key2);
58
-
59
- expect(retrievedValue1).toBe(value1);
60
- expect(retrievedValue2).toBe(value2);
61
- });
62
-
63
- it('should update value for an existing key', () => {
64
- const hashTable = new HashTable<string, string>();
65
- const key = 'testKey';
66
- const initialValue = 'testValue1';
67
- const updatedValue = 'testValue2';
68
-
69
- hashTable.set(key, initialValue);
70
- hashTable.set(key, updatedValue);
71
-
72
- const retrievedValue = hashTable.get(key);
73
-
74
- expect(retrievedValue).toBe(updatedValue);
75
- });
76
-
77
- it('should return undefined for non-existent key', () => {
78
- const hashTable = new HashTable<string, string>();
79
- const key = 'nonExistentKey';
80
-
81
- const retrievedValue = hashTable.get(key);
82
-
83
- expect(retrievedValue).toBeUndefined();
84
- });
85
-
86
- it('should delete key-value pair correctly', () => {
87
- const hashTable = new HashTable<string, string>();
88
- const key = 'testKey';
89
- const value = 'testValue';
90
-
91
- hashTable.set(key, value);
92
- hashTable.delete(key);
93
-
94
- const retrievedValue = hashTable.get(key);
95
-
96
- expect(retrievedValue).toBeUndefined();
97
- expect(hashTable.size).toBe(0);
98
- });
99
- });
100
-
101
- describe('HashTable', () => {
102
- let hashTable: HashTable<string, number>;
103
-
104
- beforeEach(() => {
105
- hashTable = new HashTable<string, number>();
106
- });
107
-
108
- it('should insert and retrieve values correctly', () => {
109
- hashTable.set('one', 1);
110
- hashTable.set('two', 2);
111
-
112
- expect(hashTable.get('one')).toBe(1);
113
- expect(hashTable.get('two')).toBe(2);
114
- });
115
-
116
- it('should update values correctly', () => {
117
- hashTable.set('one', 1);
118
- expect(hashTable.get('one')).toBe(1);
119
-
120
- hashTable.set('one', 100); // Update the value
121
- expect(hashTable.get('one')).toBe(100);
122
- });
123
-
124
- it('should handle collisions correctly', () => {
125
- hashTable = new HashTable<string, number>(1); // Set a small capacity to force collisions
126
- hashTable.set('one', 1);
127
- hashTable.set('two', 2);
128
-
129
- expect(hashTable.get('one')).toBe(1);
130
- expect(hashTable.get('two')).toBe(2);
131
- });
132
-
133
- it('should delete values correctly', () => {
134
- hashTable.set('one', 1);
135
- hashTable.set('two', 2);
136
- hashTable.delete('one');
137
-
138
- expect(hashTable.get('one')).toBeUndefined();
139
- expect(hashTable.get('two')).toBe(2);
140
- });
141
-
142
- it('should handle non-existent keys correctly', () => {
143
- expect(hashTable.get('non-existent')).toBeUndefined();
144
- hashTable.delete('non-existent'); // Removing a non-existent key should not cause errors
145
- });
146
-
147
- it('should handle custom hash function correctly', () => {
148
- // const customHashFn = () => {
149
- // // Custom hash function that returns a fixed value for all keys
150
- // return 42;
151
- // };
152
-
153
- hashTable = new HashTable<string, number>(16);
154
- hashTable.set('one', 1);
155
- expect(hashTable.get('one')).toBe(1);
156
- expect(hashTable.get('two')).toBeUndefined();
157
- });
158
-
159
- it('should expand when load factor exceeds threshold', () => {
160
- hashTable = new HashTable<string, number>(2); // Set a small capacity to trigger expansion
161
- hashTable.set('one', 1);
162
- hashTable.set('two', 2);
163
- hashTable.set('three', 3); // This should trigger an expansion
164
-
165
- expect(hashTable.capacity).toBe(16);
166
- expect(hashTable.get('one')).toBe(1);
167
- expect(hashTable.get('two')).toBe(2);
168
- expect(hashTable.get('three')).toBe(3);
169
- });
170
- });
171
-
172
- describe('HashTable performance', function () {
173
- it('Items set performance', function () {
174
- const mag = 100000;
175
- const ht = new HashTable();
176
- // const s = performance.now();
177
- for (let i = 0; i < mag; i++) {
178
- ht.set(i, i);
179
- }
180
- // const s1 = performance.now();
181
- const map = new Map();
182
- for (let i = 0; i < mag; i++) {
183
- map.set(i, i);
184
- }
185
- });
186
- });
187
-
188
- describe('HashTable methods', () => {
189
- let hashTable: HashTable<string, string>;
190
-
191
- beforeEach(() => {
192
- hashTable = new HashTable();
193
- for (let i = 0; i < 10; i++) {
194
- hashTable.set(`key${i}`, `value${i}`);
195
- }
196
- });
197
-
198
- test('should retrieve correct values with get method', () => {
199
- for (let i = 0; i < 10; i++) {
200
- expect(hashTable.get(`key${i}`)).toBe(`value${i}`);
201
- }
202
- });
203
-
204
- // test('forEach should apply a function to each key-value pair', () => {
205
- // const mockCallback = jest.fn();
206
- // hashTable.forEach(mockCallback);
207
- //
208
- // expect(mockCallback.mock.calls.length).toBe(10);
209
- // for (let i = 0; i < 10; i++) {
210
- // // Check whether each key-value pair has been called before, regardless of the order
211
- // const call = mockCallback.mock.calls.find(call => call[1] === `value${i}`);
212
- // expect(call).toBeTruthy();
213
- // expect(call[0]).toBe(`key${i}`);
214
- // }
215
- // });
216
-
217
- test('filter should return a new HashTable with elements that satisfy the condition', () => {
218
- const filtered = hashTable.filter(([key]) => key.endsWith('1') || key.endsWith('3'));
219
-
220
- expect(filtered.size).toBe(2);
221
- expect(filtered.get('key1')).toBe('value1');
222
- expect(filtered.get('key3')).toBe('value3');
223
- });
224
-
225
- test('map should return a new HashTable with mapped values', () => {
226
- const mapped = hashTable.map(([, value]) => value.toUpperCase());
227
-
228
- for (let i = 0; i < 10; i++) {
229
- expect(mapped.get(`key${i}`)).toBe(`value${i}`.toUpperCase());
230
- }
231
- });
232
-
233
- test('reduce should accumulate values based on the reducer function', () => {
234
- const result = hashTable.reduce((acc, [, value]) => `${acc}-${value}`, '');
235
-
236
- expect(result).toBe('-value5-value7-value3-value4-value6-value0-value2-value8-value1-value9');
237
- });
238
- });