removeExtraYAML(metadata, body, fields = TEMPLATE_FIELDS) {
        const md = Object.assign({}, metadata);
        fields.forEach(f => delete md[f]);
        let yamlBlock = "---\n";
        for (const k in md) {
            const v = md[k];
            if (typeof v === 'string')
                yamlBlock += `${k}: ${this.quoteYAML(v)}\n`;
            else if (v instanceof Array) {
                yamlBlock += `${k}:\n`;
                v.forEach((x) => yamlBlock += `- ${this.quoteYAML(x)}\n`);
            }
            else {
                console.log("Unknown data", [k, v]);
            }
        }
        yamlBlock += "---\n";
        return yamlBlock + body;
    }
/*
     * Strips out any of the YAML tags given in TEMPLATE_FIELDs from the template, and
     * sticks it back together. Unfortuantely, doesn't guarantee order of fields,
     * and the status of quotes is a bit wobbly
     */
Strips out any of the YAML tags given in TEMPLATE_FIELDs from the template, and
sticks it back together. Unfortuantely, doesn't guarantee order of fields,
and the status of quotes is a bit wobbly
Strips out any of the YAML tags given in TEMPLATE_FIELDs from the template and sticks it back together . Unfortuantely doesn ' t guarantee order of fields and the status of quotes is a bit wobbly
removeExtraYAML(metadata, body, fields = TEMPLATE_FIELDS) {
        const md = Object.assign({}, metadata);
        fields.forEach(f => delete md[f]);
        let yamlBlock = "---\n";
        for (const k in md) {
            const v = md[k];
            if (typeof v === 'string')
                yamlBlock += `${k}: ${this.quoteYAML(v)}\n`;
            else if (v instanceof Array) {
                yamlBlock += `${k}:\n`;
                v.forEach((x) => yamlBlock += `- ${this.quoteYAML(x)}\n`);
            }
            else {
                console.log("Unknown data", [k, v]);
            }
        }
        yamlBlock += "---\n";
        return yamlBlock + body;
    }
removeExtraYAML ( metadata , body , fields = TEMPLATE_FIELDS ) { const md = Object . assign ( { } , metadata ) ; fields . forEach ( f => delete md [ f ] ) ; let yamlBlock = "---\n" ; for ( const k in md ) { const v = md [ k ] ; if ( typeof v === 'string' ) yamlBlock += ` ${ k } ${ this . quoteYAML ( v ) } \n ` ; else if ( v instanceof Array ) { yamlBlock += ` ${ k } \n ` ; v . forEach ( ( x ) => yamlBlock += ` ${ this . quoteYAML ( x ) } \n ` ) ; } else { console . log ( "Unknown data" , [ k , v ] ) ; } } yamlBlock += "---\n" ; return yamlBlock + body ; }
Strips out any of the YAML tags given in TEMPLATE_FIELDs from the template, and
 sticks it back together.
Strips out any of the YAML tags given in TEMPLATE_FIELDs from the template and sticks it back together .