all files / dist/writers/ ExpressionWriter.js

100% Statements 17/17
100% Branches 6/6
100% Functions 5/5
100% Lines 17/17
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 26  26×       13×          
"use strict";
var utils_1 = require("./../utils");
var ExpressionWriter = (function () {
    function ExpressionWriter(writer) {
        this.writer = writer;
    }
    ExpressionWriter.prototype.writeWithEqualsSign = function (def) {
        if (!this.shouldWrite(def))
            return;
        this.writer.write(" = ");
        this.write(def);
    };
    ExpressionWriter.prototype.write = function (def) {
        if (!this.shouldWrite(def))
            return;
        this.writer.write(def.text);
    };
    ExpressionWriter.prototype.shouldWrite = function (def) {
        return def != null && !utils_1.StringUtils.isNullOrWhiteSpace(def.text);
    };
    return ExpressionWriter;
}());
exports.ExpressionWriter = ExpressionWriter;
 
//# sourceMappingURL=ExpressionWriter.js.map