src/util.js
function readDir (dir, regex = /^(?:)$/) {
  return new Promise((resolve, reject) =>
    fs.readdir(dir, (err, files) => err
      ? reject(err)
      : resolve(Promise.all(files.map(checkFileName.bind(null, dir, regex))))))
    .then(values =>
      [].concat(...values)
        .filter(i => i))
}
function readDir (dir, regex = /^(?:)$/) {
  return new Promise((resolve, reject) =>
    fs.readdir(dir, (err, files) => err
      ? reject(err)
      : resolve(Promise.all(files.map(checkFileName.bind(null, dir, regex))))))
    .then(values =>
      [].concat(...values)
        .filter(i => i))
}
function readDir ( dir , regex = / ^(?:)$ / ) { return new Promise ( ( resolve , reject ) => fs . readdir ( dir , ( err , files ) => err ? reject ( err ) : resolve ( Promise . all ( files . map ( checkFileName . bind ( null , dir , regex ) ) ) ) ) ) . then ( values => [ ] . concat ( ... values ) . filter ( i => i ) ) }
regex defaults to empty
regex defaults to empty