"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.dump = exports.parseSingleYaml = exports.parseYaml = void 0;
const js_yaml_1 = require("js-yaml");
const regex_1 = require("./regex");
function parseYaml(content, iterator, options) {
    const massagedContent = massageContent(content, options);
    return (0, js_yaml_1.loadAll)(massagedContent, iterator, options);
}
exports.parseYaml = parseYaml;
function parseSingleYaml(content, options) {
    const massagedContent = massageContent(content, options);
    return (0, js_yaml_1.load)(massagedContent, options);
}
exports.parseSingleYaml = parseSingleYaml;
function dump(obj, opts) {
    return (0, js_yaml_1.dump)(obj, opts);
}
exports.dump = dump;
function massageContent(content, options) {
    if (options?.removeTemplates) {
        return content
            .replace((0, regex_1.regEx)(/{{`.+?`}}/gs), '')
            .replace((0, regex_1.regEx)(/{{.+?}}/g), '');
    }
    return content;
}
//# sourceMappingURL=yaml.js.map