feat(bulk-upload): add bulkTitleFromFilename utility
Converts a raw filename into a human-readable title candidate by stripping the extension and replacing underscore/hyphen runs with spaces. Reuses the existing stripExtension() helper. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -81,3 +81,7 @@ export function parseFilename(filename: string): FilenameParseResult {
|
||||
export function stripExtension(filename: string): string {
|
||||
return filename.replace(/\.[^/.]+$/, '');
|
||||
}
|
||||
|
||||
export function bulkTitleFromFilename(filename: string): string {
|
||||
return stripExtension(filename).replace(/[_-]+/g, ' ').trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user