Created
August 19, 2015 15:42
-
-
Save radiovisual/1db4285ad3fa09a3ba45 to your computer and use it in GitHub Desktop.
Check a path string for a specific file type
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
/** | |
* Check a path string for a specific file type | |
* @param {String} path | |
* @param {String} extension | |
* @returns {Boolean} | |
**/ | |
function isFileType(path, extension){ | |
console.log("checking %s %s", path, extension); | |
return new RegExp("\."+extension+"$", 'i').test(path); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment