untildify
Advanced tools
Comparing version 2.1.0 to 3.0.0
'use strict'; | ||
var osHomedir = require('os-homedir'); | ||
var home = osHomedir(); | ||
const osHomedir = require('os-homedir'); | ||
const home = osHomedir(); | ||
module.exports = function (str) { | ||
module.exports = str => { | ||
if (typeof str !== 'string') { | ||
@@ -10,3 +10,3 @@ throw new TypeError('Expected a string'); | ||
return home ? str.replace(/^~($|\/|\\)/, home + '$1') : str; | ||
return home ? str.replace(/^~($|\/|\\)/, `${home}$1`) : str; | ||
}; |
{ | ||
"name": "untildify", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "Convert a tilde path to an absolute path: ~/dev => /Users/sindresorhus/dev", | ||
@@ -16,6 +16,6 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=0.10.0" | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "node test.js" | ||
"test": "xo && ava" | ||
}, | ||
@@ -42,4 +42,8 @@ "files": [ | ||
"devDependencies": { | ||
"ava": "0.0.4" | ||
"ava": "*", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"esnext": true | ||
} | ||
} |
@@ -16,3 +16,3 @@ # untildify [![Build Status](https://travis-ci.org/sindresorhus/untildify.svg?branch=master)](https://travis-ci.org/sindresorhus/untildify) | ||
```js | ||
var untildify = require('untildify'); | ||
const untildify = require('untildify'); | ||
@@ -31,2 +31,2 @@ untildify('~/dev'); | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
2746
2