Utilities library
All functions that are not related to a specific logic and that can be reused across modules
- Source:
Methods
(static) getModulePath(relativePath) → {String}
Compute a module absolute path from its root based path
Parameters:
| Name | Type | Description |
|---|---|---|
relativePath |
String | Module relative path from project root |
- Source:
Returns:
Module absolute path
- Type
- String
(inner) logAndReject(level, message, error) → {Promise.<Error>}
Log an error and reject it again
Parameters:
| Name | Type | Description |
|---|---|---|
level |
String | Log level |
message |
String | Message that will be logged |
error |
Object | Error object |
- Source:
Returns:
Same error object
- Type
- Promise.<Error>
(inner) logAndResolve(level, message, value) → {Promise.<Mixed>}
Log an error and resolve it again
Parameters:
| Name | Type | Description |
|---|---|---|
level |
String | Log level |
message |
String | Message that will be logged |
value |
Mixed | Value to be resolved with |
- Source:
Returns:
Same value
- Type
- Promise.<Mixed>
(inner) sendBack(res, status, content) → {Undefined}
Mutate response
Parameters:
| Name | Type | Description |
|---|---|---|
res |
Object | Response reference |
status |
Number | Response status |
content |
Object | Content to be sent back |
- Source:
Returns:
Nothing
- Type
- Undefined