Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// reincorporate monitoredItemId and itemToMonitor into the requestedParameters
const options = requestedParameters as any as MonitoredItemOptions;
options.monitoredItemId = monitoredItemId;
options.itemToMonitor = itemToMonitor;
const monitoredItem = new MonitoredItem(options);
monitoredItem.timestampsToReturn = timestampsToReturn;
monitoredItem.$subscription = this;
assert(monitoredItem.monitoredItemId === monitoredItemId);
this.monitoredItems[monitoredItemId] = monitoredItem;
const filterResult = _process_filter(node, requestedParameters.filter);
const monitoredItemCreateResult = new MonitoredItemCreateResult({
filterResult,
monitoredItemId,
revisedQueueSize: monitoredItem.queueSize,
revisedSamplingInterval: monitoredItem.samplingInterval,
statusCode: StatusCodes.Good
});
return monitoredItemCreateResult;
}
function handle_error(statusCode: StatusCode): MonitoredItemCreateResult {
return new MonitoredItemCreateResult({ statusCode });
}