-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.d.ts
42 lines (32 loc) · 778 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
Returns `true` if `filename` matches a junk file.
@example
```
import fs from 'node:fs/promises';
import {isJunk} from 'junk';
const files = await fs.readdir('some/path');
console.log(files);
//=> ['.DS_Store', 'test.jpg']
console.log(files.filter(isJunk));
//=> ['.DS_Store']
```
*/
export function isJunk(filename: string): boolean;
/**
Returns `true` if `filename` does not match a junk file.
@example
```
import fs from 'node:fs/promises';
import {isNotJunk} from 'junk';
const files = await fs.readdir('some/path');
console.log(files);
//=> ['.DS_Store', 'test.jpg']
console.log(files.filter(isNotJunk));
//=> ['test.jpg']
```
*/
export function isNotJunk(filename: string): boolean;
/**
Regex used for matching junk files.
*/
export const junkRegex: RegExp;