radashi 12.9.6 → 12.9.7
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/dist/radashi.cjs +7 -8
- package/dist/radashi.js +7 -8
- package/package.json +1 -1
package/dist/radashi.cjs
CHANGED
|
@@ -510,12 +510,11 @@ async function parallel(options, array, func) {
|
|
|
510
510
|
if (!next) {
|
|
511
511
|
break;
|
|
512
512
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
result,
|
|
517
|
-
|
|
518
|
-
});
|
|
513
|
+
try {
|
|
514
|
+
results2.push({ result: await func(next.item), index: next.index });
|
|
515
|
+
} catch (error) {
|
|
516
|
+
results2.push({ error, result: void 0, index: next.index });
|
|
517
|
+
}
|
|
519
518
|
}
|
|
520
519
|
return resolve(results2);
|
|
521
520
|
};
|
|
@@ -535,7 +534,7 @@ async function parallel(options, array, func) {
|
|
|
535
534
|
const itemResults = await (signalPromise ? Promise.race([queues, signalPromise]) : queues);
|
|
536
535
|
const [errors, results] = fork(
|
|
537
536
|
sort(flat(itemResults), (r) => r.index),
|
|
538
|
-
(x) =>
|
|
537
|
+
(x) => "error" in x
|
|
539
538
|
);
|
|
540
539
|
if (errors.length > 0) {
|
|
541
540
|
throw new AggregateErrorOrPolyfill(errors.map((error) => error.error));
|
|
@@ -941,7 +940,7 @@ function* range(startOrLength, end, valueOrMapper = (i) => i, step = 1) {
|
|
|
941
940
|
|
|
942
941
|
// src/number/round.ts
|
|
943
942
|
function round(value, precision, toInteger = Math.round) {
|
|
944
|
-
if (precision) {
|
|
943
|
+
if (precision && Number.isFinite(value)) {
|
|
945
944
|
const p = precision > 0 ? Math.min(precision, 292) : Math.max(precision, -323);
|
|
946
945
|
let [q, e] = `${value}e`.split("e");
|
|
947
946
|
[q, e] = `${toInteger(+`${q}e${+e + p}`)}e`.split("e");
|
package/dist/radashi.js
CHANGED
|
@@ -508,12 +508,11 @@ async function parallel(options, array, func) {
|
|
|
508
508
|
if (!next) {
|
|
509
509
|
break;
|
|
510
510
|
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
result,
|
|
515
|
-
|
|
516
|
-
});
|
|
511
|
+
try {
|
|
512
|
+
results2.push({ result: await func(next.item), index: next.index });
|
|
513
|
+
} catch (error) {
|
|
514
|
+
results2.push({ error, result: void 0, index: next.index });
|
|
515
|
+
}
|
|
517
516
|
}
|
|
518
517
|
return resolve(results2);
|
|
519
518
|
};
|
|
@@ -533,7 +532,7 @@ async function parallel(options, array, func) {
|
|
|
533
532
|
const itemResults = await (signalPromise ? Promise.race([queues, signalPromise]) : queues);
|
|
534
533
|
const [errors, results] = fork(
|
|
535
534
|
sort(flat(itemResults), (r) => r.index),
|
|
536
|
-
(x) =>
|
|
535
|
+
(x) => "error" in x
|
|
537
536
|
);
|
|
538
537
|
if (errors.length > 0) {
|
|
539
538
|
throw new AggregateErrorOrPolyfill(errors.map((error) => error.error));
|
|
@@ -939,7 +938,7 @@ function* range(startOrLength, end, valueOrMapper = (i) => i, step = 1) {
|
|
|
939
938
|
|
|
940
939
|
// src/number/round.ts
|
|
941
940
|
function round(value, precision, toInteger = Math.round) {
|
|
942
|
-
if (precision) {
|
|
941
|
+
if (precision && Number.isFinite(value)) {
|
|
943
942
|
const p = precision > 0 ? Math.min(precision, 292) : Math.max(precision, -323);
|
|
944
943
|
let [q, e] = `${value}e`.split("e");
|
|
945
944
|
[q, e] = `${toInteger(+`${q}e${+e + p}`)}e`.split("e");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "radashi",
|
|
3
|
-
"version": "12.9.
|
|
3
|
+
"version": "12.9.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The modern, community-first TypeScript toolkit with all of the fast, readable, and minimal utility functions you need. Type-safe, dependency-free, tree-shakeable, fully tested.",
|
|
6
6
|
"repository": {
|