src/basis.js
function(path, ext){
        var filename = utils.normalize(path).match(/[^\\\/]*$/);
        filename = filename ? filename[0] : '';

        if (ext == utils.extname(filename))
          filename = filename.substring(0, filename.length - ext.length);

        return filename;
      }
function(path, ext){
        var filename = utils.normalize(path).match(/[^\\\/]*$/);
        filename = filename ? filename[0] : '';

        if (ext == utils.extname(filename))
          filename = filename.substring(0, filename.length - ext.length);

        return filename;
      }
function ( path , ext ) { var filename = utils . normalize ( path ) . match ( / [^\\\/]*$ / ) ; filename = filename ? filename [ 0 ] : '' ; if ( ext == utils . extname ( filename ) ) filename = filename . substring ( 0 , filename . length - ext . length ) ; return filename ; }
Return the last portion of a path. Similar to node.js path.basename
or the Unix basename command.

@example
basis.path.basename('/foo/bar/baz.html');          // returns 'baz.html'
basis.path.basename('/foo/bar/baz.html', '.html'); // returns 'baz'

@param {string} path
@param {string=} ext
@return {string}
Return the last portion of a path . Similar to node . js path . basename or the Unix basename command .