Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
options = options || {};
options.buildInfo = options.buildInfo || {};
EventEmitter.apply(this, arguments);
const engine = this;
ServerEngine.registry.register(engine);
engine._sessions = {};
engine._closedSessions = {};
engine._orphanPublishEngine = null; // will be constructed on demand
engine.isAuditing = _.isBoolean(options.isAuditing) ? options.isAuditing : false;
options.buildInfo.buildDate = options.buildInfo.buildDate || new Date();
// ---------------------------------------------------- ServerStatus
engine.serverStatus = new ServerStatus({
startTime: new Date(),
currentTime: new Date(),
state: ServerState.NoConfiguration,
buildInfo: options.buildInfo,
secondsTillShutdown: 0,
shutdownReason: {text: ""}
});
// --------------------------------------------------- ServerCapabilities
options.serverCapabilities = options.serverCapabilities || {};
options.serverCapabilities.serverProfileArray = options.serverCapabilities.serverProfileArray || [
"Standard UA Server Profile",
"Embedded UA Server Profile",
"Micro Embedded Device Server Profile",
"Nano Embedded Device Server Profile"