Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
pluginSpecs: function(callback){
exports.getPluginTests(callback);
}
},
function(err, results){
var files = results.coreSpecs; // push the core specs to a file object
files = files.concat(results.pluginSpecs); // add the plugin Specs to the core specs
console.debug("Sent browser the following test specs:", files.sort());
res.send("var specs_list = " + JSON.stringify(files.sort()) + ";\n");
});
});
// path.join seems to normalize by default, but we'll just be explicit
var rootTestFolder = path.normalize(path.join(npm.root, "../tests/frontend/"));
var url2FilePath = function(url){
var subPath = url.substr("/tests/frontend".length);
if (subPath == ""){
subPath = "index.html"
}
subPath = subPath.split("?")[0];
var filePath = path.normalize(path.join(rootTestFolder, subPath));
// make sure we jail the paths to the test folder, otherwise serve index
if (filePath.indexOf(rootTestFolder) !== 0) {
filePath = path.join(rootTestFolder, "index.html");
}
return filePath;
}
file = path.resolve(dir, file);
stat = fs.lstatSync(file);
if (stat.isDirectory() || stat.isSymbolicLink()) return;
var ext = path.extname(file)
, locale = path.basename(file, ext).toLowerCase();
if ((ext == '.json') && languages.isValid(locale)) {
if(!locales2paths[locale]) locales2paths[locale] = [];
locales2paths[locale].push(file);
}
});
}
//add core supported languages first
extractLangs(npm.root+"/ep_etherpad-lite/locales");
//add plugins languages (if any)
for(var pluginName in plugins) extractLangs(path.join(npm.root, pluginName, 'locales'));
// Build a locale index (merge all locale data)
var locales = {}
_.each (locales2paths, function(files, langcode) {
locales[langcode]={};
files.forEach(function(file) {
var fileContents = JSON.parse(fs.readFileSync(file,'utf8'));
_.extend(locales[langcode], fileContents);
});
});
return locales;
var ext = path.extname(file)
, locale = path.basename(file, ext).toLowerCase();
if ((ext == '.json') && languages.isValid(locale)) {
if(!locales2paths[locale]) locales2paths[locale] = [];
locales2paths[locale].push(file);
}
});
}
//add core supported languages first
extractLangs(npm.root+"/ep_etherpad-lite/locales");
//add plugins languages (if any)
for(var pluginName in plugins) extractLangs(path.join(npm.root, pluginName, 'locales'));
// Build a locale index (merge all locale data)
var locales = {}
_.each (locales2paths, function(files, langcode) {
locales[langcode]={};
files.forEach(function(file) {
var fileContents = JSON.parse(fs.readFileSync(file,'utf8'));
_.extend(locales[langcode], fileContents);
});
});
return locales;
}
npm.load(config, function (err) {
if (err) {
return setImmediate(cb, err);
}
npm.root = path.join(dappPath, "node_modules");
npm.prefix = dappPath;
npm.commands.install(function (err, data) {
if (err) {
setImmediate(cb, err);
} else {
return setImmediate(cb, null);
}
});
});
}
npm.load(config, function (err) {
if (err) {
return setImmediate(cb, err);
}
npm.root = path.join(dappPath, 'node_modules');
npm.prefix = dappPath;
npm.commands.install(function (err, data) {
return setImmediate(cb, null);
});
});
};
npm.load(config, (err) => {
if (err) {
return setImmediate(cb, err);
}
npm.root = path.join(dappPath, 'node_modules');
npm.prefix = dappPath;
npm.commands.install(() => setImmediate(cb, null));
});
};
npm.load(config, function (err) {
if (err) {
return setImmediate(cb, err);
}
npm.root = path.join(dappPath, 'node_modules');
npm.prefix = dappPath;
npm.commands.install(function (err, data) {
return setImmediate(cb, null);
});
});
};