Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
if (obj) {
__bindVariable(engine, nodeId, opts);
}
return obj;
}
// -------------------------------------------- install default get/put handler
const server_NamespaceArray_Id = makeNodeId(VariableIds.Server_NamespaceArray); // ns=0;i=2255
bindVariableIfPresent(server_NamespaceArray_Id, {
get() {
return new Variant({
const endTime = new Date();
debugLog("Loading ", options.nodeset_filename, " done : ", endTime - startTime, " ms");
function findObjectNodeId(name) {
const obj = engine.addressSpace.findNode(name);
return obj ? obj.nodeId : null;
}
engine.FolderTypeId = findObjectNodeId("FolderType");
engine.BaseObjectTypeId = findObjectNodeId("BaseObjectType");
engine.BaseDataVariableTypeId = findObjectNodeId("BaseDataVariableType");
engine.rootFolder = engine.addressSpace.findNode("RootFolder");
assert(engine.rootFolder && engine.rootFolder.readAttribute, " must provide a root folder and expose a readAttribute method");
engine.setServerState(ServerState.Running);
function bindVariableIfPresent(nodeId, opts) {
assert(nodeId instanceof NodeId);
assert(!nodeId.isEmpty());
const obj = engine.addressSpace.findNode(nodeId);
if (obj) {
__bindVariable(engine, nodeId, opts);
}
return obj;
}
// -------------------------------------------- install default get/put handler
const server_NamespaceArray_Id = makeNodeId(VariableIds.Server_NamespaceArray); // ns=0;i=2255
bindVariableIfPresent(server_NamespaceArray_Id, {
get: function () {