* Remove `normalize-path` module * Try run all tests on `standalone` * Restore test * Add `no-parser-tests` * Fix issue with shim * DRY * Rename tests * Use `endsWith`
17 lines
323 B
JavaScript
17 lines
323 B
JavaScript
const sep = /[\\/]/;
|
|
|
|
export function extname(path) {
|
|
const filename = basename(path);
|
|
const dotIndex = filename.lastIndexOf(".");
|
|
if (dotIndex === -1) return "";
|
|
return filename.slice(dotIndex);
|
|
}
|
|
|
|
export function basename(path) {
|
|
return path.split(sep).pop();
|
|
}
|
|
|
|
export function isAbsolute() {
|
|
return true;
|
|
}
|