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 || {};
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");
}
const addressSpace = engine.addressSpace;
const endTime = new Date();
debugLog("Loading ", options.nodeset_filename, " done : ",
endTime.getTime() - startTime.getTime(), " ms");
engine.setServerState(ServerState.Running);
function bindVariableIfPresent(nodeId: NodeId, opts: any) {
assert(nodeId instanceof NodeId);
assert(!nodeId.isEmpty());
const obj = addressSpace.findNode(nodeId);
async function parse_xml(nodeset_files) {
const addressSpace = new address_space.AddressSpace();
await address_space.generateAddressSpace(addressSpace, nodeset_files);
const pseudoSession = new PseudoSession(addressSpace);
await parse_opcua_common(pseudoSession);
}