mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor: 🚨 Make class methods that don't use this static
This commit is contained in:
parent
53688095cc
commit
835cdc3f18
7 changed files with 47 additions and 40 deletions
|
|
@ -104,10 +104,9 @@ export class ImageConversionPreprocessor implements MediaPreprocessor {
|
|||
fileName: string,
|
||||
newExtension: string,
|
||||
): string {
|
||||
return this.extractFilenameFromPath(fileName).replace(
|
||||
/\.[^/.]+$/,
|
||||
`.${newExtension}`,
|
||||
);
|
||||
return ImageConversionPreprocessor.extractFilenameFromPath(
|
||||
fileName,
|
||||
).replace(/\.[^/.]+$/, `.${newExtension}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -115,7 +114,7 @@ export class ImageConversionPreprocessor implements MediaPreprocessor {
|
|||
* @param path - The path to extract the filename from.
|
||||
* @returns The extracted filename.
|
||||
*/
|
||||
private extractFilenameFromPath(path: string): string {
|
||||
private static extractFilenameFromPath(path: string): string {
|
||||
const pathParts = path.split(/(?<!\\)\//);
|
||||
return pathParts[pathParts.length - 1];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue