Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public initialize(
options: any,
callback: any
) {
const engine = this;
assert(!engine.addressSpace); // check that 'initialize' has not been already called
engine.status = "initializing";
options = options || {};
assert(_.isFunction(callback));
options.nodeset_filename = options.nodeset_filename || nodesets.standard_nodeset_file;
const startTime = new Date();
debugLog("Loading ", options.nodeset_filename, "...");
engine.addressSpace = AddressSpace.create();
// register namespace 1 (our namespace);
const serverNamespace = engine.addressSpace.registerNamespace(engine.serverNamespaceUrn);
assert(serverNamespace.index === 1);
generateAddressSpace(engine.addressSpace, options.nodeset_filename, () => {
if (!engine.addressSpace) {
throw new Error("Internal error");
}