linguist-js 2.5.5 → 2.5.6
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/dist/cli.d.ts +1 -1
- package/dist/cli.js +107 -107
- package/dist/helpers/convert-pcre.js +38 -38
- package/dist/helpers/load-data.js +31 -30
- package/dist/helpers/read-file.js +23 -23
- package/dist/helpers/walk-tree.js +64 -64
- package/dist/index.d.ts +4 -4
- package/dist/index.js +375 -375
- package/dist/schema.d.ts +37 -37
- package/dist/schema.js +2 -2
- package/dist/types.d.ts +47 -47
- package/dist/types.js +2 -2
- package/ext/heuristics.yml +804 -791
- package/package.json +4 -4
package/dist/schema.d.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { Category, Language } from './types';
|
|
2
|
-
export interface LanguagesScema {
|
|
3
|
-
[name: string]: {
|
|
4
|
-
language_id: number;
|
|
5
|
-
fs_name?: Language;
|
|
6
|
-
type: Category;
|
|
7
|
-
group?: Language;
|
|
8
|
-
color?: `#${string}`;
|
|
9
|
-
aliases?: string[];
|
|
10
|
-
extensions?: `.${string}`[];
|
|
11
|
-
filenames?: string[];
|
|
12
|
-
interpreters?: string[];
|
|
13
|
-
tm_scope?: `${'source' | 'text'}.${string}`;
|
|
14
|
-
ace_mode?: string;
|
|
15
|
-
codemirror_mode?: string;
|
|
16
|
-
codemirror_mime_type?: `${string}/${string}`;
|
|
17
|
-
wrap?: boolean;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
interface HeuristicsRules {
|
|
21
|
-
pattern?: string;
|
|
22
|
-
named_pattern?: string;
|
|
23
|
-
named_patterns?: string[];
|
|
24
|
-
negative_pattern?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface HeuristicsSchema {
|
|
27
|
-
disambiguations: Array<{
|
|
28
|
-
extensions: string[];
|
|
29
|
-
rules: Array<HeuristicsRules & {
|
|
30
|
-
language: string | string[];
|
|
31
|
-
and?: HeuristicsRules[];
|
|
32
|
-
}>;
|
|
33
|
-
}>;
|
|
34
|
-
named_patterns: Record<string, string | string[]>;
|
|
35
|
-
}
|
|
36
|
-
export type VendorSchema = string[];
|
|
37
|
-
export {};
|
|
1
|
+
import { Category, Language } from './types';
|
|
2
|
+
export interface LanguagesScema {
|
|
3
|
+
[name: string]: {
|
|
4
|
+
language_id: number;
|
|
5
|
+
fs_name?: Language;
|
|
6
|
+
type: Category;
|
|
7
|
+
group?: Language;
|
|
8
|
+
color?: `#${string}`;
|
|
9
|
+
aliases?: string[];
|
|
10
|
+
extensions?: `.${string}`[];
|
|
11
|
+
filenames?: string[];
|
|
12
|
+
interpreters?: string[];
|
|
13
|
+
tm_scope?: `${'source' | 'text'}.${string}`;
|
|
14
|
+
ace_mode?: string;
|
|
15
|
+
codemirror_mode?: string;
|
|
16
|
+
codemirror_mime_type?: `${string}/${string}`;
|
|
17
|
+
wrap?: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface HeuristicsRules {
|
|
21
|
+
pattern?: string;
|
|
22
|
+
named_pattern?: string;
|
|
23
|
+
named_patterns?: string[];
|
|
24
|
+
negative_pattern?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface HeuristicsSchema {
|
|
27
|
+
disambiguations: Array<{
|
|
28
|
+
extensions: string[];
|
|
29
|
+
rules: Array<HeuristicsRules & {
|
|
30
|
+
language: string | string[];
|
|
31
|
+
and?: HeuristicsRules[];
|
|
32
|
+
}>;
|
|
33
|
+
}>;
|
|
34
|
+
named_patterns: Record<string, string | string[]>;
|
|
35
|
+
}
|
|
36
|
+
export declare type VendorSchema = string[];
|
|
37
|
+
export {};
|
package/dist/schema.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/types.d.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
export type LanguageResult = string | null;
|
|
2
|
-
export type Language = string;
|
|
3
|
-
export type Category = 'data' | 'markup' | 'programming' | 'prose';
|
|
4
|
-
export type FilePath = string;
|
|
5
|
-
export type Bytes = Integer;
|
|
6
|
-
export type Integer = number;
|
|
7
|
-
export interface Options {
|
|
8
|
-
fileContent?: string | string[];
|
|
9
|
-
ignoredFiles?: string[];
|
|
10
|
-
ignoredLanguages?: Language[];
|
|
11
|
-
categories?: Category[];
|
|
12
|
-
keepVendored?: boolean;
|
|
13
|
-
keepBinary?: boolean;
|
|
14
|
-
relativePaths?: boolean;
|
|
15
|
-
childLanguages?: boolean;
|
|
16
|
-
quick?: boolean;
|
|
17
|
-
offline?: boolean;
|
|
18
|
-
checkIgnored?: boolean;
|
|
19
|
-
checkAttributes?: boolean;
|
|
20
|
-
checkHeuristics?: boolean;
|
|
21
|
-
checkShebang?: boolean;
|
|
22
|
-
checkModeline?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface Results {
|
|
25
|
-
files: {
|
|
26
|
-
count: Integer;
|
|
27
|
-
bytes: Bytes;
|
|
28
|
-
/** Note: Results use slashes as delimiters even on Windows. */
|
|
29
|
-
results: Record<FilePath, LanguageResult>;
|
|
30
|
-
};
|
|
31
|
-
languages: {
|
|
32
|
-
count: Integer;
|
|
33
|
-
bytes: Bytes;
|
|
34
|
-
results: Record<Language, {
|
|
35
|
-
bytes: Bytes;
|
|
36
|
-
type: Category;
|
|
37
|
-
parent?: Language;
|
|
38
|
-
color?: `#${string}`;
|
|
39
|
-
}>;
|
|
40
|
-
};
|
|
41
|
-
unknown: {
|
|
42
|
-
count: Integer;
|
|
43
|
-
bytes: Bytes;
|
|
44
|
-
extensions: Record<string, Bytes>;
|
|
45
|
-
filenames: Record<string, Bytes>;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
1
|
+
export declare type LanguageResult = string | null;
|
|
2
|
+
export declare type Language = string;
|
|
3
|
+
export declare type Category = 'data' | 'markup' | 'programming' | 'prose';
|
|
4
|
+
export declare type FilePath = string;
|
|
5
|
+
export declare type Bytes = Integer;
|
|
6
|
+
export declare type Integer = number;
|
|
7
|
+
export interface Options {
|
|
8
|
+
fileContent?: string | string[];
|
|
9
|
+
ignoredFiles?: string[];
|
|
10
|
+
ignoredLanguages?: Language[];
|
|
11
|
+
categories?: Category[];
|
|
12
|
+
keepVendored?: boolean;
|
|
13
|
+
keepBinary?: boolean;
|
|
14
|
+
relativePaths?: boolean;
|
|
15
|
+
childLanguages?: boolean;
|
|
16
|
+
quick?: boolean;
|
|
17
|
+
offline?: boolean;
|
|
18
|
+
checkIgnored?: boolean;
|
|
19
|
+
checkAttributes?: boolean;
|
|
20
|
+
checkHeuristics?: boolean;
|
|
21
|
+
checkShebang?: boolean;
|
|
22
|
+
checkModeline?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface Results {
|
|
25
|
+
files: {
|
|
26
|
+
count: Integer;
|
|
27
|
+
bytes: Bytes;
|
|
28
|
+
/** Note: Results use slashes as delimiters even on Windows. */
|
|
29
|
+
results: Record<FilePath, LanguageResult>;
|
|
30
|
+
};
|
|
31
|
+
languages: {
|
|
32
|
+
count: Integer;
|
|
33
|
+
bytes: Bytes;
|
|
34
|
+
results: Record<Language, {
|
|
35
|
+
bytes: Bytes;
|
|
36
|
+
type: Category;
|
|
37
|
+
parent?: Language;
|
|
38
|
+
color?: `#${string}`;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
unknown: {
|
|
42
|
+
count: Integer;
|
|
43
|
+
bytes: Bytes;
|
|
44
|
+
extensions: Record<string, Bytes>;
|
|
45
|
+
filenames: Record<string, Bytes>;
|
|
46
|
+
};
|
|
47
|
+
}
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|