Pathologic was missing because of a .git folder inside.
[yaffs-website] / node_modules / expand-tilde / index.js
1 /*!
2  * expand-tilde <https://github.com/jonschlinkert/expand-tilde>
3  *
4  * Copyright (c) 2015 Jon Schlinkert.
5  * Licensed under the MIT license.
6  */
7
8 var path = require('path');
9 var homedir = require('os-homedir');
10
11 module.exports = function expandTilde(filepath) {
12   var home = homedir();
13
14   if (filepath.charCodeAt(0) === 126 /* ~ */) {
15     if (filepath.charCodeAt(1) === 43 /* + */) {
16       return path.join(process.cwd(), filepath.slice(2));
17     }
18     return home ? path.join(home, filepath.slice(1)) : filepath;
19   }
20
21   return filepath;
22 };