Skip to content

Module: utility

Index

References

Classes

Functions

References

Callable

Callable:


Relation

Relation:

Functions

Const invokeChain

invokeChain(middleware: Array‹Function›, ...args: any[]): Promise‹any[]›

Defined in lib/utility/index.ts:114

Parameters:

Name Type
middleware Array‹Function
...args any[]

Returns: Promise‹any[]›


Const isCollectionOf

isCollectionOf(type: any, col: object, assert: boolean): boolean

Defined in lib/utility/index.ts:16

Verifies that all elements of the input collection are of type 'Type'.

Parameters:

Name Type Default Description
type any - -
col object - The object or array to search
assert boolean false If true, the function will throw an error in case of false result.

Returns: boolean

A boolean


Const makeChain

makeChain(): caller

Defined in lib/utility/index.ts:132

Returns: caller


Const mergePaths

mergePaths(...paths: any[]): string

Defined in lib/utility/index.ts:49

Parameters:

Name Type
...paths any[]

Returns: string


Const parseEndpoint

parseEndpoint(endpoint: string, custom: Array‹string›, root: string): object | object

Defined in lib/utility/index.ts:75

Parameters:

Name Type Default
endpoint string -
custom Array‹string› []
root string "/"

Returns: object | object


Const requireAll

requireAll(path: string): any[]

Defined in lib/utility/index.ts:43

Parameters:

Name Type
path string

Returns: any[]


Const routeToPath

routeToPath(route: string, args: object, query: boolean): string

Defined in lib/utility/index.ts:95

Parameters:

Name Type Default
route string -
args object -
query boolean false

Returns: string


Const tryParseJSON

tryParseJSON(json: string): any

Defined in lib/utility/index.ts:35

Parameters:

Name Type
json string

Returns: any