Comparing version 6.1.1 to 7.0.0
@@ -12,3 +12,3 @@ 'use strict'; | ||
const trash = (paths, options) => pTry(() => { | ||
paths = (typeof paths === 'string' ? [paths] : paths).map(String); | ||
paths = (typeof paths === 'string' ? [paths] : paths).map(path => String(path)); | ||
@@ -20,3 +20,3 @@ options = { | ||
// TOOD: Upgrading to latest `globby` version is blocked by https://github.com/mrmlnc/fast-glob/issues/110 | ||
// TODO: Upgrading to latest `globby` version is blocked by https://github.com/mrmlnc/fast-glob/issues/110 | ||
if (options.glob) { | ||
@@ -31,2 +31,3 @@ paths = globby.sync(paths, { | ||
paths = paths.map(filePath => path.resolve(filePath)); | ||
paths = paths.filter(filePath => { | ||
@@ -33,0 +34,0 @@ if (paths.some(otherPath => isPathInside(filePath, otherPath))) { |
{ | ||
"name": "trash", | ||
"version": "6.1.1", | ||
"version": "7.0.0", | ||
"description": "Move files and folders to the trash", | ||
"license": "MIT", | ||
"repository": "sindresorhus/trash", | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=10" | ||
}, | ||
@@ -42,11 +43,11 @@ "scripts": { | ||
"dependencies": { | ||
"@stroncium/procfs": "^1.0.0", | ||
"@stroncium/procfs": "^1.2.1", | ||
"globby": "^7.1.1", | ||
"is-path-inside": "^3.0.2", | ||
"make-dir": "^3.0.0", | ||
"move-file": "^1.1.0", | ||
"p-map": "^3.0.0", | ||
"make-dir": "^3.1.0", | ||
"move-file": "^2.0.0", | ||
"p-map": "^4.0.0", | ||
"p-try": "^2.2.0", | ||
"uuid": "^3.3.2", | ||
"xdg-trashdir": "^2.1.1" | ||
"uuid": "^8.3.1", | ||
"xdg-trashdir": "^3.1.0" | ||
}, | ||
@@ -56,5 +57,5 @@ "devDependencies": { | ||
"tempfile": "^3.0.0", | ||
"tsd": "^0.11.0", | ||
"xo": "^0.25.3" | ||
"tsd": "^0.13.1", | ||
"xo": "^0.35.0" | ||
} | ||
} |
@@ -5,9 +5,10 @@ # ![trash](media/logo.svg) | ||
[![Build Status](https://travis-ci.org/sindresorhus/trash.svg?branch=master)](https://travis-ci.org/sindresorhus/trash) | ||
[![Build Status](https://travis-ci.com/sindresorhus/trash.svg?branch=master)](https://travis-ci.com/github/sindresorhus/trash) | ||
Works on macOS (10.12+), Linux, and Windows (8+). | ||
**Note:** The Linux implementation is not very good and not maintained. Help welcome. If no one steps up to help maintain it, I will eventually remove Linux support. | ||
In contrast to [`fs.unlink`](https://nodejs.org/api/fs.html#fs_fs_unlink_path_callback), [`del`](https://github.com/sindresorhus/del), and [`rimraf`](https://github.com/isaacs/rimraf) which permanently delete files, this only moves them to the trash, which is much safer and reversible. | ||
## Install | ||
@@ -19,3 +20,2 @@ | ||
## Usage | ||
@@ -31,6 +31,5 @@ | ||
## API | ||
### trash(input, [options]) | ||
### trash(input, options?) | ||
@@ -41,3 +40,3 @@ Returns a `Promise`. | ||
Type: `string` `string[]` | ||
Type: `string | string[]` | ||
@@ -48,7 +47,7 @@ Accepts paths and [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns). | ||
Type: `Object` | ||
Type: `object` | ||
##### glob | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `true` | ||
@@ -58,3 +57,2 @@ | ||
## CLI | ||
@@ -68,10 +66,8 @@ | ||
## Info | ||
On macOS, [`macos-trash`](https://github.com/sindresorhus/macos-trash) is used.<br> | ||
On Linux, the [XDG spec](http://standards.freedesktop.org/trash-spec/trashspec-1.0.html) is followed.<br> | ||
On macOS, [`macos-trash`](https://github.com/sindresorhus/macos-trash) is used.\ | ||
On Linux, the [XDG spec](http://standards.freedesktop.org/trash-spec/trashspec-1.0.html) is followed.\ | ||
On Windows, [`recycle-bin`](https://github.com/sindresorhus/recycle-bin) is used. | ||
## FAQ | ||
@@ -83,3 +79,2 @@ | ||
## Related | ||
@@ -90,6 +85,1 @@ | ||
- [del](https://github.com/sindresorhus/del) - Delete files and folders | ||
## License | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
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
53639
77
+ Added@sindresorhus/df@3.1.1(transitive)
+ Addedcross-spawn@7.0.3(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedexeca@2.1.0(transitive)
+ Addedget-stream@5.2.0(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedmove-file@2.1.0(transitive)
+ Addednpm-run-path@3.1.0(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedp-finally@2.0.1(transitive)
+ Addedp-map@4.0.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addeduuid@8.3.2(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedxdg-basedir@4.0.0(transitive)
+ Addedxdg-trashdir@3.1.0(transitive)
- Removed@sindresorhus/df@2.1.0(transitive)
- Removedcp-file@6.2.0(transitive)
- Removedcross-spawn-async@2.2.5(transitive)
- Removedexeca@0.2.2(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedlru-cache@4.1.5(transitive)
- Removedmake-dir@2.1.0(transitive)
- Removedmove-file@1.2.0(transitive)
- Removednested-error-stacks@2.1.1(transitive)
- Removednpm-run-path@1.0.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedp-map@3.0.0(transitive)
- Removedpath-exists@3.0.0(transitive)
- Removedpath-key@1.0.0(transitive)
- Removedpify@4.0.1(transitive)
- Removedpseudomap@1.0.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedstrip-eof@1.0.0(transitive)
- Removeduuid@3.4.0(transitive)
- Removedwhich@1.3.1(transitive)
- Removedxdg-basedir@2.0.0(transitive)
- Removedxdg-trashdir@2.1.1(transitive)
- Removedyallist@2.1.2(transitive)
Updated@stroncium/procfs@^1.2.1
Updatedmake-dir@^3.1.0
Updatedmove-file@^2.0.0
Updatedp-map@^4.0.0
Updateduuid@^8.3.1
Updatedxdg-trashdir@^3.1.0