lib/generator.js
function(type) {

    if(!type || !data[type]) {
      type = random(data);
    }

    var templates = data[type].templates;
    var template = random(templates);
    var compiled = Handlebars.compile(template);
    var rendered = compiled(data);

    // get rid of multiple, leading and trailing spaces
    rendered = rendered.replace(/ +(?= )/g,'').trim();

    return capitaliseFirstLetter( rendered );
  }
function(type) {

    if(!type || !data[type]) {
      type = random(data);
    }

    var templates = data[type].templates;
    var template = random(templates);
    var compiled = Handlebars.compile(template);
    var rendered = compiled(data);

    // get rid of multiple, leading and trailing spaces
    rendered = rendered.replace(/ +(?= )/g,'').trim();

    return capitaliseFirstLetter( rendered );
  }
function ( type ) { if ( ! type || ! data [ type ] ) { type = random ( data ) ; } var templates = data [ type ] . templates ; var template = random ( templates ) ; var compiled = Handlebars . compile ( template ) ; var rendered = compiled ( data ) ; // get rid of multiple, leading and trailing spaces rendered = rendered . replace ( /  +(?= ) / g , '' ) . trim ( ) ; return capitaliseFirstLetter ( rendered ) ; }
generate a random game idea
generate a random game idea