Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
optionallyReadFolder: function optionallyReadFolder(err, stats) {
if (err) {
return this.callback(err)
}
if (stats.isFile()) {
this.relative = makeRelative.call(this)
this.emitter.emit("dependencySet", this.relative, this.uri)
after.forEach(this.depObject, this.injectDependency,
this, this.callback)
} else if (stats.isDirectory()) {
fs.readdir(this.uri, this.writeFileDependencies)
}
},
writeFileDependencies: function readFiles(err, files) {
writeFileDependencies: function readFiles(err, files) {
if (err) {
return this.callback(err)
}
after.forEach(files, writeDependency, this, this.callback)
function writeDependency(fileName, done) {
DependencyWriter({
uri: path.join(this.uri, fileName),
depObject: this.depObject,
originalUri: this.originalUri,
core: this.core,
emitter: this.emitter,
callback: done
})
}
},
injectDependency: function injectDependency(pattern, name, callback) {