This commit is contained in:
Your Name
2026-08-11 17:41:36 +08:00
parent cfe4c82c90
commit 03fe4ddf9d
18771 changed files with 3617239 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
const startWith = require('./startWith');
const path = require('path');
const os = require('os');
const homeDir = os.homedir();
exports = function(p) {
p = path.normalize(p) + path.sep;
if (startWith(p, homeDir)) {
p = p.replace(homeDir + path.sep, `~${path.sep}`);
}
return p.slice(0, -1);
};
module.exports = exports;