a2r
Version:
A2R Framework
20 lines (19 loc) • 924 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const getProjectPath_1 = __importDefault(require("./getProjectPath"));
const settings_1 = require("./settings");
const cleanText_1 = __importDefault(require("../tools/cleanText"));
/**
* Gets clean project name (slug style) for environment variables, cookies, etc
* @param projectPath Main project (solution) path
*/
const getCleanProjectName = async (projectPath) => {
const mainProjectPath = projectPath || await (0, getProjectPath_1.default)();
const packageJson = await (0, settings_1.getPackageJson)(mainProjectPath);
const { name: projectName } = packageJson;
return (0, cleanText_1.default)(projectName, false, true, true, false, '', '-');
};
exports.default = getCleanProjectName;