dotfiles/.vscode/extensions/saviorisdead.RustyCode-0.18.0/node_modules/tildify/index.js
Cyryl Płotnicki 2f946d6200 Add .vscode
2016-09-11 10:29:13 +02:00

9 lines
283 B
JavaScript

'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);
};