es-toolkit
Advanced tools
Comparing version
@@ -508,2 +508,6 @@ "use strict"; | ||
function random(minimum, maximum) { | ||
if (maximum == null) { | ||
maximum = minimum; | ||
minimum = 0; | ||
} | ||
if (minimum >= maximum) { | ||
@@ -510,0 +514,0 @@ throw new Error("Invalid input: The maximum value must be greater than the minimum value."); |
@@ -57,2 +57,6 @@ "use strict"; | ||
function random(minimum, maximum) { | ||
if (maximum == null) { | ||
maximum = minimum; | ||
minimum = 0; | ||
} | ||
if (minimum >= maximum) { | ||
@@ -59,0 +63,0 @@ throw new Error("Invalid input: The maximum value must be greater than the minimum value."); |
/** | ||
* Generate a random number within the given range. | ||
* | ||
* If only one argument is provided, a number between `0` and the given number is returned. | ||
* | ||
* @param {number} minimum - The lower bound (inclusive). | ||
@@ -14,4 +16,5 @@ * @param {number} maximum - The upper bound (exclusive). | ||
*/ | ||
declare function random(maximum: number): number; | ||
declare function random(minimum: number, maximum: number): number; | ||
export { random }; |
@@ -27,2 +27,6 @@ "use strict"; | ||
function random(minimum, maximum) { | ||
if (maximum == null) { | ||
maximum = minimum; | ||
minimum = 0; | ||
} | ||
if (minimum >= maximum) { | ||
@@ -29,0 +33,0 @@ throw new Error("Invalid input: The maximum value must be greater than the minimum value."); |
/** | ||
* Generates a random integer between minimum (inclusive) and maximum (exclusive). | ||
* | ||
* If only one argument is provided, a number between `0` and the given number is returned. | ||
* | ||
* @param {number} minimum - The lower bound (inclusive). | ||
@@ -13,4 +15,5 @@ * @param {number} maximum - The upper bound (exclusive). | ||
*/ | ||
declare function randomInt(maximum: number): number; | ||
declare function randomInt(minimum: number, maximum: number): number; | ||
export { randomInt }; |
@@ -29,2 +29,6 @@ "use strict"; | ||
function random(minimum, maximum) { | ||
if (maximum == null) { | ||
maximum = minimum; | ||
minimum = 0; | ||
} | ||
if (minimum >= maximum) { | ||
@@ -31,0 +35,0 @@ throw new Error("Invalid input: The maximum value must be greater than the minimum value."); |
{ | ||
"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.5.0-dev.110+184ce177", | ||
"version": "1.5.0-dev.111+ff59ab4c", | ||
"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
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
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
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
595096
0.6%6453
0.4%