Socket
Socket
Sign inDemoInstall

trash

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trash - npm Package Compare versions

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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc