|
1 | | -"use strict"; |
| 1 | +import path from "path"; |
| 2 | +export const normalize = path.normalize; |
2 | 3 |
|
3 | | -var path = require("path"); |
4 | | - |
5 | | -exports.normalize = path.normalize; |
6 | | - |
7 | | -exports.concat = function (segments) { |
| 4 | +export function concat(segments) { |
8 | 5 | return path.join.apply(this, segments); |
9 | | -}; |
| 6 | +} |
10 | 7 |
|
11 | | -exports.resolve = function (from) { |
12 | | - return function (to) { |
13 | | - return function () { |
14 | | - return path.resolve.apply(this, from.concat([to])); |
15 | | - }; |
16 | | - }; |
17 | | -}; |
| 8 | +export function resolve(from) { |
| 9 | + return to => () => path.resolve.apply(this, from.concat([to])); |
| 10 | +} |
18 | 11 |
|
19 | | -exports.relative = function (from) { |
20 | | - return function (to) { |
21 | | - return path.relative(from, to); |
22 | | - }; |
23 | | -}; |
| 12 | +export function relative(from) { |
| 13 | + return to => path.relative(from, to); |
| 14 | +} |
24 | 15 |
|
25 | | -exports.dirname = function (p) { |
| 16 | +export function dirname(p) { |
26 | 17 | return path.normalize(path.dirname(p)); |
27 | | -}; |
28 | | - |
29 | | -exports.basename = path.basename; |
30 | | - |
31 | | -exports.basenameWithoutExt = function (p) { |
32 | | - return function (ext) { |
33 | | - return path.basename(p, ext); |
34 | | - }; |
35 | | -}; |
36 | | - |
37 | | -exports.extname = path.extname; |
38 | | - |
39 | | -exports.sep = path.sep; |
| 18 | +} |
40 | 19 |
|
41 | | -exports.delimiter = path.delimiter; |
| 20 | +export const basename = path.basename; |
42 | 21 |
|
43 | | -exports.parse = path.parse; |
| 22 | +export function basenameWithoutExt(p) { |
| 23 | + return ext => path.basename(p, ext); |
| 24 | +} |
44 | 25 |
|
45 | | -exports.isAbsolute = path.isAbsolute; |
| 26 | +export const extname = path.extname; |
| 27 | +export const sep = path.sep; |
| 28 | +export const delimiter = path.delimiter; |
| 29 | +export const parse = path.parse; |
| 30 | +export const isAbsolute = path.isAbsolute; |
0 commit comments