Files
certd/packages/ui/certd-server/utils/util.path.js

12 lines
246 B
JavaScript
Raw Normal View History

2021-02-05 14:30:31 +08:00
import os from 'os'
2021-02-04 18:44:16 +08:00
export default {
join (...dirs) {
const url = new URL('../' + dirs.join('/'), import.meta.url)
2021-02-05 14:30:31 +08:00
let path = url.pathname
if (os.type() === 'Windows_NT') {
path = path.substring(1)
}
return path
2021-02-04 18:44:16 +08:00
}
}