es-toolkit
Advanced tools
Comparing version 1.3.1-dev.78 to 1.3.1-dev.79
@@ -37,2 +37,3 @@ export { chunk } from './array/chunk.js'; | ||
export { clamp } from './math/clamp.js'; | ||
export { random } from './math/random.js'; | ||
export { round } from './math/round.js'; | ||
@@ -39,0 +40,0 @@ export { sum } from './math/sum.js'; |
@@ -64,2 +64,3 @@ "use strict"; | ||
pickBy: () => pickBy, | ||
random: () => random, | ||
round: () => round, | ||
@@ -419,2 +420,10 @@ sample: () => sample, | ||
// src/math/random.ts | ||
function random(minimum, maximum) { | ||
if (minimum >= maximum) { | ||
throw new Error("Invalid input: The maximum value must be greater than the minimum value."); | ||
} | ||
return Math.random() * (maximum - minimum) + minimum; | ||
} | ||
// src/math/round.ts | ||
@@ -543,2 +552,3 @@ function round(value, precision = 0) { | ||
pickBy, | ||
random, | ||
round, | ||
@@ -545,0 +555,0 @@ sample, |
export { clamp } from './clamp.js'; | ||
export { random } from './random.js'; | ||
export { round } from './round.js'; | ||
export { sum } from './sum.js'; |
@@ -24,2 +24,3 @@ "use strict"; | ||
clamp: () => clamp, | ||
random: () => random, | ||
round: () => round, | ||
@@ -38,2 +39,10 @@ sum: () => sum | ||
// src/math/random.ts | ||
function random(minimum, maximum) { | ||
if (minimum >= maximum) { | ||
throw new Error("Invalid input: The maximum value must be greater than the minimum value."); | ||
} | ||
return Math.random() * (maximum - minimum) + minimum; | ||
} | ||
// src/math/round.ts | ||
@@ -56,2 +65,3 @@ function round(value, precision = 0) { | ||
clamp, | ||
random, | ||
round, | ||
@@ -58,0 +68,0 @@ sum |
{ | ||
"name": "es-toolkit", | ||
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.", | ||
"version": "1.3.1-dev.78+8d80869f", | ||
"version": "1.3.1-dev.79+65a65ea2", | ||
"workspaces": [ | ||
@@ -6,0 +6,0 @@ "docs" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
511964
458
5489