'use strict'; const os = require('os'); const homeDirectory = os.homedir(); module.exports = pathWithTilde => { if (typeof pathWithTilde !== 'string') { throw new TypeError(`Expected a string, got ${typeof pathWithTilde}`); } return homeDirectory ? pathWithTilde.replace(/^~(?=$|\/|\\)/, homeDirectory) : pathWithTilde; };
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
index.d.ts | File | 279 B | 0644 |
|
index.js | File | 331 B | 0644 |
|
license | File | 1.08 KB | 0644 |
|
package.json | File | 3.67 KB | 0644 |
|
readme.md | File | 532 B | 0644 |
|