function getFileExtension(path) {
  if (typeof path === 'string') {
    var splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i;
    var pathParts = splitPathRe.exec(path);

    if (pathParts) {
      return pathParts.pop().toLowerCase();
    }
  }

  return '';
}
function getFileExtension(path) {
  if (typeof path === 'string') {
    var splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i;
    var pathParts = splitPathRe.exec(path);

    if (pathParts) {
      return pathParts.pop().toLowerCase();
    }
  }

  return '';
}
function getFileExtension ( path ) { if ( typeof path === 'string' ) { var splitPathRe = / ^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$ / i ; var pathParts = splitPathRe . exec ( path ) ; if ( pathParts ) { return pathParts . pop ( ) . toLowerCase ( ) ; } } return '' ; }
Returns the extension of the passed file name. It will return an empty string
if passed an invalid path.

@param {string} path
The fileName path like '/path/to/file.mp4'

@returns {string}
The extension in lower case or an empty string if no
extension could be found.
Returns the extension of the passed file name . It will return an empty string if passed an invalid path .