jest-allure2-reporter
Version:
Idiomatic Jest reporter for Allure Framework
11 lines (7 loc) • 313 B
text/typescript
import path from 'node:path';
export function getFullExtension(filePath: string) {
if (!filePath || filePath === '.' || filePath === '..') return '';
const fileName = path.basename(filePath);
const lastDotIndex = fileName.indexOf('.');
return lastDotIndex === -1 ? '' : fileName.slice(lastDotIndex);
}