Update ava to 4.3.3

The [release notes](https://github.com/avajs/ava/releases/tag/v4.3.3)
mention compatibility with Node 18.8.
This commit is contained in:
Henry Mercer 2022-09-02 18:02:07 +01:00
parent 21530f507f
commit bea5e4b220
160 changed files with 2647 additions and 2263 deletions

36
node_modules/del/index.d.ts generated vendored
View file

@ -1,6 +1,23 @@
import {GlobbyOptions} from 'globby';
declare namespace del {
interface ProgressData {
/**
Deleted files and directories count.
*/
deletedCount: number;
/**
Total files and directories count.
*/
totalCount: number;
/**
Completed percentage. A value between `0` and `1`.
*/
percent: number;
}
interface Options extends GlobbyOptions {
/**
Allow deleting the current working directory and outside.
@ -33,6 +50,21 @@ declare namespace del {
@default Infinity
*/
readonly concurrency?: number;
/**
Called after each file or directory is deleted.
@example
```
import del from 'del';
await del(patterns, {
onProgress: progress => {
// …
}});
```
*/
readonly onProgress?: (progress: ProgressData) => void;
}
}
@ -43,7 +75,7 @@ declare const del: {
Note that glob patterns can only contain forward-slashes, not backward-slashes. Windows file paths can use backward-slashes as long as the path does not contain any glob-like characters, otherwise use `path.posix.join()` instead of `path.join()`.
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/main/test/test.js)
- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
@param options - You can specify any of the [`globby` options](https://github.com/sindresorhus/globby#options) in addition to the `del` options. In contrast to the `globby` defaults, `expandDirectories`, `onlyFiles`, and `followSymbolicLinks` are `false` by default.
@returns The deleted paths.
@ -59,7 +91,7 @@ declare const del: {
Note that glob patterns can only contain forward-slashes, not backward-slashes. Windows file paths can use backward-slashes as long as the path does not contain any glob-like characters, otherwise use `path.posix.join()` instead of `path.join()`.
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/main/test/test.js)
- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
@param options - You can specify any of the [`globby` options](https://github.com/sindresorhus/globby#options) in addition to the `del` options. In contrast to the `globby` defaults, `expandDirectories`, `onlyFiles`, and `followSymbolicLinks` are `false` by default.
@returns The deleted paths.

20
node_modules/del/index.js generated vendored
View file

@ -52,7 +52,7 @@ function normalizePatterns(patterns) {
return patterns;
}
module.exports = async (patterns, {force, dryRun, cwd = process.cwd(), ...options} = {}) => {
module.exports = async (patterns, {force, dryRun, cwd = process.cwd(), onProgress = () => {}, ...options} = {}) => {
options = {
expandDirectories: false,
onlyFiles: false,
@ -66,6 +66,16 @@ module.exports = async (patterns, {force, dryRun, cwd = process.cwd(), ...option
const files = (await globby(patterns, options))
.sort((a, b) => b.localeCompare(a));
if (files.length === 0) {
onProgress({
totalCount: 0,
deletedCount: 0,
percent: 1
});
}
let deletedCount = 0;
const mapper = async file => {
file = path.resolve(cwd, file);
@ -77,6 +87,14 @@ module.exports = async (patterns, {force, dryRun, cwd = process.cwd(), ...option
await rimrafP(file, rimrafOptions);
}
deletedCount += 1;
onProgress({
totalCount: files.length,
deletedCount,
percent: deletedCount / files.length
});
return file;
};

2
node_modules/del/package.json generated vendored
View file

@ -1,6 +1,6 @@
{
"name": "del",
"version": "6.0.0",
"version": "6.1.1",
"description": "Delete files and directories",
"license": "MIT",
"repository": "sindresorhus/del",

33
node_modules/del/readme.md generated vendored
View file

@ -1,4 +1,4 @@
# del [![Build Status](https://travis-ci.com/sindresorhus/del.svg?branch=master)](https://travis-ci.com/github/sindresorhus/del) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)
# del
> Delete files and directories using [globs](https://github.com/sindresorhus/globby#globbing-patterns)
@ -21,7 +21,7 @@ const del = require('del');
console.log('Deleted files:\n', deletedFilePaths.join('\n'));
console.log('\n\n');
console.log('Deleted directories:\n', deletedDirectoryPaths.join('\n));
console.log('Deleted directories:\n', deletedDirectoryPaths.join('\n'));
})();
```
@ -67,7 +67,7 @@ Type: `string | string[]`
See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/main/test/test.js)
- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
#### options
@ -108,6 +108,33 @@ Minimum: `1`
Concurrency limit.
##### onProgress
Type: `(progress: ProgressData) => void`
Called after each file or directory is deleted.
```js
import del from 'del';
await del(patterns, {
onProgress: progress => {
// …
}});
```
###### ProgressData
```js
{
totalCount: number,
deletedCount: number,
percent: number
}
```
- `percent` is a value between `0` and `1`
## CLI
See [del-cli](https://github.com/sindresorhus/del-cli) for a CLI for this module and [trash-cli](https://github.com/sindresorhus/trash-cli) for a safe version that is suitable for running by hand.