index.js 207 B

123456789101112
  1. /**
  2. * Throw a given error.
  3. *
  4. * @param {Error|null|undefined} [error]
  5. * Maybe error.
  6. * @returns {asserts error is null|undefined}
  7. */
  8. export function bail(error) {
  9. if (error) {
  10. throw error
  11. }
  12. }