| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1x 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));
}
|