Created
February 2, 2019 18:41
-
-
Save femyeda/b0982bded3d3ec5574766982ce650ad7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//TODO: Includ path to get extension | |
export default function stripExtenstion(filename, extension) { | |
const regex = new RegExp(`.${extension}$`, 'g') | |
return filename.replace(regex, '') | |
} | |
export const stripExtenstion = stripExtenstion; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment