Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
let items = [];
let i = 0;
require('klaw')(dir, options)
.on('data', item => {
if (i > 0) {
items.push(item.path);
}
i++;
})
.on('end', () => resolve(items))
.on('error', (err, item) => reject(err, item));
});
};
return new Promise((resolve, reject) => {
let items = [];
let i = 0;
require('klaw')(dir, opt)
.on('data', item => {
if (i > 0) {
items.push(item.path);
}
i++;
})
.on('end', () => resolve(items))
.on('error', (err, item) => reject(err, item));
});
};