/assert-or-boom

Assert or throw a Boom Error

Primary LanguageTypeScript

Assert or Boom

code style: prettier

Assert or throw a Boom Error

Install

# With yarn
yarn add assert-or-boom
# Or with npm
npm i assert-or-boom

Use

const aOrB = require('assert-or-boom');
const boom = require('boom');

try {
  aOrB(true, 500, 'Internal Error');
} catch (err) {
  Boom.isBoom(err); // => true
}

Functions