simple-common-utils
Advanced tools
Comparing version 1.3.1 to 1.4.1
@@ -234,2 +234,8 @@ export default class StaticUtils { | ||
} | ||
static verify(condition, errorMessage) { | ||
if (!condition) { | ||
throw new Error(errorMessage); | ||
} | ||
} | ||
} |
{ | ||
"name": "simple-common-utils", | ||
"version": "1.3.1", | ||
"version": "1.4.1", | ||
"description": "A collection of utility classes.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
This is a collection of utility classes used for JS development. | ||
This is a collection of utility classes used for JS development. | ||
@@ -232,2 +232,16 @@ 1. <a name="cusage"></a>[Usage](#usage) | ||
- random() | ||
Generates a random number using `Math.random()`. | ||
StaticUtils.random(1.5, 2.5); // A random number between 1.5 and 2.5. | ||
StaticUtils.random(10, 12, true); // An integer random number in the half-open range [10, 12). | ||
StaticUtils.random(10, 12, true, true); // An integer random number in the closed-range [10, 12]. | ||
- verify(condition, errorMessage) | ||
Evaluates the passed boolean `condition` and throws an error with the `errorMessage` text if `condition` is false. | ||
### <a name="versionHistory"></a>[Version history](#cversionHistory) | ||
@@ -237,2 +251,3 @@ | ||
-|- | ||
v1.4.1|The method `StaticUtils.verify()` is added. | ||
v1.2.1|`StaticUtils.colorNames` had `00` as alpha. Changed to `FF`. | ||
@@ -243,2 +258,2 @@ v1.2.0|The parameter `symmetric` is added to `StaticUtils.round()` in a backwards-compatible way. | ||
<br><br> | ||
> Written with [StackEdit](https://stackedit.io/). | ||
> Written with [StackEdit](https://stackedit.io/). |
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
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
20377
301
257