You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
558 B
17 lines
558 B
var path = require("path");
|
|
|
|
module.exports = function(filename, projectPath, folderPath) {
|
|
var namespace = "Unknown";
|
|
if (projectPath) {
|
|
namespace = path.basename(projectPath, path.extname(projectPath));
|
|
if (folderPath) {
|
|
namespace += "." + folderPath.replace(path.dirname(projectPath), "").substring(1).replace(/[\\\/]/g, ".");
|
|
}
|
|
namespace = namespace.replace(/[\\\-]/g, "_");
|
|
}
|
|
|
|
return {
|
|
namespace: namespace,
|
|
name: path.basename(filename, path.extname(filename))
|
|
}
|
|
};
|