MCPcopy
hub / github.com/PokemonGoF/PokemonGo-Bot / parseAuthOptions

Function parseAuthOptions

map-chat/javascript/browserMqtt.js:1097–1108  ·  view source on GitHub ↗

* Parse the auth attribute and merge username and password in the options object. * * @param {Object} [opts] option object

(opts)

Source from the content-addressed store, hash-verified

1095 * @param {Object} [opts] option object
1096 */
1097function parseAuthOptions (opts) {
1098 var matches;
1099 if (opts.auth) {
1100 matches = opts.auth.match(/^(.+):(.+)$/);
1101 if (matches) {
1102 opts.username = matches[1];
1103 opts.password = matches[2];
1104 } else {
1105 opts.username = opts.auth;
1106 }
1107 }
1108}
1109
1110/**
1111 * connect - connect to an MQTT broker.

Callers 1

connectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected