preprocessors/index.js
function newfile(filepath) {
  let dir = path.dirname(filepath);
  if (path.extname(filepath) === '.shp') dir = path.resolve(dir, '..');
  const name = crypto.randomBytes(8).toString('hex');
  return path.join(dir, name);
}
function newfile(filepath) {
  let dir = path.dirname(filepath);
  if (path.extname(filepath) === '.shp') dir = path.resolve(dir, '..');
  const name = crypto.randomBytes(8).toString('hex');
  return path.join(dir, name);
}
function newfile ( filepath ) { let dir = path . dirname ( filepath ) ; if ( path . extname ( filepath ) === '.shp' ) dir = path . resolve ( dir , '..' ) ; const name = crypto . randomBytes ( 8 ) . toString ( 'hex' ) ; return path . join ( dir , name ) ; }
A function that hands out a new filepath in the same directory as the given file
A function that hands out a new filepath in the same directory as the given file