tslint is currently throwing the following error
Shadowed name: 'err'
Here is the code
fs.readdir(fileUrl, (err, files) => {
fs.readFile(path.join(fileUrl, files[0]), function (err, data) {
if (!err) {
res.send(data);
}
});
});
Anybody have a clue on what the best way would be to solve this and what the error even means?
err
; you're using the same name for the error in two nested callbacks, so the outer error is inaccessible in the inner callback body. As to how to solve it: use a different name for one of them. – Maddeu