package.src.core.utils.promise-to-result.ts Maven / Gradle / Ivy
export default async function promiseToResult(
current: Promise,
): Promise<[0 | 1, unknown]> {
try {
return [1, await current];
} catch (e) {
return [0, e];
}
}
export default async function promiseToResult(
current: Promise,
): Promise<[0 | 1, unknown]> {
try {
return [1, await current];
} catch (e) {
return [0, e];
}
}