view-ignored 0.4.0 → 0.4.2

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.
Files changed (58) hide show
  1. package/README.md +3 -4
  2. package/bin/viewig +1 -1
  3. package/out/{src/browser → browser}/binds/index.d.ts +1 -20
  4. package/out/{src/browser → browser}/binds/index.js +3 -9
  5. package/out/browser/binds/plugins/git.d.ts +3 -0
  6. package/out/{src/browser → browser}/binds/plugins/git.js +3 -3
  7. package/out/browser/binds/plugins/jsr.d.ts +3 -0
  8. package/out/browser/binds/plugins/jsr.js +96 -0
  9. package/out/browser/binds/plugins/npm.d.ts +3 -0
  10. package/out/{src/browser → browser}/binds/plugins/npm.js +15 -16
  11. package/out/browser/binds/plugins/vsce.d.ts +3 -0
  12. package/out/{src/browser → browser}/binds/plugins/vsce.js +3 -3
  13. package/out/browser/binds/plugins/yarn.d.ts +3 -0
  14. package/out/{src/browser → browser}/binds/plugins/yarn.js +2 -2
  15. package/out/{src/browser → browser}/binds/scanner.d.ts +0 -12
  16. package/out/{src/browser → browser}/binds/scanner.js +0 -6
  17. package/out/{src/browser → browser}/binds/targets.d.ts +0 -11
  18. package/out/{src/browser → browser}/binds/targets.js +1 -6
  19. package/out/{src/browser → browser}/errors.d.ts +0 -15
  20. package/out/{src/browser → browser}/errors.js +0 -15
  21. package/out/{src/browser → browser}/filtering.d.ts +0 -3
  22. package/out/{src/browser → browser}/filtering.js +0 -2
  23. package/out/{src/browser → browser}/fs/directory.d.ts +0 -53
  24. package/out/{src/browser → browser}/fs/directory.js +3 -6
  25. package/out/{src/browser → browser}/fs/file-info.d.ts +1 -6
  26. package/out/{src/browser → browser}/fs/file-info.js +1 -2
  27. package/out/{src/browser → browser}/fs/file.d.ts +0 -3
  28. package/out/{src/browser → browser}/fs/file.js +0 -3
  29. package/out/{src/browser → browser}/fs/source-info.d.ts +0 -1
  30. package/out/{src/browser → browser}/fs/source-info.js +0 -1
  31. package/out/{src/browser → browser}/lib.d.ts +1 -12
  32. package/out/{src/browser → browser}/lib.js +1 -4
  33. package/out/{src/browser → browser}/sorting.d.ts +0 -10
  34. package/out/{src/browser → browser}/sorting.js +0 -8
  35. package/out/{src/browser → browser}/styling.d.ts +2 -16
  36. package/out/{src/browser → browser}/styling.js +0 -7
  37. package/out/{src/cli.d.ts → cli.d.ts} +0 -47
  38. package/out/{src/cli.js → cli.js} +4 -39
  39. package/out/{src/config.d.ts → config.d.ts} +0 -57
  40. package/out/{src/config.js → config.js} +11 -53
  41. package/out/{src/errors.d.ts → errors.d.ts} +0 -1
  42. package/out/{src/styling.d.ts → styling.d.ts} +0 -6
  43. package/out/{src/styling.js → styling.js} +1 -7
  44. package/package.json +32 -39
  45. package/out/package.json +0 -122
  46. package/out/src/browser/binds/plugins/git.d.ts +0 -22
  47. package/out/src/browser/binds/plugins/npm.d.ts +0 -38
  48. package/out/src/browser/binds/plugins/vsce.d.ts +0 -25
  49. package/out/src/browser/binds/plugins/yarn.d.ts +0 -11
  50. /package/out/{src/browser → browser}/fs/index.d.ts +0 -0
  51. /package/out/{src/browser → browser}/fs/index.js +0 -0
  52. /package/out/{src/browser → browser}/index.d.ts +0 -0
  53. /package/out/{src/browser → browser}/index.js +0 -0
  54. /package/out/{src/errors.js → errors.js} +0 -0
  55. /package/out/{src/index.d.ts → index.d.ts} +0 -0
  56. /package/out/{src/index.js → index.js} +0 -0
  57. /package/out/{src/lib.d.ts → lib.d.ts} +0 -0
  58. /package/out/{src/lib.js → lib.js} +0 -0
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![github](https://img.shields.io/github/stars/Mopsgamer/view-ignored.svg?style=flat)](https://github.com/Mopsgamer/view-ignored)
6
6
  [![github issues](https://img.shields.io/github/issues/Mopsgamer/view-ignored.svg?style=flat)](https://github.com/Mopsgamer/view-ignored/issues)
7
7
 
8
- Retrieve list of files ignored/included by Git, NPM, Yarn and VSC Extension.
8
+ Retrieve list of files ignored/included by Git, NPM, Yarn, JSR, VSCE or other tools.
9
9
 
10
10
  ## Highlights
11
11
 
@@ -88,8 +88,7 @@ const fileInfoSorted = fileInfoList.sort((a, b) => sorter(String(a), String(b)))
88
88
  ### Targets
89
89
 
90
90
  - `git`
91
- - `npm` (use it for PNPM and Bun)
91
+ - `npm` (compatible with Bun, PNPM, and others)
92
92
  - `yarn`
93
93
  - `vsce`
94
- - `jsr` *planned*
95
- - `deno` *planned*
94
+ - `jsr` (compatible with Deno)
package/bin/viewig CHANGED
@@ -1,4 +1,4 @@
1
1
  #! /usr/bin/env node
2
- import {programInit} from '../out/src/cli.js';
2
+ import {programInit} from '../out/cli.js';
3
3
 
4
4
  programInit();
@@ -1,64 +1,45 @@
1
- import { type TargetBind } from './targets.js';
2
1
  export * from './scanner.js';
3
2
  export * from './targets.js';
4
3
  /**
5
4
  * Built-in name list.
6
- * @public
7
5
  */
8
- export declare const builtInNameList: readonly ["git", "npm", "vsce", "yarn"];
6
+ export declare const builtInNameList: readonly ["git", "npm", "vsce", "yarn", "jsr"];
9
7
  /**
10
8
  * Built-in name type.
11
- * @public
12
9
  */
13
10
  export type BuiltInName = typeof builtInNameList[number];
14
11
  /**
15
12
  * The result of loading.
16
- * @public
17
13
  */
18
14
  export type PluginLoaded = {
19
15
  resource: string;
20
16
  isLoaded: boolean;
21
17
  exports: unknown;
22
18
  };
23
- /**
24
- * If a plugin wants to change something, it must export default.
25
- * @private
26
- */
27
- export type PluginExport = {
28
- viewignored: {
29
- addTargets: TargetBind[];
30
- };
31
- };
32
19
  /**
33
20
  * Checks if the value is the {@link PluginExport}.
34
- * @public
35
21
  */
36
22
  export declare function isPluginExport(value: unknown): value is PluginExport;
37
23
  /**
38
24
  * Imports the plugin's exported data.
39
- * @public
40
25
  */
41
26
  export declare function importPlugin(exportData: PluginExport): void;
42
27
  /**
43
28
  * @param modulePath The plugin name.
44
29
  * @returns The import result for the module.
45
- * @public
46
30
  */
47
31
  export declare function loadPlugin(modulePath: string, useImport?: boolean): Promise<PluginLoaded>;
48
32
  /**
49
33
  * @param modulePathList The plugin name list.
50
34
  * @returns The import result for the list of modules.
51
- * @public
52
35
  */
53
36
  export declare function loadPlugins(modulePathList: string[]): Promise<PluginLoaded[]>;
54
37
  /**
55
38
  * Load any built-in plugin.
56
- * @public
57
39
  */
58
40
  export declare function loadBuiltIn(builtIn: BuiltInName): Promise<PluginLoaded>;
59
41
  /**
60
42
  * @param modulePathList The plugin name list.
61
43
  * @returns The import result for the list of modules.
62
- * @public
63
44
  */
64
45
  export declare function loadBuiltIns(builtInList?: BuiltInName[]): Promise<PluginLoaded[]>;
@@ -4,22 +4,21 @@ import { isTargetBind, targetSet } from './targets.js';
4
4
  export * from './scanner.js';
5
5
  export * from './targets.js';
6
6
  /**
7
- * @private
7
+ * @internal
8
8
  */
9
9
  const builtInImportMap = {
10
10
  git: './plugins/git.js',
11
11
  npm: './plugins/npm.js',
12
12
  vsce: './plugins/vsce.js',
13
13
  yarn: './plugins/yarn.js',
14
+ jsr: './plugins/jsr.js',
14
15
  };
15
16
  /**
16
17
  * Built-in name list.
17
- * @public
18
18
  */
19
- export const builtInNameList = ['git', 'npm', 'vsce', 'yarn'];
19
+ export const builtInNameList = ['git', 'npm', 'vsce', 'yarn', 'jsr'];
20
20
  /**
21
21
  * Checks if the value is the {@link PluginExport}.
22
- * @public
23
22
  */
24
23
  export function isPluginExport(value) {
25
24
  if (value?.constructor !== Object) {
@@ -31,7 +30,6 @@ export function isPluginExport(value) {
31
30
  }
32
31
  /**
33
32
  * Imports the plugin's exported data.
34
- * @public
35
33
  */
36
34
  export function importPlugin(exportData) {
37
35
  const { addTargets } = exportData.viewignored;
@@ -42,7 +40,6 @@ export function importPlugin(exportData) {
42
40
  /**
43
41
  * @param modulePath The plugin name.
44
42
  * @returns The import result for the module.
45
- * @public
46
43
  */
47
44
  export async function loadPlugin(modulePath, useImport = false) {
48
45
  try {
@@ -66,7 +63,6 @@ export async function loadPlugin(modulePath, useImport = false) {
66
63
  /**
67
64
  * @param modulePathList The plugin name list.
68
65
  * @returns The import result for the list of modules.
69
- * @public
70
66
  */
71
67
  export async function loadPlugins(modulePathList) {
72
68
  const limit = pLimit(5);
@@ -75,7 +71,6 @@ export async function loadPlugins(modulePathList) {
75
71
  }
76
72
  /**
77
73
  * Load any built-in plugin.
78
- * @public
79
74
  */
80
75
  export function loadBuiltIn(builtIn) {
81
76
  return loadPlugin(builtInImportMap[builtIn], true);
@@ -83,7 +78,6 @@ export function loadBuiltIn(builtIn) {
83
78
  /**
84
79
  * @param modulePathList The plugin name list.
85
80
  * @returns The import result for the list of modules.
86
- * @public
87
81
  */
88
82
  export async function loadBuiltIns(builtInList = [...builtInNameList]) {
89
83
  const limit = pLimit(5);
@@ -0,0 +1,3 @@
1
+ import { type Plugins } from '../../index.js';
2
+ declare const git: Plugins.PluginExport;
3
+ export default git;
@@ -6,7 +6,7 @@ const name = 'Git';
6
6
  const icon = { ...icons['nf-seti-git'], color: '#F44E28' };
7
7
  const testCommand = 'git ls-tree -r <git-branch-name> --name-only';
8
8
  /**
9
- * @private
9
+ * @internal
10
10
  */
11
11
  export const matcherExclude = [
12
12
  '**/.git/**',
@@ -17,7 +17,7 @@ export const matcherExclude = [
17
17
  * @param map The output.
18
18
  * @param scanner The scanner.
19
19
  * @param sourceFile This file will be converted to a {@link SourceInfo}.
20
- * @private
20
+ * @internal
21
21
  */
22
22
  export function useSourceFile(map, sourceFile, scanner) {
23
23
  const sourceInfo = SourceInfo.from(sourceFile, scanner);
@@ -31,7 +31,7 @@ export function useSourceFile(map, sourceFile, scanner) {
31
31
  }
32
32
  /**
33
33
  * @param base The name for gitignore-like file.
34
- * @private
34
+ * @internal
35
35
  */
36
36
  export const methodologyGitignoreLike = (base) => function (tree, o) {
37
37
  const sourceList = tree.deep(File).filter(dirent => dirent.base === base);
@@ -0,0 +1,3 @@
1
+ import { type Plugins } from '../../index.js';
2
+ declare const npm: Plugins.PluginExport;
3
+ export default npm;
@@ -0,0 +1,96 @@
1
+ import { icons } from '@m234/nerd-fonts';
2
+ import { z } from 'zod';
3
+ import { Directory, InvalidPatternError, BadSourceError, } from '../../index.js';
4
+ import { ScannerGitignore } from '../scanner.js';
5
+ import * as git from './git.js';
6
+ const id = 'jsr';
7
+ const name = 'JSR';
8
+ const icon = { ...icons['nf-ple-pixelated_squares_big'], color: '#F5DD1E' };
9
+ /**
10
+ * @internal
11
+ */
12
+ export const matcherExclude = [];
13
+ /**
14
+ * @internal
15
+ */
16
+ export const matcherInclude = [];
17
+ /**
18
+ * @internal
19
+ */
20
+ export function isValidManifestJsr(value) {
21
+ return z.object({
22
+ name: z.string(),
23
+ version: z.string(),
24
+ exports: z.string(),
25
+ exclude: z.array(z.string()).optional(),
26
+ include: z.array(z.string()).optional(),
27
+ publish: z.object({
28
+ exclude: z.array(z.string()).optional(),
29
+ include: z.array(z.string()).optional(),
30
+ }).optional(),
31
+ }).safeParse(value).success;
32
+ }
33
+ /**
34
+ * @internal
35
+ */
36
+ export function useChildren(tree, map, getMap) {
37
+ for (const child of tree.children.values()) {
38
+ if (!(child instanceof Directory)) {
39
+ continue;
40
+ }
41
+ const submap = getMap(child);
42
+ for (const [key, value] of submap.entries()) {
43
+ map.set(key, value);
44
+ }
45
+ }
46
+ return map;
47
+ }
48
+ /**
49
+ * @internal
50
+ */
51
+ export const sourceSearch = (priority, scanner) => function (tree, o) {
52
+ const map = new Map();
53
+ for (const element of priority) {
54
+ const sourceFile = tree.get(element);
55
+ if (sourceFile === undefined) {
56
+ continue;
57
+ }
58
+ if (/^(deno|jsr).jsonc?$/.test(sourceFile.base)) {
59
+ const manifest = JSON.parse(o.modules.fs.readFileSync(sourceFile.absolutePath).toString());
60
+ if (!isValidManifestJsr(manifest)) {
61
+ throw new BadSourceError(sourceFile, 'Must have \'name\', \'version\'.');
62
+ }
63
+ const { exclude, include, publish } = manifest;
64
+ if (exclude === undefined && include === undefined && publish === undefined) {
65
+ continue;
66
+ }
67
+ const pattern = publish?.include ?? include;
68
+ if (!scanner.isValid(pattern)) {
69
+ throw new BadSourceError(sourceFile, `Invalid pattern, got ${JSON.stringify(pattern)}`);
70
+ }
71
+ scanner.negated = true;
72
+ scanner.pattern = pattern;
73
+ if (Array.isArray(scanner.exclude)) {
74
+ scanner.exclude.push(...(publish?.exclude ?? exclude ?? []));
75
+ }
76
+ }
77
+ else {
78
+ const content = o.modules.fs.readFileSync(sourceFile.absolutePath).toString();
79
+ const pattern = content;
80
+ if (!scanner.isValid(pattern)) {
81
+ throw new InvalidPatternError(sourceFile, pattern);
82
+ }
83
+ scanner.negated = false;
84
+ scanner.pattern = pattern;
85
+ }
86
+ return git.useSourceFile(map, sourceFile, scanner);
87
+ }
88
+ return useChildren(tree, map, child => sourceSearch(priority, scanner)(child, o));
89
+ };
90
+ const bind = {
91
+ id, icon, name, scanOptions: {
92
+ target: sourceSearch(['deno.json', 'deno.jsonc', 'jsr.json', 'jsr.jsonc'], new ScannerGitignore({ exclude: matcherExclude, include: matcherInclude })),
93
+ },
94
+ };
95
+ const npm = { viewignored: { addTargets: [bind] } };
96
+ export default npm;
@@ -0,0 +1,3 @@
1
+ import { type Plugins } from '../../index.js';
2
+ declare const npm: Plugins.PluginExport;
3
+ export default npm;
@@ -1,4 +1,5 @@
1
1
  import { icons } from '@m234/nerd-fonts';
2
+ import { z } from 'zod';
2
3
  import { Directory, InvalidPatternError, BadSourceError, NoSourceError, } from '../../index.js';
3
4
  import { ScannerGitignore } from '../scanner.js';
4
5
  import * as git from './git.js';
@@ -7,7 +8,7 @@ const name = 'NPM';
7
8
  const icon = { ...icons['nf-seti-npm'], color: '#CA0404' };
8
9
  const testCommand = 'npm pack --dry-run';
9
10
  /**
10
- * @private
11
+ * @internal
11
12
  */
12
13
  export const matcherExclude = [
13
14
  ...git.matcherExclude,
@@ -28,7 +29,7 @@ export const matcherExclude = [
28
29
  '**/npm-debug.log',
29
30
  ];
30
31
  /**
31
- * @private
32
+ * @internal
32
33
  */
33
34
  export const matcherInclude = [
34
35
  'bin/**',
@@ -38,19 +39,17 @@ export const matcherInclude = [
38
39
  'LICENCE*',
39
40
  ];
40
41
  /**
41
- * @private
42
+ * @internal
42
43
  */
43
- export function isValidManifest(value) {
44
- if (value?.constructor !== Object) {
45
- return false;
46
- }
47
- const value_ = value;
48
- return ('name' in value_ && typeof value_.name === 'string')
49
- && ('version' in value_ && typeof value_.version === 'string')
50
- && (value_.files === undefined || (Array.isArray(value_.files) && value_.files.every(element => typeof element === 'string')));
44
+ export function isValidManifestPackageJson(value) {
45
+ return z.object({
46
+ name: z.string(),
47
+ version: z.string(),
48
+ files: z.array(z.string()).optional(),
49
+ }).safeParse(value).success;
51
50
  }
52
51
  /**
53
- * @private
52
+ * @internal
54
53
  */
55
54
  export function useChildren(tree, map, getMap) {
56
55
  for (const child of tree.children.values()) {
@@ -65,7 +64,7 @@ export function useChildren(tree, map, getMap) {
65
64
  return map;
66
65
  }
67
66
  /**
68
- * @private
67
+ * @internal
69
68
  */
70
69
  export const sourceSearch = (priority, scanner) => function (tree, o) {
71
70
  const map = new Map();
@@ -76,7 +75,7 @@ export const sourceSearch = (priority, scanner) => function (tree, o) {
76
75
  }
77
76
  if (sourceFile.base === 'package.json') {
78
77
  const manifest = JSON.parse(o.modules.fs.readFileSync(sourceFile.absolutePath).toString());
79
- if (!isValidManifest(manifest)) {
78
+ if (!isValidManifestPackageJson(manifest)) {
80
79
  throw new BadSourceError(sourceFile, 'Must have \'name\', \'version\' and \'files\'.');
81
80
  }
82
81
  const { files: pattern } = manifest;
@@ -105,7 +104,7 @@ export const sourceSearch = (priority, scanner) => function (tree, o) {
105
104
  /**
106
105
  * @param priority The list of file names from highest to lowest priority.
107
106
  * @param scanner The pattern scanner.
108
- * @private
107
+ * @internal
109
108
  */
110
109
  export const methodologyManifestNpmLike = (priority, scanner) => function (tree, o) {
111
110
  const packageJson = tree.get('package.json');
@@ -123,7 +122,7 @@ export const methodologyManifestNpmLike = (priority, scanner) => function (tree,
123
122
  }
124
123
  throw error;
125
124
  }
126
- if (!isValidManifest(manifest)) {
125
+ if (!isValidManifestPackageJson(manifest)) {
127
126
  throw new BadSourceError(packageJson, 'Must have \'name\', \'version\' and \'files\'.');
128
127
  }
129
128
  return sourceSearch(priority, scanner)(tree, o);
@@ -0,0 +1,3 @@
1
+ import { type Plugins } from '../../index.js';
2
+ declare const vsce: Plugins.PluginExport;
3
+ export default vsce;
@@ -6,13 +6,13 @@ const name = 'VSCE';
6
6
  const icon = { ...icons['nf-md-microsoft_visual_studio_code'], color: '#23A9F1' };
7
7
  const testCommand = 'vsce ls';
8
8
  /**
9
- * @private
9
+ * @internal
10
10
  */
11
11
  export const matcherExclude = [
12
12
  ...git.matcherExclude,
13
13
  ];
14
14
  /**
15
- * @private
15
+ * @internal
16
16
  */
17
17
  export function isValidManifest(value) {
18
18
  if (value?.constructor !== Object) {
@@ -29,7 +29,7 @@ export function isValidManifest(value) {
29
29
  return 'vscode' in engines && typeof engines.vscode === 'string';
30
30
  }
31
31
  /**
32
- * @private
32
+ * @internal
33
33
  */
34
34
  export const methodologyManifestVsce = function (tree, o) {
35
35
  const packageJson = [...tree.deepIterator()].find(dirent => dirent instanceof File && dirent.base === 'package.json');
@@ -0,0 +1,3 @@
1
+ import { type Plugins } from '../../index.js';
2
+ declare const yarn: Plugins.PluginExport;
3
+ export default yarn;
@@ -5,7 +5,7 @@ const id = 'yarn';
5
5
  const name = 'Yarn';
6
6
  const icon = { ...icons['nf-seti-yarn'], color: '#2E2A65' };
7
7
  /**
8
- * @private
8
+ * @internal
9
9
  */
10
10
  export const matcherExclude = [
11
11
  ...npm.matcherExclude,
@@ -13,7 +13,7 @@ export const matcherExclude = [
13
13
  '.yarnrc',
14
14
  ];
15
15
  /**
16
- * @private
16
+ * @internal
17
17
  */
18
18
  export const matcherInclude = [
19
19
  ...npm.matcherInclude,
@@ -1,16 +1,10 @@
1
1
  import { type Scanner } from '../lib.js';
2
- /**
3
- * @public
4
- */
5
2
  export type PatternScannerOptions = {
6
3
  pattern?: string | string[];
7
4
  exclude?: string | string[];
8
5
  include?: string | string[];
9
6
  negated?: boolean;
10
7
  };
11
- /**
12
- * @public
13
- */
14
8
  export type PatternScanner = Scanner & {
15
9
  pattern: string | string[];
16
10
  exclude: string | string[];
@@ -21,9 +15,6 @@ export type PatternScanner = Scanner & {
21
15
  ignores(path: string, options?: PatternScannerOptions): boolean;
22
16
  ignores(path: string, argument?: PatternScannerOptions | string | string[]): boolean;
23
17
  };
24
- /**
25
- * @public
26
- */
27
18
  export declare class ScannerMinimatch implements PatternScanner {
28
19
  negated: boolean;
29
20
  protected _pattern: string | string[];
@@ -40,9 +31,6 @@ export declare class ScannerMinimatch implements PatternScanner {
40
31
  ignores(path: string, pattern: string | string[]): boolean;
41
32
  ignores(path: string, options?: PatternScannerOptions): boolean;
42
33
  }
43
- /**
44
- * @public
45
- */
46
34
  export declare class ScannerGitignore extends ScannerMinimatch {
47
35
  private static gitignoreToMinimatch;
48
36
  constructor(options?: PatternScannerOptions);
@@ -1,8 +1,5 @@
1
1
  import { minimatch } from 'minimatch';
2
2
  import { gitignoreToMinimatch } from '@humanwhocodes/gitignore-to-minimatch';
3
- /**
4
- * @public
5
- */
6
3
  export class ScannerMinimatch {
7
4
  negated;
8
5
  _pattern;
@@ -69,9 +66,6 @@ export class ScannerMinimatch {
69
66
  return (argument?.negated ?? this.negated) ? !check : check;
70
67
  }
71
68
  }
72
- /**
73
- * @public
74
- */
75
69
  export class ScannerGitignore extends ScannerMinimatch {
76
70
  static gitignoreToMinimatch(argument) {
77
71
  if (typeof argument === 'string') {
@@ -1,7 +1,6 @@
1
1
  import { type ScanOptions } from '../lib.js';
2
2
  /**
3
3
  * The target icon/logo as a {@link https://www.nerdfonts.com/ NF} icon.
4
- * @public
5
4
  */
6
5
  export type TargetIcon = {
7
6
  /**
@@ -13,25 +12,19 @@ export type TargetIcon = {
13
12
  */
14
13
  color?: string;
15
14
  };
16
- /**
17
- * @public
18
- */
19
15
  export type TargetName = string;
20
16
  /**
21
17
  * Should satisfy RegExp: `/^[-a-zA-Z0-9]+$/`.
22
- * @public
23
18
  */
24
19
  export type TargetId = string;
25
20
  /**
26
21
  * @param value Target's id. Simple name.
27
22
  * @returns `true`, if the id is available for binding.
28
- * @public
29
23
  */
30
24
  export declare function isTargetId(value: unknown): value is TargetId;
31
25
  /**
32
26
  * The bind which allows use predefined options for scan functions.
33
27
  * @see {@link scanFolder}
34
- * @public
35
28
  */
36
29
  export type TargetBind = {
37
30
  /**
@@ -61,12 +54,10 @@ export type TargetBind = {
61
54
  };
62
55
  /**
63
56
  * Checks if the value is the {@link TargetBind}.
64
- * @public
65
57
  */
66
58
  export declare function isTargetBind(value: unknown): value is TargetBind;
67
59
  /**
68
60
  * Allows to create targets for view-ignored scan* functions.
69
- * @public
70
61
  * @example
71
62
  * scanFolder("abc") // error
72
63
  * Bindings.targetSet("abc", {...})
@@ -75,7 +66,6 @@ export declare function isTargetBind(value: unknown): value is TargetBind;
75
66
  export declare function targetSet(bind: TargetBind): void;
76
67
  /**
77
68
  * Get all target ids.
78
- * @public
79
69
  * @example
80
70
  * ["git", "npm", "vsce", ...]
81
71
  */
@@ -83,6 +73,5 @@ export declare function targetList(): string[];
83
73
  /**
84
74
  * Get target bind by target id.
85
75
  * @param id Target id.
86
- * @public
87
76
  */
88
77
  export declare function targetGet(id: TargetId): TargetBind | undefined;
@@ -1,26 +1,23 @@
1
1
  /**
2
2
  * @param value Target's id. Simple name.
3
3
  * @returns `true`, if the id is available for binding.
4
- * @public
5
4
  */
6
5
  export function isTargetId(value) {
7
6
  return typeof value === 'string' && (/^[-a-zA-Z\d]+$/.exec(value)) !== null;
8
7
  }
9
8
  /**
10
9
  * Checks if the value is the {@link TargetBind}.
11
- * @public
12
10
  */
13
11
  export function isTargetBind(value) {
14
12
  return value?.constructor === Object;
15
13
  }
16
14
  /**
17
15
  * The container for binds: id=bind.
18
- * @private
16
+ * @internal
19
17
  */
20
18
  const targetBindMap = new Map();
21
19
  /**
22
20
  * Allows to create targets for view-ignored scan* functions.
23
- * @public
24
21
  * @example
25
22
  * scanFolder("abc") // error
26
23
  * Bindings.targetSet("abc", {...})
@@ -31,7 +28,6 @@ export function targetSet(bind) {
31
28
  }
32
29
  /**
33
30
  * Get all target ids.
34
- * @public
35
31
  * @example
36
32
  * ["git", "npm", "vsce", ...]
37
33
  */
@@ -42,7 +38,6 @@ export function targetList() {
42
38
  /**
43
39
  * Get target bind by target id.
44
40
  * @param id Target id.
45
- * @public
46
41
  */
47
42
  export function targetGet(id) {
48
43
  return targetBindMap.get(id);
@@ -1,13 +1,7 @@
1
1
  import { type File } from './lib.js';
2
- /**
3
- * @public
4
- */
5
2
  export declare class ViewIgnoredError extends Error {
6
3
  name: string;
7
4
  }
8
- /**
9
- * @public
10
- */
11
5
  export declare class NoSourceError extends ViewIgnoredError {
12
6
  static joinOr(fileBaseList: string[]): string;
13
7
  static joinAnd(fileBaseList: string[]): string;
@@ -25,9 +19,6 @@ export declare class NoSourceError extends ViewIgnoredError {
25
19
  */
26
20
  constructor(file: File);
27
21
  }
28
- /**
29
- * @public
30
- */
31
22
  export declare class BadSourceError extends ViewIgnoredError {
32
23
  name: string;
33
24
  /**
@@ -45,16 +36,10 @@ export declare class BadSourceError extends ViewIgnoredError {
45
36
  */
46
37
  constructor(file: File, message: string);
47
38
  }
48
- /**
49
- * @public
50
- */
51
39
  export declare class InvalidPatternError extends ViewIgnoredError {
52
40
  name: string;
53
41
  constructor(file: File, pattern?: string | string[]);
54
42
  }
55
- /**
56
- * @public
57
- */
58
43
  export declare class TargetNotBoundError extends ViewIgnoredError {
59
44
  name: string;
60
45
  constructor(targetId: string);
@@ -1,12 +1,6 @@
1
- /**
2
- * @public
3
- */
4
1
  export class ViewIgnoredError extends Error {
5
2
  name = 'ViewIgnoredError';
6
3
  }
7
- /**
8
- * @public
9
- */
10
4
  export class NoSourceError extends ViewIgnoredError {
11
5
  static joinOr(fileBaseList) {
12
6
  return fileBaseList.map(base => `'${base}'`).join(' or ');
@@ -19,27 +13,18 @@ export class NoSourceError extends ViewIgnoredError {
19
13
  super(`There was no configuration file (${typeof argument0 === 'string' ? argument0 : argument0.relativePath}) in the folders and subfolders that would correctly describe the ignoring.`);
20
14
  }
21
15
  }
22
- /**
23
- * @public
24
- */
25
16
  export class BadSourceError extends ViewIgnoredError {
26
17
  name = 'BadSourceError';
27
18
  constructor(argument0, message) {
28
19
  super(`Invalid ${typeof argument0 === 'string' ? argument0 : argument0.relativePath}: ${message}`);
29
20
  }
30
21
  }
31
- /**
32
- * @public
33
- */
34
22
  export class InvalidPatternError extends ViewIgnoredError {
35
23
  name = 'InvalidPatternError';
36
24
  constructor(file, pattern) {
37
25
  super(`Invalid pattern in ${file.relativePath}: ${pattern === undefined ? '' : ` Pattern: ${JSON.stringify(pattern)}`}`);
38
26
  }
39
27
  }
40
- /**
41
- * @public
42
- */
43
28
  export class TargetNotBoundError extends ViewIgnoredError {
44
29
  name = 'TargetNotBoundError';
45
30
  constructor(targetId) {