Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Latest commit

 

History

History
28 lines (19 loc) · 495 Bytes

aOrB.md

File metadata and controls

28 lines (19 loc) · 495 Bytes

aOrB - assertOrBoom

This is the default export function.

It works like a basic assert function but with Boom errors.

Skeleton

aOrB(value, statusCode, message, payload);

Arguments

  • value, anything, if it's a truthy value, it will not throw;
  • statusCode, a http code number;
  • message, name of the error;
  • payload, additional datas;

Import

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

// With import
import aOrB from 'assert-or-boom';