Can you change this to just be an if statement and get rid of the noop:

    if (isMap) {
      fs.writeFile(...);
    } else {
      fs.writeFile(...);
    }