Comparing version 5.1.0 to 5.2.0
26
index.js
@@ -6,2 +6,3 @@ 'use strict'; | ||
const pTry = require('p-try'); | ||
const isPathInside = require('is-path-inside'); | ||
const macos = require('./lib/macos'); | ||
@@ -28,16 +29,19 @@ const linux = require('./lib/linux'); | ||
paths = paths | ||
.map(filePath => path.resolve(filePath)) | ||
.filter(filePath => { | ||
try { | ||
return fs.lstatSync(filePath); | ||
} catch (error) { | ||
if (error.code === 'ENOENT') { | ||
return false; | ||
} | ||
paths = paths.map(filePath => path.resolve(filePath)); | ||
paths = paths.filter(filePath => { | ||
if (paths.some(otherPath => isPathInside(filePath, otherPath))) { | ||
return false; | ||
} | ||
throw error; | ||
try { | ||
return fs.lstatSync(filePath); | ||
} catch (error) { | ||
if (error.code === 'ENOENT') { | ||
return false; | ||
} | ||
}); | ||
throw error; | ||
} | ||
}); | ||
if (paths.length === 0) { | ||
@@ -44,0 +48,0 @@ return; |
{ | ||
"name": "trash", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"description": "Move files and folders to the trash", | ||
@@ -45,2 +45,3 @@ "license": "MIT", | ||
"globby": "^7.1.1", | ||
"is-path-inside": "^2.0.0", | ||
"make-dir": "^1.3.0", | ||
@@ -47,0 +48,0 @@ "move-file": "^1.1.0", |
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
35906
165
10
+ Addedis-path-inside@^2.0.0
+ Addedis-path-inside@2.1.0(transitive)
+ Addedpath-is-inside@1.0.2(transitive)