link(node, position) {
        const nodeLinkup = node.linkup;
        if (nodeLinkup !== this) {
            if (nodeLinkup && nodeLinkup.linked) {
                nodeLinkup.linked.splice(nodeLinkup.linked.indexOf(node), 1);
            }
            if (!this.linked) {
                this.linked = [];
            }
            if (position) {
                this.linked.splice(position, 0, node);
            }
            else {
                this.linked.push(node);
            }
            node.linkup = this;
        }
        return this;
    }
/**
     * Links the provided Node.
     *
     * @param node - Node to be linked.
     * @param position - Position to place Node at in the linked array.
     * @returns - IsotopeNode.
     */
Links the provided Node.
@param node - Node to be linked.
@param position - Position to place Node at in the linked array.
Links the provided Node . @param node - Node to be linked . @param position - Position to place Node at in the linked array .
link(node, position) {
        const nodeLinkup = node.linkup;
        if (nodeLinkup !== this) {
            if (nodeLinkup && nodeLinkup.linked) {
                nodeLinkup.linked.splice(nodeLinkup.linked.indexOf(node), 1);
            }
            if (!this.linked) {
                this.linked = [];
            }
            if (position) {
                this.linked.splice(position, 0, node);
            }
            else {
                this.linked.push(node);
            }
            node.linkup = this;
        }
        return this;
    }
link ( node , position ) { const nodeLinkup = node . linkup ; if ( nodeLinkup !== this ) { if ( nodeLinkup && nodeLinkup . linked ) { nodeLinkup . linked . splice ( nodeLinkup . linked . indexOf ( node ) , 1 ) ; } if ( ! this . linked ) { this . linked = [ ] ; } if ( position ) { this . linked . splice ( position , 0 , node ) ; } else { this . linked . push ( node ) ; } node . linkup = this ; } return this ; }
Links the provided Node.
Links the provided Node .