view-ignored 0.5.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -41
- package/out/browser.d.ts +3 -0
- package/out/browser.js +2 -0
- package/out/browser_scan.d.ts +20 -0
- package/out/browser_scan.js +59 -0
- package/out/browser_stream.d.ts +12 -0
- package/out/browser_stream.js +51 -0
- package/out/getDepth.d.ts +4 -0
- package/out/getDepth.js +21 -0
- package/out/index.d.ts +3 -1
- package/out/index.js +2 -1
- package/out/normalizeCwd.d.ts +1 -0
- package/out/normalizeCwd.js +4 -0
- package/out/opendir.d.ts +3 -0
- package/out/opendir.js +18 -0
- package/out/patterns/extractor.d.ts +80 -0
- package/out/patterns/extractor.js +1 -0
- package/out/patterns/gitignore.d.ts +9 -3
- package/out/patterns/gitignore.js +13 -20
- package/out/patterns/ignores.d.ts +19 -0
- package/out/patterns/ignores.js +1 -0
- package/out/patterns/index.d.ts +13 -4
- package/out/patterns/index.js +13 -4
- package/out/patterns/jsrjson.d.ts +16 -4
- package/out/patterns/jsrjson.js +30 -13
- package/out/patterns/matcherContext.d.ts +71 -0
- package/out/patterns/matcherContext.js +1 -0
- package/out/patterns/matcherContextPatch.d.ts +16 -0
- package/out/patterns/matcherContextPatch.js +156 -0
- package/out/patterns/matcherStream.d.ts +64 -0
- package/out/patterns/matcherStream.js +9 -0
- package/out/patterns/packagejson.d.ts +9 -3
- package/out/patterns/packagejson.js +18 -7
- package/out/patterns/pattern.d.ts +44 -0
- package/out/patterns/pattern.js +21 -0
- package/out/patterns/patternMatcher.d.ts +23 -0
- package/out/patterns/patternMatcher.js +1 -0
- package/out/patterns/resolveSources.d.ts +34 -0
- package/out/patterns/resolveSources.js +135 -0
- package/out/patterns/signedPattern.d.ts +126 -0
- package/out/patterns/signedPattern.js +145 -0
- package/out/patterns/source.d.ts +57 -0
- package/out/patterns/source.js +20 -0
- package/out/patterns/stringCompile.d.ts +9 -0
- package/out/patterns/stringCompile.js +28 -0
- package/out/scan.d.ts +5 -37
- package/out/scan.js +8 -101
- package/out/stream.d.ts +9 -0
- package/out/stream.js +12 -0
- package/out/targets/git.d.ts +4 -1
- package/out/targets/git.js +26 -17
- package/out/targets/index.d.ts +6 -6
- package/out/targets/index.js +6 -6
- package/out/targets/jsr.d.ts +4 -1
- package/out/targets/jsr.js +34 -20
- package/out/targets/npm.d.ts +4 -1
- package/out/targets/npm.js +47 -40
- package/out/targets/target.d.ts +17 -3
- package/out/targets/vsce.d.ts +4 -1
- package/out/targets/vsce.js +30 -19
- package/out/targets/yarn.d.ts +4 -1
- package/out/targets/yarn.js +53 -43
- package/out/types.d.ts +116 -0
- package/out/types.js +1 -0
- package/out/walk.d.ts +12 -2
- package/out/walk.js +98 -13
- package/package.json +113 -78
- package/out/patterns/matcher.d.ts +0 -114
- package/out/patterns/matcher.js +0 -137
package/out/stream.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MatcherStream } from "./patterns/matcherStream.js";
|
|
2
|
+
import type { ScanOptions } from "./types.js";
|
|
3
|
+
export type * from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* @see {@link scan}
|
|
6
|
+
*
|
|
7
|
+
* @since 0.6.0
|
|
8
|
+
*/
|
|
9
|
+
export declare function scanStream(options: ScanOptions): MatcherStream;
|
package/out/stream.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as nodefs from "node:fs";
|
|
2
|
+
import * as process from "node:process";
|
|
3
|
+
import { scanStream as browserStream } from "./browser_stream.js";
|
|
4
|
+
/**
|
|
5
|
+
* @see {@link scan}
|
|
6
|
+
*
|
|
7
|
+
* @since 0.6.0
|
|
8
|
+
*/
|
|
9
|
+
export function scanStream(options) {
|
|
10
|
+
const { cwd = process.cwd(), fs = nodefs } = options;
|
|
11
|
+
return browserStream({ fs, cwd, ...options });
|
|
12
|
+
}
|
package/out/targets/git.d.ts
CHANGED
package/out/targets/git.js
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import { signedPatternIgnores,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { extractGitignore, signedPatternIgnores, signedPatternCompile, } from "../patterns/index.js";
|
|
2
|
+
const extractors = [
|
|
3
|
+
{
|
|
4
|
+
extract: extractGitignore,
|
|
5
|
+
path: ".gitignore",
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
extract: extractGitignore,
|
|
9
|
+
path: ".git/info/exclude",
|
|
10
|
+
},
|
|
11
|
+
];
|
|
12
|
+
const internal = {
|
|
13
|
+
exclude: [".git", ".DS_Store"],
|
|
12
14
|
include: [],
|
|
15
|
+
compiled: null,
|
|
13
16
|
};
|
|
17
|
+
signedPatternCompile(internal);
|
|
18
|
+
/**
|
|
19
|
+
* @since 0.6.0
|
|
20
|
+
*/
|
|
14
21
|
export const Git = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
extractors,
|
|
23
|
+
ignores(o) {
|
|
24
|
+
return signedPatternIgnores({
|
|
25
|
+
...o,
|
|
26
|
+
internal,
|
|
27
|
+
root: "/",
|
|
28
|
+
target: Git,
|
|
29
|
+
});
|
|
21
30
|
},
|
|
22
31
|
};
|
package/out/targets/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from "./git.js";
|
|
2
|
+
export * from "./jsr.js";
|
|
3
|
+
export * from "./npm.js";
|
|
4
|
+
export * from "./target.js";
|
|
5
|
+
export * from "./vsce.js";
|
|
6
|
+
export * from "./yarn.js";
|
package/out/targets/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from "./git.js";
|
|
2
|
+
export * from "./jsr.js";
|
|
3
|
+
export * from "./npm.js";
|
|
4
|
+
export * from "./target.js";
|
|
5
|
+
export * from "./vsce.js";
|
|
6
|
+
export * from "./yarn.js";
|
package/out/targets/jsr.d.ts
CHANGED
package/out/targets/jsr.js
CHANGED
|
@@ -1,25 +1,39 @@
|
|
|
1
|
-
import { signedPatternIgnores,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { signedPatternIgnores, signedPatternCompile, extractJsrJson, extractJsrJsonc, } from "../patterns/index.js";
|
|
2
|
+
const extractors = [
|
|
3
|
+
{
|
|
4
|
+
extract: extractJsrJson,
|
|
5
|
+
path: "deno.json",
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
extract: extractJsrJsonc,
|
|
9
|
+
path: "deno.jsonc",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
extract: extractJsrJson,
|
|
13
|
+
path: "jsr.json",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
extract: extractJsrJsonc,
|
|
17
|
+
path: "jsr.jsonc",
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
const internal = {
|
|
21
|
+
exclude: [".git", ".DS_Store"],
|
|
15
22
|
include: [],
|
|
23
|
+
compiled: null,
|
|
16
24
|
};
|
|
25
|
+
signedPatternCompile(internal);
|
|
26
|
+
/**
|
|
27
|
+
* @since 0.6.0
|
|
28
|
+
*/
|
|
17
29
|
export const JSR = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
extractors,
|
|
31
|
+
ignores(o) {
|
|
32
|
+
return signedPatternIgnores({
|
|
33
|
+
...o,
|
|
34
|
+
internal,
|
|
35
|
+
root: ".",
|
|
36
|
+
target: JSR,
|
|
37
|
+
});
|
|
24
38
|
},
|
|
25
39
|
};
|
package/out/targets/npm.d.ts
CHANGED
package/out/targets/npm.js
CHANGED
|
@@ -1,46 +1,53 @@
|
|
|
1
|
-
import { signedPatternIgnores,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { signedPatternIgnores, signedPatternCompile, extractPackageJson, extractGitignore, } from "../patterns/index.js";
|
|
2
|
+
const extractors = [
|
|
3
|
+
{
|
|
4
|
+
extract: extractPackageJson,
|
|
5
|
+
path: "package.json",
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
extract: extractGitignore,
|
|
9
|
+
path: ".npmignore",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
extract: extractGitignore,
|
|
13
|
+
path: ".gitignore",
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
const internal = {
|
|
11
17
|
exclude: [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
],
|
|
30
|
-
include: [
|
|
31
|
-
'bin',
|
|
32
|
-
'package.json',
|
|
33
|
-
'README*',
|
|
34
|
-
'LICENSE*',
|
|
35
|
-
'LICENCE*',
|
|
18
|
+
".git",
|
|
19
|
+
".DS_Store",
|
|
20
|
+
"node_modules",
|
|
21
|
+
".*.swp",
|
|
22
|
+
"._*",
|
|
23
|
+
".DS_Store",
|
|
24
|
+
".git",
|
|
25
|
+
".gitignore",
|
|
26
|
+
".hg",
|
|
27
|
+
".npmignore",
|
|
28
|
+
".npmrc",
|
|
29
|
+
".lock-wscript",
|
|
30
|
+
".svn",
|
|
31
|
+
".wafpickle-*",
|
|
32
|
+
"config.gypi",
|
|
33
|
+
"CVS",
|
|
34
|
+
"npm-debug.log",
|
|
36
35
|
],
|
|
36
|
+
include: ["bin", "package.json", "README*", "LICENSE*", "LICENCE*"],
|
|
37
|
+
compiled: null,
|
|
37
38
|
};
|
|
39
|
+
signedPatternCompile(internal);
|
|
40
|
+
/**
|
|
41
|
+
* @since 0.6.0
|
|
42
|
+
*/
|
|
38
43
|
export const NPM = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
extractors,
|
|
45
|
+
ignores(o) {
|
|
46
|
+
return signedPatternIgnores({
|
|
47
|
+
...o,
|
|
48
|
+
internal,
|
|
49
|
+
root: ".",
|
|
50
|
+
target: NPM,
|
|
51
|
+
});
|
|
45
52
|
},
|
|
46
53
|
};
|
package/out/targets/target.d.ts
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Extractor } from "../patterns/extractor.js";
|
|
2
|
+
import type { Ignores } from "../patterns/ignores.js";
|
|
2
3
|
/**
|
|
3
|
-
* Contains the matcher used for
|
|
4
|
+
* Contains the matcher used for scanning.
|
|
5
|
+
*
|
|
6
|
+
* @since 0.6.0
|
|
4
7
|
*/
|
|
5
8
|
export interface Target {
|
|
9
|
+
/**
|
|
10
|
+
* The set of extractors.
|
|
11
|
+
* Required for context-patching APIs (ctx add/remove path).
|
|
12
|
+
*
|
|
13
|
+
* @since 0.6.0
|
|
14
|
+
*/
|
|
15
|
+
extractors: Extractor[];
|
|
6
16
|
/**
|
|
7
17
|
* Glob-pattern parser.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link Ignores}
|
|
20
|
+
*
|
|
21
|
+
* @since 0.6.0
|
|
8
22
|
*/
|
|
9
|
-
|
|
23
|
+
ignores: Ignores;
|
|
10
24
|
}
|
package/out/targets/vsce.d.ts
CHANGED
package/out/targets/vsce.js
CHANGED
|
@@ -1,24 +1,35 @@
|
|
|
1
|
-
import { signedPatternIgnores,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { signedPatternIgnores, signedPatternCompile, extractPackageJson, extractGitignore, } from "../patterns/index.js";
|
|
2
|
+
const extractors = [
|
|
3
|
+
{
|
|
4
|
+
extract: extractPackageJson,
|
|
5
|
+
path: "package.json",
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
extract: extractGitignore,
|
|
9
|
+
path: ".vscodeignore",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
extract: extractGitignore,
|
|
13
|
+
path: ".gitignore",
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
const internal = {
|
|
17
|
+
exclude: [".git", ".DS_Store"],
|
|
14
18
|
include: [],
|
|
19
|
+
compiled: null,
|
|
15
20
|
};
|
|
21
|
+
signedPatternCompile(internal);
|
|
22
|
+
/**
|
|
23
|
+
* @since 0.6.0
|
|
24
|
+
*/
|
|
16
25
|
export const VSCE = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
extractors,
|
|
27
|
+
ignores(o) {
|
|
28
|
+
return signedPatternIgnores({
|
|
29
|
+
...o,
|
|
30
|
+
internal,
|
|
31
|
+
root: ".",
|
|
32
|
+
target: VSCE,
|
|
33
|
+
});
|
|
23
34
|
},
|
|
24
35
|
};
|
package/out/targets/yarn.d.ts
CHANGED
package/out/targets/yarn.js
CHANGED
|
@@ -1,49 +1,59 @@
|
|
|
1
|
-
import { signedPatternIgnores,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { signedPatternIgnores, signedPatternCompile, extractPackageJson, extractGitignore, } from "../patterns/index.js";
|
|
2
|
+
const extractors = [
|
|
3
|
+
{
|
|
4
|
+
extract: extractPackageJson,
|
|
5
|
+
path: "package.json",
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
extract: extractGitignore,
|
|
9
|
+
path: ".yarnignore",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
extract: extractGitignore,
|
|
13
|
+
path: ".npmignore",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
extract: extractGitignore,
|
|
17
|
+
path: ".gitignore",
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
const internal = {
|
|
12
21
|
exclude: [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
],
|
|
33
|
-
include: [
|
|
34
|
-
'bin',
|
|
35
|
-
'package.json',
|
|
36
|
-
'README*',
|
|
37
|
-
'LICENSE*',
|
|
38
|
-
'LICENCE*',
|
|
22
|
+
".git",
|
|
23
|
+
".DS_Store",
|
|
24
|
+
"node_modules",
|
|
25
|
+
".*.swp",
|
|
26
|
+
"._*",
|
|
27
|
+
".DS_Store",
|
|
28
|
+
".git",
|
|
29
|
+
".gitignore",
|
|
30
|
+
".hg",
|
|
31
|
+
".npmignore",
|
|
32
|
+
".npmrc",
|
|
33
|
+
".lock-wscript",
|
|
34
|
+
".svn",
|
|
35
|
+
".wafpickle-*",
|
|
36
|
+
"config.gypi",
|
|
37
|
+
"CVS",
|
|
38
|
+
"npm-debug.log",
|
|
39
|
+
".yarnignore",
|
|
40
|
+
".yarnrc",
|
|
39
41
|
],
|
|
42
|
+
include: ["bin", "package.json", "README*", "LICENSE*", "LICENCE*"],
|
|
43
|
+
compiled: null,
|
|
40
44
|
};
|
|
45
|
+
signedPatternCompile(internal);
|
|
46
|
+
/**
|
|
47
|
+
* @since 0.6.0
|
|
48
|
+
*/
|
|
41
49
|
export const Yarn = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
extractors,
|
|
51
|
+
ignores(o) {
|
|
52
|
+
return signedPatternIgnores({
|
|
53
|
+
...o,
|
|
54
|
+
internal,
|
|
55
|
+
root: ".",
|
|
56
|
+
target: Yarn,
|
|
57
|
+
});
|
|
48
58
|
},
|
|
49
59
|
};
|
package/out/types.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type * as fs from "node:fs";
|
|
2
|
+
import type { Target } from "./targets/target.js";
|
|
3
|
+
/**
|
|
4
|
+
* Minimal FS implementation needed for `scan`, `scanStream`, and their browser versions.
|
|
5
|
+
*
|
|
6
|
+
* @since 0.6.0
|
|
7
|
+
*/
|
|
8
|
+
export interface FsAdapter {
|
|
9
|
+
promises: {
|
|
10
|
+
opendir: typeof fs.promises.opendir;
|
|
11
|
+
readFile: typeof fs.promises.readFile;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Used in multiple methods, primarily `scan`, `scanStream`, and their browser versions.
|
|
16
|
+
*
|
|
17
|
+
* @since 0.6.0
|
|
18
|
+
*/
|
|
19
|
+
export type ScanOptions = {
|
|
20
|
+
/**
|
|
21
|
+
* Provides the matcher to use for scanning.
|
|
22
|
+
*
|
|
23
|
+
* @since 0.6.0
|
|
24
|
+
*/
|
|
25
|
+
target: Target;
|
|
26
|
+
/**
|
|
27
|
+
* Current working directory to start the scan from.
|
|
28
|
+
*
|
|
29
|
+
* @default `normalizeCwd(process.cwd())`
|
|
30
|
+
*
|
|
31
|
+
* @since 0.6.0
|
|
32
|
+
*/
|
|
33
|
+
cwd?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Limits the scan to a subdirectory of `cwd`.
|
|
36
|
+
* Traversal starts from this subdirectory, but returned paths
|
|
37
|
+
* remain relative to `cwd`, and ignore files from `cwd`
|
|
38
|
+
* are still applied.
|
|
39
|
+
*
|
|
40
|
+
* @default `"."`
|
|
41
|
+
*
|
|
42
|
+
* @since 0.6.0
|
|
43
|
+
*/
|
|
44
|
+
within?: string;
|
|
45
|
+
/**
|
|
46
|
+
* If enabled, the scan will return files that are ignored by the target matcher.
|
|
47
|
+
*
|
|
48
|
+
* @default `false`
|
|
49
|
+
*
|
|
50
|
+
* @since 0.6.0
|
|
51
|
+
*/
|
|
52
|
+
invert?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Starting from depth `0` means you will see
|
|
55
|
+
* children of the current working directory.
|
|
56
|
+
*
|
|
57
|
+
* @default `Infinity`
|
|
58
|
+
*
|
|
59
|
+
* @since 0.6.0
|
|
60
|
+
*/
|
|
61
|
+
depth?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Return as soon as possible.
|
|
64
|
+
*
|
|
65
|
+
* @default `undefined`
|
|
66
|
+
*
|
|
67
|
+
* @since 0.6.0
|
|
68
|
+
*/
|
|
69
|
+
signal?: AbortSignal | null;
|
|
70
|
+
/**
|
|
71
|
+
* Works together with {@link ScanOptions.depth}.
|
|
72
|
+
* If enabled, directories will be processed faster
|
|
73
|
+
* by skipping files after first match.
|
|
74
|
+
*
|
|
75
|
+
* This makes the scan faster but affects
|
|
76
|
+
* {@link MatcherContext.totalDirs},
|
|
77
|
+
* {@link MatcherContext.totalFiles},
|
|
78
|
+
* {@link MatcherContext.totalMatchedFiles}
|
|
79
|
+
* and {@link MatcherContext.depthPaths}.
|
|
80
|
+
*
|
|
81
|
+
* It's recommended to use this option unless you
|
|
82
|
+
* need precise statistics
|
|
83
|
+
*
|
|
84
|
+
* @default `false`
|
|
85
|
+
*
|
|
86
|
+
* @since 0.6.0
|
|
87
|
+
*/
|
|
88
|
+
fastDepth?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Enables skipping entire directories for internal matches.
|
|
91
|
+
* For example, when scanning a Git repository,
|
|
92
|
+
* '.git' directory will be skipped without reading its contents.
|
|
93
|
+
*
|
|
94
|
+
* This makes the scan faster but affects
|
|
95
|
+
* {@link MatcherContext.totalDirs},
|
|
96
|
+
* {@link MatcherContext.totalFiles},
|
|
97
|
+
* and {@link MatcherContext.depthPaths}.
|
|
98
|
+
*
|
|
99
|
+
* It's recommended to use this option unless the target
|
|
100
|
+
* allows overriding internal patterns.
|
|
101
|
+
* This option should never affect {@link MatcherContext.totalMatchedFiles}.
|
|
102
|
+
*
|
|
103
|
+
* @default `false`
|
|
104
|
+
*
|
|
105
|
+
* @since 0.6.0
|
|
106
|
+
*/
|
|
107
|
+
fastInternal?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* File system interface.
|
|
110
|
+
*
|
|
111
|
+
* @default `await import("node:fs")`
|
|
112
|
+
*
|
|
113
|
+
* @since 0.6.0
|
|
114
|
+
*/
|
|
115
|
+
fs?: FsAdapter;
|
|
116
|
+
};
|
package/out/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/out/walk.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import type { Dirent
|
|
2
|
-
|
|
1
|
+
import type { Dirent } from "node:fs";
|
|
2
|
+
import type { MatcherContext } from "./patterns/matcherContext.js";
|
|
3
|
+
import type { MatcherStream } from "./patterns/matcherStream.js";
|
|
4
|
+
import type { ScanOptions } from "./types.js";
|
|
5
|
+
export type WalkOptions = {
|
|
6
|
+
path: string;
|
|
7
|
+
entry: Dirent;
|
|
8
|
+
ctx: MatcherContext;
|
|
9
|
+
stream: MatcherStream | undefined;
|
|
10
|
+
scanOptions: Required<ScanOptions>;
|
|
11
|
+
};
|
|
12
|
+
export declare function walkIncludes(options: WalkOptions): Promise<0 | 1 | 2>;
|