Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function(resolve, reject) {
var filesArray = [];
const files1 = FileHound.create()
.depth(0)
.paths(xx)
.match('myOutput*')
.find();
const files2 = FileHound.create()
.depth(0)
.paths(xx)
.match('output*')
.find();
const files = FileHound.any(files1, files2)
.then((file) => {
Object.keys(file).map((i) => {
let file_here = file[i];
var number = file_here.substring(
file_here.lastIndexOf("/") + 1,
file_here.lastIndexOf(".")
);
var name = number.substring(0, 8);
if (name === "myOutput") {
number = number.substring(8);
// console.log(number);
filesArray.push({ in: file_here,
out: "",
number: number
});
}