function evaluateFile(file) {
  var hsStart = 'require("heatshrink").decompress(atob("';
  var hsEnd = '"))';
  if (file.content.startsWith(hsStart) && file.content.endsWith(hsEnd)) {
    var heatshrink = require(ROOTDIR+"/core/lib/heatshrink.js");
    var b64 = file.content.slice(hsStart.length, -hsEnd.length);
    var decompressed = heatshrink.decompress(atob(b64));
    file.content = "";
    for (var i=0;i<decompressed.length;i++)
      file.content += String.fromCharCode(decompressed[i]);
    return;
  }
  // if JSON just pass through. We could try and minify.
  if (file.name.endsWith(".json")) {
    return;
  }
  // else... uh-oh
  console.log(file);
  throw new Error("Unable to evaluate "+file.name);
}
// If file should be evaluated, try and do it...
If file should be evaluated, try and do it
If file should be evaluated try and do it
function evaluateFile(file) {
  var hsStart = 'require("heatshrink").decompress(atob("';
  var hsEnd = '"))';
  if (file.content.startsWith(hsStart) && file.content.endsWith(hsEnd)) {
    var heatshrink = require(ROOTDIR+"/core/lib/heatshrink.js");
    var b64 = file.content.slice(hsStart.length, -hsEnd.length);
    var decompressed = heatshrink.decompress(atob(b64));
    file.content = "";
    for (var i=0;i<decompressed.length;i++)
      file.content += String.fromCharCode(decompressed[i]);
    return;
  }
  if (file.name.endsWith(".json")) {
    return;
  }
  console.log(file);
  throw new Error("Unable to evaluate "+file.name);
}
function evaluateFile ( file ) { var hsStart = 'require("heatshrink").decompress(atob("' ; var hsEnd = '"))' ; if ( file . content . startsWith ( hsStart ) && file . content . endsWith ( hsEnd ) ) { var heatshrink = require ( ROOTDIR + "/core/lib/heatshrink.js" ) ; var b64 = file . content . slice ( hsStart . length , - hsEnd . length ) ; var decompressed = heatshrink . decompress ( atob ( b64 ) ) ; file . content = "" ; for ( var i = 0 ; i < decompressed . length ; i ++ ) file . content += String . fromCharCode ( decompressed [ i ] ) ; return ; } if ( file . name . endsWith ( ".json" ) ) { return ; } console . log ( file ) ; throw new Error ( "Unable to evaluate " + file . name ) ; }
If file should be evaluated, try and do it...
If file should be evaluated try and do it ...
// if JSON just pass through. We could try and minify. // else... uh-oh