src/mongo/shell/replsettest.js
/**
     * Wrap a function so it can accept a node id or connection as its first argument. The argument
     * is converted to a connection.
     */
Wrap a function so it can accept a node id or connection as its first argument. The argument
is converted to a connection.
Wrap a function so it can accept a node id or connection as its first argument . The argument is converted to a connection .
function _nodeParamToConn(wrapped) {
        return function(node, ...wrappedArgs) {
            if (node.getDB) {
                return wrapped.call(this, node, ...wrappedArgs);
            }
            assert(self.nodes.hasOwnProperty(node), `${node} not found in self.nodes`);
            return wrapped.call(this, self.nodes[node], ...wrappedArgs);
        };
    }
function _nodeParamToConn ( wrapped ) { return function ( node , ... wrappedArgs ) { if ( node . getDB ) { return wrapped . call ( this , node , ... wrappedArgs ) ; } assert ( self . nodes . hasOwnProperty ( node ) , ` ${ node } ` ) ; return wrapped . call ( this , self . nodes [ node ] , ... wrappedArgs ) ; } ; }
Wrap a function so it can accept a node id or connection as its first argument.
Wrap a function so it can accept a node id or connection as its first argument .