Methods
# static jsonPurify(model, maxLen)
accepts an array and tries to parse the object passed
Parameters:
Name | Type | Description |
---|---|---|
model |
object | the model to map against |
maxLen |
number | max length of model |
# static logger(msg, type) → {*}
Set logging type for returning errors in a number of ways.
Parameters:
Name | Type | Description |
---|---|---|
msg |
* | |
type |
MaybeLoggerType |
- just the message it is passed
Error
*
# static maybeCurry(fn, val) → {*}
If a function is passed, apply it to the value. Otherwise, just return the value.
Parameters:
Name | Type | Description |
---|---|---|
fn |
function | |
val |
* |
*
# static returner(val, type) → {*}
Return the value - or don't. Of special note is case 4, which will tell you if the result of the operation is true, false, null or undefined. You can use numbers or strings
TYPES
- 1(quiet) - return void 0
- 2(console) - log the returned value to the console
- 3(break) - throw an error with the contents of the return
- 4(truthy) - return a true or false value
- 5(typeof) - return type of response
- 6(trace) - get a console.trace() of the call stack
- 7(passthrough) - the default does nothing to the return
Parameters:
Name | Type | Description |
---|---|---|
val |
* | |
type |
MaybeReturnerType |
the message it is passed (if type 3)
Error
*