How to use the node-opcua-client.assert function in node-opcua-client

To help you get started, we’ve selected a few node-opcua-client 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 / opcua-commander / lib / widget / widget_tree.ts View on Github external
walk(node: any, depth: number) {

        if (this.itemCount) {
            this._old_selectedNode = this.getSelectedItem().node;
            assert(this._old_selectedNode);
        }
        this._index_selectedNode = -1;
        this.setItems([]);

        if (node.name && depth === 0) {
            // root node
            node.depth = 0;
            this._add(node, true, null);
        }

        function dumpChildren(this: Tree, node: any, depth: number): void {

            if (_.isFunction(node.children)) {
                return;
            }
            node.children = node.children || [];
github node-opcua / opcua-commander / lib / widget / widget_tree.ts View on Github external
function toContent(node: any, isLastChild: boolean, parent: any): any {

    if (parent) {
        const sep = (parent.isLastChild) ? " " : "│";
        node.prefix = parent.prefix + sep;
    } else {
        node.prefix = " ";
    }

    const s = (isLastChild) ? "└" : "├";

    const level = node.depth;
    assert(level >= 0 && level < 100);

    const hasChildren = node.children && node.children.length > 0;
    //    [+]
    const c = node.expanded ? (hasChildren ? chalk.green("▼ ") : chalk.blue("▼ ")) : "► ";
    const str = node.prefix + s + c + node.name;

    return str;
}
function dummy(node: any, callback: (err: Error | null, child: any) => void) {
github node-opcua / opcua-commander / lib / widget / widget_tree.ts View on Github external
populate_children.call(this, node, (err: Error | null, children: any) => {
            if (err) {
                return;
            }
            assert(_.isArray(children));
            node.children = children;
            node.expanded = true;
            this.setData(this.__data);
        });
    }