Comparing version 2.0.0 to 3.0.0
20
index.js
@@ -10,3 +10,11 @@ 'use strict'; | ||
return pify(fs[fn])(fp).then(stats => stats[fn2]()); | ||
return pify(fs[fn])(fp) | ||
.then(stats => stats[fn2]()) | ||
.catch(err => { | ||
if (err.code === 'ENOENT') { | ||
return false; | ||
} | ||
throw err; | ||
}); | ||
} | ||
@@ -19,3 +27,11 @@ | ||
return fs[fn](fp)[fn2](); | ||
try { | ||
return fs[fn](fp)[fn2](); | ||
} catch (err) { | ||
if (err.code === 'ENOENT') { | ||
return false; | ||
} | ||
throw err; | ||
} | ||
} | ||
@@ -22,0 +38,0 @@ |
{ | ||
"name": "path-type", | ||
"version": "2.0.0", | ||
"description": "Check if a path is a file, directory, or symlink", | ||
"license": "MIT", | ||
"repository": "sindresorhus/path-type", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"path", | ||
"fs", | ||
"type", | ||
"is", | ||
"check", | ||
"directory", | ||
"dir", | ||
"file", | ||
"filepath", | ||
"symlink", | ||
"symbolic", | ||
"link", | ||
"stat", | ||
"stats", | ||
"filesystem" | ||
], | ||
"dependencies": { | ||
"pify": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"esnext": true | ||
} | ||
"name": "path-type", | ||
"version": "3.0.0", | ||
"description": "Check if a path is a file, directory, or symlink", | ||
"license": "MIT", | ||
"repository": "sindresorhus/path-type", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"path", | ||
"fs", | ||
"type", | ||
"is", | ||
"check", | ||
"directory", | ||
"dir", | ||
"file", | ||
"filepath", | ||
"symlink", | ||
"symbolic", | ||
"link", | ||
"stat", | ||
"stats", | ||
"filesystem" | ||
], | ||
"dependencies": { | ||
"pify": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
} |
@@ -9,3 +9,3 @@ # path-type [![Build Status](https://travis-ci.org/sindresorhus/path-type.svg?branch=master)](https://travis-ci.org/sindresorhus/path-type) | ||
``` | ||
$ npm install --save path-type | ||
$ npm install path-type | ||
``` | ||
@@ -12,0 +12,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3474
35
+ Addedpify@3.0.0(transitive)
- Removedpify@2.3.0(transitive)
Updatedpify@^3.0.0