How to use the node-opcua-nodeid.NodeId.coerce function in node-opcua-nodeid

To help you get started, we’ve selected a few node-opcua-nodeid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-address-space / src / namespace.js View on Github external
function _adjust_options(self, options) {
    const ns = self.addressSpace.getNamespaceIndex(self.namespaceUri);
    if (!options.nodeId) {
        const id = self._getNextAvailableId();
        options.nodeId = new NodeId(NodeId.NodeIdType.NUMERIC, id, ns);
    }
    options.nodeId = NodeId.coerce(options.nodeId);
    if (typeof options.browseName === "string") {
        options.browseName = new QualifiedName({
            name: options.browseName,
            namespaceIndex: ns
        });
    }
    return options;
}