123456789101112131415161718192021222324 |
- const { isAbsolute, parse } = require('path').win32
- module.exports = path => {
- let r = ''
- let parsed = parse(path)
- while (isAbsolute(path) || parsed.root) {
-
-
- const root = path.charAt(0) === '/' && path.slice(0, 4) !== '//?/' ? '/'
- : parsed.root
- path = path.slice(root.length)
- r += root
- parsed = parse(path)
- }
- return [r, path]
- }
|