@whatwg-node/promise-helpers
Advanced tools
Comparing version 0.0.1-alpha-20250225102211-278c6478ea45ec6f3c81c9f91295113accf29346 to 0.0.1-alpha-20250225103232-6e030f1f28831b318bcb7e9913a93e4086cecb07
@@ -17,3 +17,3 @@ "use strict"; | ||
function handleMaybePromiseLike(inputFactory, outputSuccessFactory, outputErrorFactory) { | ||
function _handle() { | ||
function _handleMaybePromiseLike() { | ||
const input$ = inputFactory(); | ||
@@ -26,6 +26,6 @@ if (isPromiseLike(input$)) { | ||
if (!outputErrorFactory) { | ||
return _handle(); | ||
return _handleMaybePromiseLike(); | ||
} | ||
try { | ||
return _handle(); | ||
return _handleMaybePromiseLike(); | ||
} | ||
@@ -32,0 +32,0 @@ catch (err) { |
@@ -8,3 +8,3 @@ export function isPromise(value) { | ||
export function handleMaybePromiseLike(inputFactory, outputSuccessFactory, outputErrorFactory) { | ||
function _handle() { | ||
function _handleMaybePromiseLike() { | ||
const input$ = inputFactory(); | ||
@@ -17,6 +17,6 @@ if (isPromiseLike(input$)) { | ||
if (!outputErrorFactory) { | ||
return _handle(); | ||
return _handleMaybePromiseLike(); | ||
} | ||
try { | ||
return _handle(); | ||
return _handleMaybePromiseLike(); | ||
} | ||
@@ -23,0 +23,0 @@ catch (err) { |
{ | ||
"name": "@whatwg-node/promise-helpers", | ||
"version": "0.0.1-alpha-20250225102211-278c6478ea45ec6f3c81c9f91295113accf29346", | ||
"version": "0.0.1-alpha-20250225103232-6e030f1f28831b318bcb7e9913a93e4086cecb07", | ||
"description": "Promise helpers", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -14,2 +14,2 @@ export type MaybePromise<T> = Promise<T> | T; | ||
export declare function createDeferredPromise<T = void>(): DeferredPromise<T>; | ||
export declare function iterateAsyncVoid<TInput>(iterable: Iterable<TInput>, callback: (input: TInput, stopEarly: () => void) => Promise<void> | void): Promise<void> | void; | ||
export declare function iterateAsyncVoid<TInput>(iterable: Iterable<TInput>, callback: (input: TInput, stopEarly: () => void) => MaybePromise<void>): MaybePromise<void>; |
Sorry, the diff of this file is not supported yet
9640