Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

Const DB_ERROR_RESPONSE

DB_ERROR_RESPONSE: { message: string; status: string } = ...

A generic database 500 error JSON response.

Type declaration

  • message: string
  • status: string

Const OK_RESPONSE

OK_RESPONSE: { status: string } = ...

A generic 200 ok JSON response.

Type declaration

  • status: string

Functions

errorResponse

  • errorResponse(message: string): { message: string; status: string }
  • Creates a JSON response for when errors are thrown.

    Parameters

    • message: string

      Error message

    Returns { message: string; status: string }

    JSON response Object.

    • message: string
    • status: string

roundTo

  • roundTo(n: number, r: number): number
  • Rounds a given number to a given number of decimal points.

    Parameters

    • n: number

      Number to round

    • r: number

      Number of decimal points to round to

    Returns number

    Rounded number of n

Generated using TypeDoc