All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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];
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy