1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/tildify/index.js

10 lines
283 B
JavaScript
Raw Normal View History

2023-12-18 13:12:25 +08:00
'use strict';
var path = require('path');
var osHomedir = require('os-homedir');
var home = osHomedir();
module.exports = function (str) {
str = path.normalize(str) + path.sep;
return (str.indexOf(home) === 0 ? str.replace(home + path.sep, '~' + path.sep) : str).slice(0, -1);
};