UNPKG

terraform-generator

Version:

Generate Terraform configurations with Node.js.

28 lines (27 loc) 733 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.heredoc = exports.Heredoc = void 0; const _1 = require("."); /** * @category Argument */ class Heredoc extends _1.Argument { /** * Construct heredoc argument. * * @param content string or object, object will be stringify */ constructor(content) { super(`<<EOT\n${typeof content === 'string' ? content : JSON.stringify(content, null, 2)}\nEOT\n`); } } exports.Heredoc = Heredoc; /** * Convenient function to construct new [[Heredoc]]. * * @param content string or object, object will be stringify * * @category Argument */ const heredoc = (content) => new Heredoc(content); exports.heredoc = heredoc;