umt 2.4.0 → 2.5.0
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/README.md +277 -16
- package/module/Array/groupBy.js +8 -7
- package/module/Array/groupBy.js.map +1 -1
- package/module/Array/index.d.ts +1 -0
- package/module/Array/index.js +1 -0
- package/module/Array/index.js.map +1 -1
- package/module/Array/timSort.js +2 -20
- package/module/Array/timSort.js.map +1 -1
- package/module/Array/ultraNumberSort.d.ts +7 -0
- package/module/Array/ultraNumberSort.js +373 -0
- package/module/Array/ultraNumberSort.js.map +1 -0
- package/module/Tool/pipe.d.ts +1 -1
- package/module/Tool/pipe.js.map +1 -1
- package/module/es5/Array/groupBy.js +8 -7
- package/module/es5/Array/index.d.ts +1 -0
- package/module/es5/Array/index.js +11 -0
- package/module/es5/Array/timSort.js +2 -20
- package/module/es5/Array/ultraNumberSort.d.ts +7 -0
- package/module/es5/Array/ultraNumberSort.js +475 -0
- package/module/es5/Tool/pipe.d.ts +1 -1
- package/module/es5/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ultraNumberSort = void 0;
|
|
7
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
|
+
/**
|
|
11
|
+
* Ultra-fast sorting specifically optimized for number arrays
|
|
12
|
+
* @param array Array of numbers to sort
|
|
13
|
+
* @param ascending Sort in ascending order if true, descending if false
|
|
14
|
+
* @returns Sorted array
|
|
15
|
+
*/
|
|
16
|
+
var ultraNumberSort = exports.ultraNumberSort = function ultraNumberSort(array) {
|
|
17
|
+
var ascending = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
18
|
+
var length = array.length;
|
|
19
|
+
if (length <= 1) {
|
|
20
|
+
return array;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// For tiny arrays, use optimized inline sort
|
|
24
|
+
if (length === 2) {
|
|
25
|
+
if (array[0] > array[1] === ascending) {
|
|
26
|
+
var _ref = [array[1], array[0]];
|
|
27
|
+
array[0] = _ref[0];
|
|
28
|
+
array[1] = _ref[1];
|
|
29
|
+
}
|
|
30
|
+
return array;
|
|
31
|
+
}
|
|
32
|
+
if (length === 3) {
|
|
33
|
+
inlineSort3(array, ascending);
|
|
34
|
+
return array;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Check if all numbers are integers and find range
|
|
38
|
+
var allIntegers = true;
|
|
39
|
+
var min = array[0];
|
|
40
|
+
var max = array[0];
|
|
41
|
+
var hasNaN = false;
|
|
42
|
+
for (var index = 0; index < length; index++) {
|
|
43
|
+
var value = array[index];
|
|
44
|
+
// biome-ignore lint/suspicious/noSelfCompare: <explanation>
|
|
45
|
+
if (value !== value) {
|
|
46
|
+
hasNaN = true;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
if (value < min) {
|
|
50
|
+
min = value;
|
|
51
|
+
}
|
|
52
|
+
if (value > max) {
|
|
53
|
+
max = value;
|
|
54
|
+
}
|
|
55
|
+
if (allIntegers && value !== Math.floor(value)) {
|
|
56
|
+
allIntegers = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Handle NaN values
|
|
61
|
+
if (hasNaN) {
|
|
62
|
+
return handleNaNSort(array, ascending);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// For small integer ranges, use counting sort
|
|
66
|
+
if (allIntegers && max - min < length * 2 && max - min < 1000000) {
|
|
67
|
+
return countingSort(array, min, max, ascending);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// For larger arrays, use radix sort if applicable
|
|
71
|
+
if (allIntegers && length > 100) {
|
|
72
|
+
return radixSort(array, ascending);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Fall back to optimized quicksort for floating point
|
|
76
|
+
return numericQuickSort(array, 0, length - 1, ascending);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Inline sort for 3 elements
|
|
81
|
+
*/
|
|
82
|
+
var inlineSort3 = function inlineSort3(array, ascending) {
|
|
83
|
+
var a = array[0];
|
|
84
|
+
var b = array[1];
|
|
85
|
+
var c = array[2];
|
|
86
|
+
if (ascending) {
|
|
87
|
+
if (a > b) {
|
|
88
|
+
var _ref2 = [b, a];
|
|
89
|
+
a = _ref2[0];
|
|
90
|
+
b = _ref2[1];
|
|
91
|
+
}
|
|
92
|
+
if (b > c) {
|
|
93
|
+
var _ref3 = [c, b];
|
|
94
|
+
b = _ref3[0];
|
|
95
|
+
c = _ref3[1];
|
|
96
|
+
if (a > b) {
|
|
97
|
+
var _ref4 = [b, a];
|
|
98
|
+
a = _ref4[0];
|
|
99
|
+
b = _ref4[1];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
if (a < b) {
|
|
104
|
+
var _ref5 = [b, a];
|
|
105
|
+
a = _ref5[0];
|
|
106
|
+
b = _ref5[1];
|
|
107
|
+
}
|
|
108
|
+
if (b < c) {
|
|
109
|
+
var _ref6 = [c, b];
|
|
110
|
+
b = _ref6[0];
|
|
111
|
+
c = _ref6[1];
|
|
112
|
+
if (a < b) {
|
|
113
|
+
var _ref7 = [b, a];
|
|
114
|
+
a = _ref7[0];
|
|
115
|
+
b = _ref7[1];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
array[0] = a;
|
|
120
|
+
array[1] = b;
|
|
121
|
+
array[2] = c;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Handle arrays with NaN values
|
|
126
|
+
*/
|
|
127
|
+
var handleNaNSort = function handleNaNSort(array, ascending) {
|
|
128
|
+
var valid = [];
|
|
129
|
+
var nanCount = 0;
|
|
130
|
+
var _iterator = _createForOfIteratorHelper(array),
|
|
131
|
+
_step;
|
|
132
|
+
try {
|
|
133
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
134
|
+
var element = _step.value;
|
|
135
|
+
// biome-ignore lint/suspicious/noSelfCompare: <explanation>
|
|
136
|
+
if (element === element) {
|
|
137
|
+
valid.push(element);
|
|
138
|
+
} else {
|
|
139
|
+
nanCount++;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
} catch (err) {
|
|
143
|
+
_iterator.e(err);
|
|
144
|
+
} finally {
|
|
145
|
+
_iterator.f();
|
|
146
|
+
}
|
|
147
|
+
numericQuickSort(valid, 0, valid.length - 1, ascending);
|
|
148
|
+
|
|
149
|
+
// NaN values go to the end
|
|
150
|
+
for (var index = 0; index < nanCount; index++) {
|
|
151
|
+
valid.push(Number.NaN);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Copy back
|
|
155
|
+
for (var _index = 0; _index < array.length; _index++) {
|
|
156
|
+
array[_index] = valid[_index];
|
|
157
|
+
}
|
|
158
|
+
return array;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Counting sort for small integer ranges
|
|
163
|
+
*/
|
|
164
|
+
var countingSort = function countingSort(array, min, max, ascending) {
|
|
165
|
+
var range = max - min + 1;
|
|
166
|
+
var count = new Uint32Array(range);
|
|
167
|
+
|
|
168
|
+
// Count occurrences
|
|
169
|
+
var _iterator2 = _createForOfIteratorHelper(array),
|
|
170
|
+
_step2;
|
|
171
|
+
try {
|
|
172
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
173
|
+
var element = _step2.value;
|
|
174
|
+
count[element - min]++;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Reconstruct array
|
|
178
|
+
} catch (err) {
|
|
179
|
+
_iterator2.e(err);
|
|
180
|
+
} finally {
|
|
181
|
+
_iterator2.f();
|
|
182
|
+
}
|
|
183
|
+
var index = 0;
|
|
184
|
+
if (ascending) {
|
|
185
|
+
for (var index_ = 0; index_ < range; index_++) {
|
|
186
|
+
var cnt = count[index_];
|
|
187
|
+
var value = index_ + min;
|
|
188
|
+
for (var _index_ = 0; _index_ < cnt; _index_++) {
|
|
189
|
+
array[index++] = value;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
} else {
|
|
193
|
+
for (var _index_2 = range - 1; _index_2 >= 0; _index_2--) {
|
|
194
|
+
var _cnt = count[_index_2];
|
|
195
|
+
var _value = _index_2 + min;
|
|
196
|
+
for (var _index_3 = 0; _index_3 < _cnt; _index_3++) {
|
|
197
|
+
array[index++] = _value;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return array;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Radix sort for integers
|
|
206
|
+
*/
|
|
207
|
+
var radixSort = function radixSort(array, ascending) {
|
|
208
|
+
var length = array.length;
|
|
209
|
+
|
|
210
|
+
// Separate positive and negative numbers
|
|
211
|
+
var positive = [];
|
|
212
|
+
var negative = [];
|
|
213
|
+
var zeroCount = 0;
|
|
214
|
+
for (var index_ = 0; index_ < length; index_++) {
|
|
215
|
+
if (array[index_] > 0) {
|
|
216
|
+
positive.push(array[index_]);
|
|
217
|
+
} else if (array[index_] < 0) {
|
|
218
|
+
negative.push(-array[index_]);
|
|
219
|
+
} else {
|
|
220
|
+
zeroCount++;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Sort positive numbers
|
|
225
|
+
if (positive.length > 0) {
|
|
226
|
+
radixSortPositive(positive);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Sort negative numbers
|
|
230
|
+
if (negative.length > 0) {
|
|
231
|
+
radixSortPositive(negative);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Merge results
|
|
235
|
+
var index = 0;
|
|
236
|
+
if (ascending) {
|
|
237
|
+
// Negative numbers first (in reverse order)
|
|
238
|
+
for (var _index_4 = negative.length - 1; _index_4 >= 0; _index_4--) {
|
|
239
|
+
array[index++] = -negative[_index_4];
|
|
240
|
+
}
|
|
241
|
+
// Zeros
|
|
242
|
+
for (var _index_5 = 0; _index_5 < zeroCount; _index_5++) {
|
|
243
|
+
array[index++] = 0;
|
|
244
|
+
}
|
|
245
|
+
// Positive numbers
|
|
246
|
+
var _iterator3 = _createForOfIteratorHelper(positive),
|
|
247
|
+
_step3;
|
|
248
|
+
try {
|
|
249
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
250
|
+
var element = _step3.value;
|
|
251
|
+
array[index++] = element;
|
|
252
|
+
}
|
|
253
|
+
} catch (err) {
|
|
254
|
+
_iterator3.e(err);
|
|
255
|
+
} finally {
|
|
256
|
+
_iterator3.f();
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
// Positive numbers first (in reverse order)
|
|
260
|
+
for (var _index_6 = positive.length - 1; _index_6 >= 0; _index_6--) {
|
|
261
|
+
array[index++] = positive[_index_6];
|
|
262
|
+
}
|
|
263
|
+
// Zeros
|
|
264
|
+
for (var _index_7 = 0; _index_7 < zeroCount; _index_7++) {
|
|
265
|
+
array[index++] = 0;
|
|
266
|
+
}
|
|
267
|
+
// Negative numbers
|
|
268
|
+
var _iterator4 = _createForOfIteratorHelper(negative),
|
|
269
|
+
_step4;
|
|
270
|
+
try {
|
|
271
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
272
|
+
var _element = _step4.value;
|
|
273
|
+
array[index++] = -_element;
|
|
274
|
+
}
|
|
275
|
+
} catch (err) {
|
|
276
|
+
_iterator4.e(err);
|
|
277
|
+
} finally {
|
|
278
|
+
_iterator4.f();
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return array;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Radix sort for positive integers
|
|
286
|
+
*/
|
|
287
|
+
var radixSortPositive = function radixSortPositive(array) {
|
|
288
|
+
var length = array.length;
|
|
289
|
+
if (length <= 1) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Find maximum to determine number of digits
|
|
294
|
+
var max = array[0];
|
|
295
|
+
for (var index = 1; index < length; index++) {
|
|
296
|
+
if (array[index] > max) {
|
|
297
|
+
max = array[index];
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Use typed arrays for better performance
|
|
302
|
+
var output = new Float64Array(length);
|
|
303
|
+
var count = new Uint32Array(256);
|
|
304
|
+
|
|
305
|
+
// Process 8 bits at a time
|
|
306
|
+
for (var shift = 0; max >> shift > 0; shift += 8) {
|
|
307
|
+
// Reset count array
|
|
308
|
+
count.fill(0);
|
|
309
|
+
|
|
310
|
+
// Count occurrences
|
|
311
|
+
for (var _index2 = 0; _index2 < length; _index2++) {
|
|
312
|
+
var digit = array[_index2] >> shift & 0xff;
|
|
313
|
+
count[digit]++;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Change count[i] to actual position
|
|
317
|
+
for (var _index3 = 1; _index3 < 256; _index3++) {
|
|
318
|
+
count[_index3] += count[_index3 - 1];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Build output array
|
|
322
|
+
for (var _index4 = length - 1; _index4 >= 0; _index4--) {
|
|
323
|
+
var _digit = array[_index4] >> shift & 0xff;
|
|
324
|
+
output[--count[_digit]] = array[_index4];
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Copy back
|
|
328
|
+
for (var _index5 = 0; _index5 < length; _index5++) {
|
|
329
|
+
array[_index5] = output[_index5];
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Optimized quicksort for numbers
|
|
336
|
+
*/
|
|
337
|
+
var numericQuickSort = function numericQuickSort(array, low, high, ascending) {
|
|
338
|
+
var stack = [];
|
|
339
|
+
stack.push(low, high);
|
|
340
|
+
while (stack.length > 0) {
|
|
341
|
+
var h = stack.pop();
|
|
342
|
+
var l = stack.pop();
|
|
343
|
+
if (h === undefined || l === undefined || h <= l) {
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// For small subarrays, use insertion sort
|
|
348
|
+
if (h - l < 16) {
|
|
349
|
+
numericInsertionSort(array, l, h, ascending);
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Partition
|
|
354
|
+
var pivot = numericPartition(array, l, h, ascending);
|
|
355
|
+
|
|
356
|
+
// Push larger partition first to limit stack depth
|
|
357
|
+
if (pivot - l > h - pivot) {
|
|
358
|
+
stack.push(l, pivot - 1, pivot + 1, h);
|
|
359
|
+
} else {
|
|
360
|
+
stack.push(pivot + 1, h, l, pivot - 1);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return array;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Numeric insertion sort
|
|
368
|
+
*/
|
|
369
|
+
var numericInsertionSort = function numericInsertionSort(array, low, high, ascending) {
|
|
370
|
+
if (ascending) {
|
|
371
|
+
for (var index = low + 1; index <= high; index++) {
|
|
372
|
+
var key = array[index];
|
|
373
|
+
var index_ = index - 1;
|
|
374
|
+
while (index_ >= low && array[index_] > key) {
|
|
375
|
+
array[index_ + 1] = array[index_];
|
|
376
|
+
index_--;
|
|
377
|
+
}
|
|
378
|
+
array[index_ + 1] = key;
|
|
379
|
+
}
|
|
380
|
+
} else {
|
|
381
|
+
for (var _index6 = low + 1; _index6 <= high; _index6++) {
|
|
382
|
+
var _key = array[_index6];
|
|
383
|
+
var _index_8 = _index6 - 1;
|
|
384
|
+
while (_index_8 >= low && array[_index_8] < _key) {
|
|
385
|
+
array[_index_8 + 1] = array[_index_8];
|
|
386
|
+
_index_8--;
|
|
387
|
+
}
|
|
388
|
+
array[_index_8 + 1] = _key;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Numeric partition with median-of-three pivot
|
|
395
|
+
*/
|
|
396
|
+
var numericPartition = function numericPartition(array, low, high, ascending) {
|
|
397
|
+
// Median-of-three pivot selection
|
|
398
|
+
var mid = low + (high - low >> 1);
|
|
399
|
+
if (ascending) {
|
|
400
|
+
if (array[mid] < array[low]) {
|
|
401
|
+
var _ref8 = [array[mid], array[low]];
|
|
402
|
+
array[low] = _ref8[0];
|
|
403
|
+
array[mid] = _ref8[1];
|
|
404
|
+
}
|
|
405
|
+
if (array[high] < array[low]) {
|
|
406
|
+
var _ref9 = [array[high], array[low]];
|
|
407
|
+
array[low] = _ref9[0];
|
|
408
|
+
array[high] = _ref9[1];
|
|
409
|
+
}
|
|
410
|
+
if (array[high] < array[mid]) {
|
|
411
|
+
var _ref0 = [array[high], array[mid]];
|
|
412
|
+
array[mid] = _ref0[0];
|
|
413
|
+
array[high] = _ref0[1];
|
|
414
|
+
}
|
|
415
|
+
} else {
|
|
416
|
+
if (array[mid] > array[low]) {
|
|
417
|
+
var _ref1 = [array[mid], array[low]];
|
|
418
|
+
array[low] = _ref1[0];
|
|
419
|
+
array[mid] = _ref1[1];
|
|
420
|
+
}
|
|
421
|
+
if (array[high] > array[low]) {
|
|
422
|
+
var _ref10 = [array[high], array[low]];
|
|
423
|
+
array[low] = _ref10[0];
|
|
424
|
+
array[high] = _ref10[1];
|
|
425
|
+
}
|
|
426
|
+
if (array[high] > array[mid]) {
|
|
427
|
+
var _ref11 = [array[high], array[mid]];
|
|
428
|
+
array[mid] = _ref11[0];
|
|
429
|
+
array[high] = _ref11[1];
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// Move pivot to end-1
|
|
434
|
+
var _ref12 = [array[high - 1], array[mid]];
|
|
435
|
+
array[mid] = _ref12[0];
|
|
436
|
+
array[high - 1] = _ref12[1];
|
|
437
|
+
var pivot = array[high - 1];
|
|
438
|
+
var index = low;
|
|
439
|
+
var index_ = high - 1;
|
|
440
|
+
if (ascending) {
|
|
441
|
+
while (true) {
|
|
442
|
+
while (array[++index] < pivot) {
|
|
443
|
+
// Continue
|
|
444
|
+
}
|
|
445
|
+
while (array[--index_] > pivot) {
|
|
446
|
+
// Continue
|
|
447
|
+
}
|
|
448
|
+
if (index >= index_) {
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
var _ref13 = [array[index_], array[index]];
|
|
452
|
+
array[index] = _ref13[0];
|
|
453
|
+
array[index_] = _ref13[1];
|
|
454
|
+
}
|
|
455
|
+
} else {
|
|
456
|
+
while (true) {
|
|
457
|
+
while (array[++index] > pivot) {
|
|
458
|
+
// Continue
|
|
459
|
+
}
|
|
460
|
+
while (array[--index_] < pivot) {
|
|
461
|
+
// Continue
|
|
462
|
+
}
|
|
463
|
+
if (index >= index_) {
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
var _ref14 = [array[index_], array[index]];
|
|
467
|
+
array[index] = _ref14[0];
|
|
468
|
+
array[index_] = _ref14[1];
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
var _ref15 = [array[high - 1], array[index]];
|
|
472
|
+
array[index] = _ref15[0];
|
|
473
|
+
array[high - 1] = _ref15[1];
|
|
474
|
+
return index;
|
|
475
|
+
};
|
|
@@ -51,7 +51,7 @@ export declare class Pipe<T> {
|
|
|
51
51
|
* @param predicate Condition function that determines if value should be filtered
|
|
52
52
|
* @returns New Pipe instance with Result containing filtered value or error
|
|
53
53
|
*/
|
|
54
|
-
filterResult<U extends T>(predicate: (input: T) => input is U): Pipe<Result<U,
|
|
54
|
+
filterResult<U extends T, E extends Error = Error>(predicate: (input: T) => input is U): Pipe<Result<U, E>>;
|
|
55
55
|
/**
|
|
56
56
|
* Terminates the pipeline and returns the final value
|
|
57
57
|
* @returns Final result of the pipeline processing
|