Created
August 24, 2021 19:19
-
-
Save ValentaTomas/8b081c08f34abbe0e889d70cca4e0648 to your computer and use it in GitHub Desktop.
Get the file extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getFileExtension(file: string) { | |
return file.slice((Math.max(0, file.lastIndexOf('.')) || Infinity) + 1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment