Global

Members


colors

Colors.
Source:

colors

Colors.
Source:

init

This is the Node.js implementation of `debug()`.
Source:

inspectOpts

Build up the default `inspectOpts` object from the environment variables. $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
Source:

log

This is the web browser implementation of `debug()`.
Source:

s

Helpers.
Source:

<private, constant> self

Wrapper for logging functions that normally reference SubModule.error and similar.
Source:
To Do:
  • Obtain reference to SubModule to be able to remove this.

<nullable> sqlCon :sql.ConnectionConfig

The object describing the connection with the SQL server.
Type:
  • sql.ConnectionConfig
Source:

tty

Module dependencies.
Source:

Methods


<private> __stack()

Gets the stack trace of the current function call.
Source:
Returns:
Error stack for logging.
Type
Stack

<private> addListener(emitter, event, fn, context, once)

Add a listener for a given event.
Parameters:
Name Type Description
emitter EventEmitter Reference to the `EventEmitter` instance.
event String | Symbol The event name.
fn function The listener function.
context * The context to invoke the listener with.
once Boolean Specify if the listener is a one-time listener.
Source:
Returns:
Type
EventEmitter

<private> clearEvent(emitter, evt)

Clear event by name.
Parameters:
Name Type Description
emitter EventEmitter Reference to the `EventEmitter` instance.
evt String | Symbol The Event name.
Source:

createProxyServer(Options)

Creates the proxy server. Examples: httpProxy.createProxyServer({ .. }, 8000) // => '{ web: [Function], ws: [Function] ... }'
Parameters:
Name Type Description
Options Object Config object passed to the proxy
Source:
Returns:
Proxy Proxy object with handlers for `ws` and `web` requests
Type
Object

createRightProxy(Type)

Returns a function that creates the loader for either `ws` or `web`'s passes. Examples: httpProxy.createRightProxy('ws') // => [Function]
Parameters:
Name Type Description
Type String Either 'ws' or 'web'
Source:
Returns:
Loader Function that when called returns an iterator for the right passes
Type
function

fmtLong(ms)

Long format for `ms`.
Parameters:
Name Type Description
ms Number
Source:
Returns:
Type
String

fmtShort(ms)

Short format for `ms`.
Parameters:
Name Type Description
ms Number
Source:
Returns:
Type
String

formatArgs()

Colorize log arguments if enabled.
Source:

formatArgs()

Adds ANSI color escape codes if enabled.
Source:

hasPort()

Check the host and see if it potentially has a port in it (keep it simple)
Source:
Returns:
Whether we have one or not
Type
Boolean

init()

Init logic for `debug` instances. Create a new `inspectOpts` object in case `useColors` is set differently for a particular `debug` instance.
Source:

load()

Load `namespaces`.
Source:
Returns:
returns the previously persisted debug modes
Type
String

load()

Load `namespaces`.
Source:
Returns:
returns the previously persisted debug modes
Type
String

localstorage()

Localstorage attempts to return the localstorage. This is necessary because safari throws when a user disables cookies/localstorage and you attempt to access it.
Source:
Returns:
Type
LocalStorage

log()

Invokes `console.log()` when available. No-op when `console.log` is not a "function".
Source:

log()

Invokes `util.format()` with the specified arguments and writes to stderr.
Source:

parse(str)

Parse the given `str` and return milliseconds.
Parameters:
Name Type Description
str String
Source:
Returns:
Type
Number

plural()

Pluralization helper.
Source:

save(namespaces)

Save `namespaces`.
Parameters:
Name Type Description
namespaces String
Source:

save(namespaces)

Save `namespaces`.
Parameters:
Name Type Description
namespaces String
Source:

setup()

This is the common logic for both the Node.js and web browser implementations of `debug()`.
Source:

<private> unhandledRejection(args)

Handler for an unhandledRejection or uncaughtException, to prevent the bot from silently crashing without an error.
Parameters:
Name Type Argument Description
args * <repeatable>
All information to log.
Source:
Listens to Events:
  • Process#event:unhandledRejection
  • Process#event:uncaughtException

useColors()

Currently only WebKit-based Web Inspectors, Firefox >= v31, and the Firebug extension (any Firefox version) are known to support "%c" CSS customizations. TODO: add a `localStorage` variable to explicitly enable/disable colors
Source:

useColors()

Is stdout a TTY? Colored output is enabled when `true`.
Source:

Type Definitions


commandHandler(msg)

The function to call when a command is triggered.
Parameters:
Name Type Description
msg Discord~Message The message sent in Discord.
Source:

HGStatGroupUserSelectOptions

Options for fetching a group of user stats.
Type:
  • object
Properties:
Name Type Argument Default Description
sort string <optional>
'wins' Column to sort data by.
ascending boolean <optional>
false Sort ascending or descending order.
limit number <optional>
10 Limit the number of fetched users.
offset number <optional>
0 Offset start index of found users.
Source:

HGStatMetadata

Metadata to store along with a HungryGames~StatGroup object. These values are user-defined and are not necessarily correct and are not trustworthy for any processing.
Type:
  • object
Properties:
Name Type Argument Description
name string <optional>
The user-defined name of this stats object.
startTime Date <optional>
The timestamp at which this stats object starts to include information.
endTime Date <optional>
The timestamp of the last time this object includes information for.
createDate Date The timestamp at which this stats object was created.
modifiedDate Date The timestamp at which this stats object was last modified.
Source:

LoginState

The current OAuth2 access information for a single session.
Properties:
Name Type Argument Description
access_token string The current token for api requests.
token_type string The type of token (Usually 'Bearer').
expires_in number Number of seconds after the token is authorized at which it becomes invalid.
refresh_token string Token used to refresh the expired access_token.
scope string The scopes that the access_token has access to.
expires_at number The unix timestamp when the access_token expires.
expiration_date number The unix timestamp when we consider the session to have expired, and the session is deleted.
session string The 64 byte base64 string that identifies this session to the client.
refreshTimeout Timeout <nullable>
The current timeout registered for refreshing the access_token.
Source: