@fablevision/utils
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -5,3 +5,3 @@ /** | ||
export function randInt(min, max) { | ||
return min + (Math.floor(Math.random() * (max - min))); | ||
return min + (Math.floor(Math.random() * (max - min + 1))); | ||
} | ||
@@ -8,0 +8,0 @@ /** |
@@ -6,7 +6,1 @@ /** | ||
export declare function wait(milliseconds: number): Promise<void>; | ||
/** | ||
* Waits for the first of a number of promises to resolve or reject. | ||
* Only the first result counts. | ||
* @param promises List of promises to wait for. | ||
*/ | ||
export declare function first(...promises: Promise<any>[]): Promise<void>; |
@@ -8,13 +8,1 @@ /** | ||
} | ||
/** | ||
* Waits for the first of a number of promises to resolve or reject. | ||
* Only the first result counts. | ||
* @param promises List of promises to wait for. | ||
*/ | ||
export function first(...promises) { | ||
return new Promise((resolve, reject) => { | ||
for (let i = 0; i < promises.length; ++i) { | ||
promises[i].then(() => resolve(), reject); | ||
} | ||
}); | ||
} |
{ | ||
"name": "@fablevision/utils", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -8,3 +8,5 @@ "main": "dist/index.js", | ||
"module": "dist/index.js", | ||
"files": ["dist/"], | ||
"files": [ | ||
"dist/" | ||
], | ||
"scripts": { | ||
@@ -11,0 +13,0 @@ "build": "tsc" |
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
11620
370