function performRandomInsertion(resBody,reqBody,query,path){

    //Instantiate chance with hash based on given req values
    var myChance = new chance(objectHash(reqBody)+objectHash(query)+objectHash(path));

    //Find our tags
    var split = resBody.split(/({{random:[A-Za-z:,0-9]+}})/);
    var retBody = "";

    //Go through each split part of body, parse tags, and reassemble
    split.forEach(function(str){
        if(str.startsWith("{{random:")){
           retBody += getRandomStringFromTag(str,myChance);
        }else{
            retBody += str;
        }
    });

    return retBody;
}
/**
 * Takes in a body string + set of req params. Uses req params to generate a seed hash, and replaces template tags with random responses based on that seed.
 * @param {string} resBody The response body 
 * @param {*} reqBody Request body (in any form)
 * @param {*} query Query array from req
 * @param {*} path Path from req
 */
Takes in a body string + set of req params. Uses req params to generate a seed hash, and replaces template tags with random responses based on that seed.
@param {string} resBody The response body
@param {*} reqBody Request body (in any form)
@param {*} query Query array from req
@param {*} path Path from req
Takes in a body string + set of req params . Uses req params to generate a seed hash and replaces template tags with random responses based on that seed . @param { string } resBody The response body @param { * } reqBody Request body ( in any form ) @param { * } query Query array from req @param { * } path Path from req
function performRandomInsertion(resBody,reqBody,query,path){
    var myChance = new chance(objectHash(reqBody)+objectHash(query)+objectHash(path));
    var split = resBody.split(/({{random:[A-Za-z:,0-9]+}})/);
    var retBody = "";
    split.forEach(function(str){
        if(str.startsWith("{{random:")){
           retBody += getRandomStringFromTag(str,myChance);
        }else{
            retBody += str;
        }
    });
    return retBody;
}
function performRandomInsertion ( resBody , reqBody , query , path ) { var myChance = new chance ( objectHash ( reqBody ) + objectHash ( query ) + objectHash ( path ) ) ; var split = resBody . split ( / ({{random:[A-Za-z:,0-9]+}}) / ) ; var retBody = "" ; split . forEach ( function ( str ) { if ( str . startsWith ( "{{random:" ) ) { retBody += getRandomStringFromTag ( str , myChance ) ; } else { retBody += str ; } } ) ; return retBody ; }
Takes in a body string + set of req params.
Takes in a body string + set of req params .
//Instantiate chance with hash based on given req values //Find our tags //Go through each split part of body, parse tags, and reassemble