Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function BatMux (options) {
EventEmitter.call(this);
if (!options) {
options = {};
} else if (options.constructor===String) {
options = {server_url: options};
}
this.options = options;
if ('server_url' in options) { options.connect = options.server_url; }
this.trunk = new BatStream();
this.branches = {};
this.data = [];
this.chop = '';
this.url_r = '';
this.active_tag_w = '';
this.end = false;
this.accept_count = 0;
this.trunk.pair.on('data', this.onTrunkDataIn.bind(this));
function Client() {
EventEmitter.call(this);
this.debug = false;
this.socket = dgram.createSocket('udp4');
this.isSocketBound = false;
this.devices = {};
this.port = null;
this.messageQueues = {};
this.sendTimers = {};
this.discoveryTimer = null;
this.discoveryPacketSequence = 0;
this.messageHandlers = [{
type: 'stateService',
callback: this.processDiscoveryPacket.bind(this)
}, {
type: 'stateLabel',
callback: this.processLabelPacket.bind(this)
function BaseAPIClient(token, opts) {
var clientOpts = opts || {};
EventEmitter.call(this);
/**
* @type {string}
* @private
*/
this._token = token;
/** @type {string} */
this.slackAPIUrl = clientOpts.slackAPIUrl || 'https://slack.com/api/';
/**
* The logger function attached to this client.
* @type {BaseAPIClient~logFn}
*/
this.logger = clientOpts.logger || globalHelpers.getLogger(clientOpts.logLevel);
function Leaderboard (plugin, data)
{
EventEmitter.call(this);
/**
* A reference to the Facebook Instant Games Plugin.
*
* @name Phaser.FacebookInstantGamesLeaderboard#plugin
* @type {Phaser.FacebookInstantGamesPlugin}
* @since 3.13.0
*/
this.plugin = plugin;
/**
* An Instant Game leaderboard instance.
*
* @name Phaser.FacebookInstantGamesLeaderboard#ref
* @type {any}
* @since 3.13.0
constructor(id) {
super();
EventEmitter.call(this);
this.id = id;
this.stream = null;
this.preview = null;
this.ieof = false;
this.done = false;
}
function Structure (options) {
var self = this;
options = options || {};
if (!(this instanceof Structure)) {
return new Structure(options);
}
EventEmitter.call(this, arguments);
this.key = options.key || utils.generateRandomKey();
this._queuedChange = false;
this.current = options.data;
if (!isImmutableStructure(this.current) || !this.current) {
this.current = Immutable.fromJS(this.current || {});
}
if (!!options.history) {
this.history = Immutable.List.of(this.current);
this._currentRevision = 0;
this._historyLimit = (typeof options.historyLimit === 'number') ?
options.historyLimit :
Infinity;
}
function ScaleManager (game)
{
EventEmitter.call(this);
/**
* A reference to the Phaser.Game instance.
*
* @name Phaser.Scale.ScaleManager#game
* @type {Phaser.Game}
* @readonly
* @since 3.15.0
*/
this.game = game;
/**
* A reference to the HTML Canvas Element that Phaser uses to render the game.
*
* @name Phaser.Scale.ScaleManager#canvas
* @type {HTMLCanvasElement}
function Gamepad (manager, pad)
{
EventEmitter.call(this);
/**
* A reference to the Gamepad Plugin.
*
* @name Phaser.Input.Gamepad.Gamepad#manager
* @type {Phaser.Input.Gamepad.GamepadPlugin}
* @since 3.0.0
*/
this.manager = manager;
/**
* A reference to the native Gamepad object that is connected to the browser.
*
* @name Phaser.Input.Gamepad.Gamepad#pad
* @type {any}
* @since 3.10.0
function Animation (manager, key, config)
{
EventEmitter.call(this);
/**
* A reference to the global Animation Manager.
*
* @name Phaser.Animations.Animation#manager
* @type {Phaser.Animations.AnimationManager}
* @since 3.0.0
*/
this.manager = manager;
/**
* The unique identifying string for this animation.
*
* @name Phaser.Animations.Animation#key
* @type {string}
* @since 3.0.0
function ResizeManager(renderer, options) {
EventEmitter.call(this);
options = options || {};
/**
* The renderer this interaction manager works for.
*
* @type PIXI.SystemRenderer
*/
this.renderer = renderer;
/**
* Should default browser actions automatically be prevented.
*
* @type bool
* @default true
*/