Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function mapToDependencies(dependencies, moduleName, callback) {
if (isFile.test(moduleName)) {
// the JSON DSL has the option to have "/foo" or ["/foo"]
// in .
after.map(dependencies, createConvertToProxyNameIterator({
moduleName: moduleName,
uri: options.uri
}), callback)
}
}
}
map: function (options, callback) {
options = extend({}, DEPENDENCY_WRITE_DEFAULTS, options)
var json = require(options.jsonUri)
// the JSON DSL has the option to have "/foo" in
after.reduce(json, createFoldersIntoFilesIterator(options.uri),
{}, runDependencyMapper)
function runDependencyMapper(err, data) {
if (err) {
return callback(err)
}
after.map(data, mapToDependencies, callback)
}
function mapToDependencies(dependencies, moduleName, callback) {
if (isFile.test(moduleName)) {
// the JSON DSL has the option to have "/foo" or ["/foo"]
// in .
after.map(dependencies, createConvertToProxyNameIterator({
moduleName: moduleName,
uri: options.uri
Collection.after.insert(function () {
updates['after.insert'] = true;
});
Collection.before.update(function () {
Collection.after.remove(function () {
updates['after.remove'] = true;
});
Collection.after.update(function () {
updates['after.update'] = true;
});
Collection.before.remove(function () {
http.createServer(function (req, res) {
var features = JSON.parse(url.parse(req.url, true).query.features)
var files = Object.keys(features).map(function (name) {
var p = path.join.apply(path, name.split("."))
p = path.join(".", "lib", p + ".js")
return p
})
after.map(files, function (fileName, done) {
path.exists(fileName, function (exists) {
if (exists) {
return done(null, fileName)
} else {
console.log("it does not exist", fileName)
}
done()
})
}, function (err, files) {
var src = files
.filter(function (it) {
return it !== undefined
})
.map(function (it) {
return "require('./" + it + "')"
})
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) {
function runDependencyMapper(err, data) {
if (err) {
return callback(err)
}
after.map(data, mapToDependencies, callback)
}
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) {
const buildIssueBody = (bodyOutputs = [], config) => {
const bodyStrings = []
const { output = {} } = config || {}
const beforeMD = output['before.md'] || ''
const afterMD = output['after.md'] || '\n\n'
if (beforeMD) bodyStrings.push(beforeMD)
bodyOutputs.forEach(({ label, value }) => {
if (value) {
bodyStrings.push(`${label || ''}${value}`)
} else if (label && !value && !output.hideEmpty) {
bodyStrings.push(`${label}`)
}
})
if (afterMD) bodyStrings.push(afterMD)
return bodyStrings.join('\n\n')
}