All files / mesos-framework/lib builder.js

85.71% Statements 6/7
50% Branches 1/2
100% Functions 1/1
85.71% Lines 6/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25    1x 1x     1x                 880x     880x         1x  
"use strict";
 
var path = require("path");
var protoBuf = require("protobufjs");
 
// Load Mesos protobuf definitions
var builder = protoBuf.loadProtoFile(path.join(__dirname, "../", "proto/all.proto"));
 
/**
 * Represents a variable builder for protobuf to JavaScript instantiations.
 * @constructor
 * @param {string} messageType - The message type as string, e.g. `mesos.HealthCheck`.
 */
function Builder (messageType) {
 
    Iif (!(this instanceof Builder)) {
        return new Builder(messageType);
    } else {
        return new (builder.build(messageType))();
    }
 
}
 
module.exports = Builder;