All files / fuse-ui-shared path.ts

100% Statements 10/10
100% Branches 2/2
100% Functions 3/3
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 161x 1x 2x 2x 1x     1x     1x   1x 11x    
import * as _ from 'underscore';
export function pathExt(path: string): string {
  const index = path.lastIndexOf('.');
  if (index >= 0) {
    return path.substr(index + 1);
  }
 
  return null;
}
 
const pathSeparators = /[\\\/]/;
 
export function baseName(path: string): string {
  return _.last(path.split(pathSeparators).filter(x => x));
}