UNPKG

return-style

Version:

Non-intrusively convert the result of any function or promise to the user's desired style.

11 lines 281 B
import { Option } from "../classes/option.js"; export async function toOptionPromise(promise) { try { const result = await promise; return Option.Some(result); } catch { return Option.None(); } } //# sourceMappingURL=to-option-promise.js.map