Skip to content

Instantly share code, notes, and snippets.

@radiovisual
Created August 19, 2015 15:42
Show Gist options
  • Save radiovisual/1db4285ad3fa09a3ba45 to your computer and use it in GitHub Desktop.
Save radiovisual/1db4285ad3fa09a3ba45 to your computer and use it in GitHub Desktop.
Check a path string for a specific file type
/**
* 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