From 52a4d874eada5be121e15d73d1d10e9a8d84bdb8 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 14 Mar 2021 18:04:19 -0400 Subject: Make MediaUtil a static class (#1525) --- ext/js/media/media-util.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/js/media') diff --git a/ext/js/media/media-util.js b/ext/js/media/media-util.js index 25bcdd18..11172c5c 100644 --- a/ext/js/media/media-util.js +++ b/ext/js/media/media-util.js @@ -26,7 +26,7 @@ class MediaUtil { * @returns The file extension, including the '.', or an empty string * if there is no file extension. */ - getFileNameExtension(path) { + static getFileNameExtension(path) { const match = /\.[^./\\]*$/.exec(path); return match !== null ? match[0] : ''; } @@ -37,7 +37,7 @@ class MediaUtil { * @returns The media type string if it can be determined from the file path, * otherwise null. */ - getImageMediaTypeFromFileName(path) { + static getImageMediaTypeFromFileName(path) { switch (this.getFileNameExtension(path).toLowerCase()) { case '.apng': return 'image/apng'; @@ -74,7 +74,7 @@ class MediaUtil { * @returns A file extension including the dot for the media type, * otherwise null. */ - getFileExtensionFromImageMediaType(mediaType) { + static getFileExtensionFromImageMediaType(mediaType) { switch (mediaType) { case 'image/apng': return '.apng'; @@ -105,7 +105,7 @@ class MediaUtil { * @returns A file extension including the dot for the media type, * otherwise null. */ - getFileExtensionFromAudioMediaType(mediaType) { + static getFileExtensionFromAudioMediaType(mediaType) { switch (mediaType) { case 'audio/mpeg': case 'audio/mp3': -- cgit v1.2.3