all files / dist/definitions/class/ ClassConstructorParameterDefinition.js

79.17% Statements 19/24
77.78% Branches 7/9
57.14% Functions 4/7
76.19% Lines 16/21
2 branches Ignored     
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 27 28 29 30 31 32 33 34 35 36 37 38    11×                                        
"use strict";
var __extends = (this && this.__extends)/* istanbul ignore next */ || function (d, b) {
    for (var p in b) Eif (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var factories_1 = require("./../../factories");
var utils_1 = require("./../../utils");
var base_1 = require("./../base");
var ClassConstructorParameterScope_1 = require("./ClassConstructorParameterScope");
var ClassConstructorParameterDefinition = (function (_super) {
    __extends(ClassConstructorParameterDefinition, _super);
    function ClassConstructorParameterDefinition() {
        _super.apply(this, arguments);
    }
    ClassConstructorParameterDefinition.prototype.toClassProperty = function () {
        var factory = new factories_1.StructureFactory();
        var def = factory.getClassProperty({
            name: this.name,
            scope: ClassConstructorParameterScope_1.ClassConstructorParameterScope.toScope(this.scope),
            type: this.type.text,
            isOptional: this.isOptional,
            isReadonly: this.isReadonly,
            defaultExpression: this.defaultExpression != null ? this.defaultExpression.text : undefined,
            decorators: this.decorators.map(function (decorator) { return ({
                name: decorator.name,
                arguments: decorator.arguments.map(function (arg) { return arg.text; })
            }); })
        });
        return def;
    };
    return ClassConstructorParameterDefinition;
}(base_1.BaseParameterDefinition));
exports.ClassConstructorParameterDefinition = ClassConstructorParameterDefinition;
utils_1.applyMixins(ClassConstructorParameterDefinition, base_1.BaseParameterDefinition, [base_1.DecoratableDefinition, base_1.ReadonlyableDefinition]);
 
//# sourceMappingURL=ClassConstructorParameterDefinition.js.map