File size: 453 Bytes
ef987bb
 
 
 
1
2
3
4
5
const fs=require('fs'),path=require('path');
function walk(d){return fs.readdirSync(d,{withFileTypes:true}).filter(e=>!['tests','logs','node_modules','.git'].includes(e.name)).flatMap(e=>e.isDirectory()?walk(path.join(d,e.name)):[path.join(d,e.name)])}
if(!walk(process.cwd()).some(f=>/\.(html|svg|js|ts|tsx|jsx|md)$/i.test(f)))throw Error('missing candidate output');
console.log('candidate output present; requirements checked by runtime cases');