import './chunk-NYLAFCGV.mjs';
import fs from 'fs';
import path from 'path';

function emptyDir(dir, skip) {
  for (const file of fs.readdirSync(dir)) {
    if (skip?.includes(file)) {
      continue;
    }
    const abs = path.resolve(dir, file);
    if (fs.lstatSync(abs).isDirectory()) {
      emptyDir(abs);
      fs.rmdirSync(abs);
    } else {
      fs.unlinkSync(abs);
    }
  }
}

export { emptyDir };
