@endo/promise-kit
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -17,9 +17,9 @@ /** | ||
* | ||
* @template T | ||
* @param {Iterable<T>} values An iterable of Promises. | ||
* @returns {Promise<Awaited<T>>} A new Promise. | ||
* @template {readonly unknown[] | []} T | ||
* @param {T} values An iterable of Promises. | ||
* @returns {Promise<Awaited<T[number]>>} A new Promise. | ||
*/ | ||
export function racePromises<T>(values: Iterable<T>): Promise<Awaited<T>>; | ||
export function racePromises<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>; | ||
export * from "./src/is-promise.js"; | ||
export * from "./src/types.js"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -43,5 +43,5 @@ /* global globalThis */ | ||
* | ||
* @template T | ||
* @param {Iterable<T>} values An iterable of Promises. | ||
* @returns {Promise<Awaited<T>>} A new Promise. | ||
* @template {readonly unknown[] | []} T | ||
* @param {T} values An iterable of Promises. | ||
* @returns {Promise<Awaited<T[number]>>} A new Promise. | ||
*/ | ||
@@ -48,0 +48,0 @@ export function racePromises(values) { |
{ | ||
"name": "@endo/promise-kit", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Helper for making promises", | ||
@@ -41,3 +41,3 @@ "keywords": [ | ||
"dependencies": { | ||
"ses": "^1.7.0" | ||
"ses": "^1.8.0" | ||
}, | ||
@@ -54,3 +54,3 @@ "devDependencies": { | ||
"prettier": "^3.2.5", | ||
"typescript": "5.5.2" | ||
"typescript": "~5.6.1-rc" | ||
}, | ||
@@ -85,3 +85,3 @@ "files": [ | ||
}, | ||
"gitHead": "444c81ad3ecc1b0a449023a9c65e9be2fa17db21" | ||
"gitHead": "cb060b7e22c92cc951fb03d86cdbceeae82fec34" | ||
} |
@@ -20,9 +20,9 @@ export { race as memoRace }; | ||
* | ||
* @template T | ||
* @template {readonly unknown[] | []} T | ||
* @template {PromiseConstructor} [P=PromiseConstructor] | ||
* @this {P} | ||
* @param {Iterable<T>} values An iterable of Promises. | ||
* @returns {Promise<Awaited<T>>} A new Promise. | ||
* @param {T} values An iterable of Promises. | ||
* @returns {Promise<Awaited<T[number]>>} A new Promise. | ||
*/ | ||
declare function race<T, P extends PromiseConstructor = PromiseConstructor>(this: P, values: Iterable<T>): Promise<Awaited<T>>; | ||
declare function race<T extends readonly unknown[] | [], P extends PromiseConstructor = PromiseConstructor>(this: P, values: T): Promise<Awaited<T[number]>>; | ||
//# sourceMappingURL=memo-race.d.ts.map |
@@ -114,11 +114,12 @@ /* | ||
* | ||
* @template T | ||
* @template {readonly unknown[] | []} T | ||
* @template {PromiseConstructor} [P=PromiseConstructor] | ||
* @this {P} | ||
* @param {Iterable<T>} values An iterable of Promises. | ||
* @returns {Promise<Awaited<T>>} A new Promise. | ||
* @param {T} values An iterable of Promises. | ||
* @returns {Promise<Awaited<T[number]>>} A new Promise. | ||
*/ | ||
race(values) { | ||
let deferred; | ||
/** @type {T[]} */ | ||
/** @type {[...T]} */ | ||
// @ts-expect-error filled by the loop | ||
const cachedValues = []; | ||
@@ -125,0 +126,0 @@ const C = this; |
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
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
32738
344
Updatedses@^1.8.0