Skip to content

Commit 6c99805

Browse files
committedSep 26, 2020
Require Node.js 10
1 parent 1df5280 commit 6c99805

File tree

5 files changed

+38
-37
lines changed

5 files changed

+38
-37
lines changed
 

‎.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ os:
44
- windows
55
language: node_js
66
node_js:
7+
- '14'
78
- '12'
89
- '10'
9-
- '8'

‎benchmark.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ const del = require('.');
77

88
const suite = new Benchmark.Suite('concurrency');
99

10-
const tempDir = tempy.directory();
10+
const temporaryDir = tempy.directory();
1111

1212
const fixtures = Array.from({length: 2000}, (_, index) => {
13-
return path.resolve(tempDir, (index + 1).toString());
13+
return path.resolve(temporaryDir, (index + 1).toString());
1414
});
1515

1616
function createFixtures() {
1717
for (const fixture of fixtures) {
18-
makeDir.sync(path.resolve(tempDir, fixture));
18+
makeDir.sync(path.resolve(temporaryDir, fixture));
1919
}
2020
}
2121

@@ -49,18 +49,18 @@ for (const concurrency of concurrencies) {
4949
createFixtures();
5050

5151
const removedFiles = await del(['**/*'], {
52-
cwd: tempDir,
52+
cwd: temporaryDir,
5353
concurrency
5454
});
5555

5656
if (removedFiles.length !== fixtures.length) {
5757
const error = new Error(
58-
`"${name}": files removed: ${removedFiles.length}, expected: ${fixtures.length}`,
58+
`"${name}": files removed: ${removedFiles.length}, expected: ${fixtures.length}`
5959
);
6060

6161
console.error(error);
6262

63-
del.sync(tempDir, {cwd: tempDir, force: true});
63+
del.sync(temporaryDir, {cwd: temporaryDir, force: true});
6464

6565
// eslint-disable-next-line unicorn/no-process-exit
6666
process.exit(1);
@@ -78,6 +78,6 @@ suite
7878
.on('complete', function () {
7979
console.log(`Fastest is ${this.filter('fastest').map('name')}`);
8080

81-
del.sync(tempDir, {cwd: tempDir, force: true});
81+
del.sync(temporaryDir, {cwd: temporaryDir, force: true});
8282
})
8383
.run({async: true});

‎index.d.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ declare namespace del {
3737
}
3838

3939
declare const del: {
40+
/**
41+
Synchronously delete files and directories using glob patterns.
42+
43+
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()`.
44+
45+
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
46+
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
47+
- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
48+
@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.
49+
@returns The deleted paths.
50+
*/
51+
sync: (
52+
patterns: string | readonly string[],
53+
options?: del.Options
54+
) => string[];
55+
4056
/**
4157
Delete files and directories using glob patterns.
4258
@@ -63,22 +79,6 @@ declare const del: {
6379
patterns: string | readonly string[],
6480
options?: del.Options
6581
): Promise<string[]>;
66-
67-
/**
68-
Synchronously delete files and directories using glob patterns.
69-
70-
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()`.
71-
72-
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
73-
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
74-
- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
75-
@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.
76-
@returns The deleted paths.
77-
*/
78-
sync(
79-
patterns: string | readonly string[],
80-
options?: del.Options
81-
): string[];
8282
};
8383

8484
export = del;

‎license

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
3+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

‎package.json

+13-12
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
"description": "Delete files and directories",
55
"license": "MIT",
66
"repository": "sindresorhus/del",
7+
"funding": "https://github.com/sponsors/sindresorhus",
78
"author": {
89
"name": "Sindre Sorhus",
910
"email": "sindresorhus@gmail.com",
10-
"url": "sindresorhus.com"
11+
"url": "https://sindresorhus.com"
1112
},
1213
"engines": {
13-
"node": ">=8"
14+
"node": ">=10"
1415
},
1516
"scripts": {
1617
"test": "xo && ava && tsd",
@@ -45,21 +46,21 @@
4546
"filesystem"
4647
],
4748
"dependencies": {
48-
"globby": "^10.0.1",
49-
"graceful-fs": "^4.2.2",
49+
"globby": "^11.0.1",
50+
"graceful-fs": "^4.2.4",
5051
"is-glob": "^4.0.1",
5152
"is-path-cwd": "^2.2.0",
52-
"is-path-inside": "^3.0.1",
53-
"p-map": "^3.0.0",
54-
"rimraf": "^3.0.0",
53+
"is-path-inside": "^3.0.2",
54+
"p-map": "^4.0.0",
55+
"rimraf": "^3.0.2",
5556
"slash": "^3.0.0"
5657
},
5758
"devDependencies": {
58-
"ava": "^2.3.0",
59+
"ava": "^2.4.0",
5960
"benchmark": "^2.1.4",
60-
"make-dir": "^3.0.0",
61-
"tempy": "^0.3.0",
62-
"tsd": "^0.7.4",
63-
"xo": "^0.24.0"
61+
"make-dir": "^3.1.0",
62+
"tempy": "^0.7.0",
63+
"tsd": "^0.13.1",
64+
"xo": "^0.33.1"
6465
}
6566
}

0 commit comments

Comments
 (0)
Please sign in to comment.