hackernews-node/node_modules/prisma-yml/dist/utils/yamlComment.js
/**
 * Comments out the current entry of a specific key in a yaml document and creates a new value next to it
 * @param key key in yaml document to comment out
 * @param newValue new value to add in the document
 */
Comments out the current entry of a specific key in a yaml document and creates a new value next to it
@param key key in yaml document to comment out
@param newValue new value to add in the document
Comments out the current entry of a specific key in a yaml document and creates a new value next to it @param key key in yaml document to comment out @param newValue new value to add in the document
function replaceYamlValue(input, key, newValue) {
    var ast = yamlParser.safeLoad(input);
    var position = getPosition(ast, key);
    var newEntry = key + ": " + newValue + "\n";
    if (!position) {
        return input + '\n' + newEntry;
    }
    return (input.slice(0, position.start) +
        '#' +
        input.slice(position.start, position.end) +
        newEntry +
        input.slice(position.end));
}
function replaceYamlValue ( input , key , newValue ) { var ast = yamlParser . safeLoad ( input ) ; var position = getPosition ( ast , key ) ; var newEntry = key + ": " + newValue + "\n" ; if ( ! position ) { return input + '\n' + newEntry ; } return ( input . slice ( 0 , position . start ) + '#' + input . slice ( position . start , position . end ) + newEntry + input . slice ( position . end ) ) ; }
Comments out the current entry of a specific key in a yaml document and creates a new value next to it
 @param key key in yaml document to comment out
 @param newValue new value to add in the document
Comments out the current entry of a specific key in a yaml document and creates a new value next to it @param key key in yaml document to comment out @param newValue new value to add in the document