<commit_before>"use strict";

var fn;

function LocalTransportServer(_fn) {
    fn = _fn;
}

LocalTransportServer.prototype.listen = function(done) {
    done();
};

LocalTransportServer.prototype.stop = function(done) {
    done();
};

function LocalTransportClient() {

}

LocalTransportClient.prototype.connect = function(done) {
    done(); //noop
};

LocalTransportClient.prototype.disconnect = function(done) {
    done(); //noop
};

LocalTransportClient.prototype.call = function(method, data, callback) {
    // force data to be passed through as valid json
    // both the input, and the response from the service
    forceJSON(data, function(err, data) {
        if(err) return callback(err);
        fn(method, data, function(err, response) {
            if(err) {
                return forceJSON(err, function(err) {
                    callback(err);
                });
            }
            forceJSON(response, function(response) {
                callback(null, response);
            });<commit_msg>fix local transport not returning responses properly<commit_after>"use strict";

var fn;

function LocalTransportServer(_fn) {
    fn = _fn;
}

LocalTransportServer.prototype.listen = function(done) {
    done();
};

LocalTransportServer.prototype.stop = function(done) {
    done();
};

function LocalTransportClient() {

}

LocalTransportClient.prototype.connect = function(done) {
    done(); //noop
};

LocalTransportClient.prototype.disconnect = function(done) {
    done(); //noop
};

LocalTransportClient.prototype.call = function(method, data, callback) {
    // force data to be passed through as valid json
    // both the input, and the response from the service
    forceJSON(data, function(err, data) {
        if(err) return callback(err);
        fn(method, data, function(err, response) {
            if(err) {
                return forceJSON(err, callback);
            }
            forceJSON(response, callback);
{'fraction_non_alphanumeric': 0.11827956989247312, 'fraction_numerical': 0.0, 'mean_word_length': 2.876984126984127, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5074523', 'n_tokens_mistral': 538, 'n_tokens_neox': 528, 'n_words': 133}