All files / src/utility get-root-path.ts

87.5% Statements 7/8
50% Branches 1/2
100% Functions 1/1
87.5% Lines 7/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  4x 4x 4x   4x       4x   4x     4x  
function getRootPath(): string {
	const current_path = __dirname;
	const project_name = 'node-server';
	const index = current_path.indexOf(project_name);
 
	Iif (index === -1) {
		throw new Error(`Unable to parse process directory: ${current_path}`);
	}
 
	const prefix = current_path.slice(0, index);
 
	return `${prefix}/${project_name}`;
}
 
export default getRootPath;