UNPKG

terraform-generator

Version:

Generate Terraform configurations with Node.js.

30 lines (29 loc) 724 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Comment = void 0; const utils_1 = require("../utils"); const _1 = require("."); /** * @category Block */ class Comment extends _1.Block { /** * Construct comment. * * @param comment comment */ constructor(comment) { super('comment', [], {}); this.comment = comment; } toTerraform() { return `${this.comment.trim().split('\n').map(line => line.trim() ? `# ${line.trim()}` : '').join('\n')}\n\n`; } asArgument() { throw utils_1.Util.inaccessibleMethod(); } attr(_name) { throw utils_1.Util.inaccessibleMethod(); } } exports.Comment = Comment;