dort
Version:
File sharing through web with wonderful alternation.
26 lines (19 loc) • 366 B
JavaScript
/**
* 文件路径处理模块
*/
const path = require('path')
class Paths {
constructor () {
this.separator = path.sep
}
normalize (_path) {
if (_path === '.' || _path === '') {
return '.'
}
return './' + path.normalize(_path)
}
parse (_path) {
return path.parse(this.normalize(_path))
}
}
module.exports = new Paths()