diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-03-14 18:04:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-14 18:04:19 -0400 |
commit | 52a4d874eada5be121e15d73d1d10e9a8d84bdb8 (patch) | |
tree | 0a8c2afe9ac507701b954c0510c3f38d14d999a0 /ext/js/media/media-util.js | |
parent | 06b02c3cf2ce725383f9a0bae87d3ef084ed8809 (diff) |
Make MediaUtil a static class (#1525)
Diffstat (limited to 'ext/js/media/media-util.js')
-rw-r--r-- | ext/js/media/media-util.js | 8 |
1 files changed, 4 insertions, 4 deletions
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': |