-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathPath.js
More file actions
30 lines (23 loc) · 708 Bytes
/
Path.js
File metadata and controls
30 lines (23 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import path from "node:path";
export const normalize = path.normalize;
export function concat(segments) {
return path.join.apply(this, segments);
}
export function resolve(from) {
return to => () => path.resolve.apply(this, from.concat([to]));
}
export function relative(from) {
return to => path.relative(from, to);
}
export function dirname(p) {
return path.normalize(path.dirname(p));
}
export const basename = path.basename;
export function basenameWithoutExt(p) {
return ext => path.basename(p, ext);
}
export const extname = path.extname;
export const sep = path.sep;
export const delimiter = path.delimiter;
export const parse = path.parse;
export const isAbsolute = path.isAbsolute;