@retorquere/bibtex-parser 9.0.22 → 9.0.25

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 (66) hide show
  1. package/dist/cjs/crossref.js +209 -0
  2. package/dist/cjs/crossref.js.map +7 -0
  3. package/dist/cjs/fields.js +6961 -0
  4. package/dist/cjs/fields.js.map +7 -0
  5. package/dist/cjs/index.js +1072 -0
  6. package/dist/cjs/index.js.map +7 -0
  7. package/dist/cjs/jabref.js +111 -0
  8. package/dist/cjs/jabref.js.map +7 -0
  9. package/dist/cjs/merge.js +37 -0
  10. package/dist/cjs/merge.js.map +7 -0
  11. package/dist/cjs/prepositions.js +111 -0
  12. package/dist/cjs/prepositions.js.map +7 -0
  13. package/dist/cjs/sentence-case.js +98 -0
  14. package/dist/cjs/sentence-case.js.map +7 -0
  15. package/dist/cjs/tokenizer.js +194 -0
  16. package/dist/cjs/tokenizer.js.map +7 -0
  17. package/dist/cjs/verbatim.js +403 -0
  18. package/dist/cjs/verbatim.js.map +7 -0
  19. package/dist/cjs/yield.js +26 -0
  20. package/dist/cjs/yield.js.map +7 -0
  21. package/dist/data/crossref.json +186 -0
  22. package/dist/data/fields.json +6938 -0
  23. package/dist/data/prepositions.json +88 -0
  24. package/dist/esm/crossref.js +190 -0
  25. package/dist/esm/crossref.js.map +7 -0
  26. package/dist/esm/fields.js +6942 -0
  27. package/dist/esm/fields.js.map +7 -0
  28. package/dist/esm/index.js +1044 -0
  29. package/dist/esm/index.js.map +7 -0
  30. package/dist/esm/jabref.js +92 -0
  31. package/dist/esm/jabref.js.map +7 -0
  32. package/dist/esm/merge.js +8 -0
  33. package/dist/esm/merge.js.map +7 -0
  34. package/dist/esm/prepositions.js +92 -0
  35. package/dist/esm/prepositions.js.map +7 -0
  36. package/dist/esm/sentence-case.js +79 -0
  37. package/dist/esm/sentence-case.js.map +7 -0
  38. package/dist/esm/tokenizer.js +170 -0
  39. package/dist/esm/tokenizer.js.map +7 -0
  40. package/dist/esm/verbatim.js +387 -0
  41. package/dist/esm/verbatim.js.map +7 -0
  42. package/dist/esm/yield.js +7 -0
  43. package/dist/esm/yield.js.map +7 -0
  44. package/dist/types/crossref.d.ts +188 -0
  45. package/dist/types/crossref.d.ts.map +1 -0
  46. package/dist/types/fields.d.ts +55 -0
  47. package/dist/types/fields.d.ts.map +1 -0
  48. package/dist/types/index.d.ts +194 -0
  49. package/dist/types/index.d.ts.map +1 -0
  50. package/dist/types/jabref.d.ts +58 -0
  51. package/dist/types/jabref.d.ts.map +1 -0
  52. package/dist/types/merge.d.ts +2 -0
  53. package/dist/types/merge.d.ts.map +1 -0
  54. package/dist/types/prepositions.d.ts +3 -0
  55. package/dist/types/prepositions.d.ts.map +1 -0
  56. package/dist/types/sentence-case.d.ts +9 -0
  57. package/dist/types/sentence-case.d.ts.map +1 -0
  58. package/dist/types/tokenizer.d.ts +13 -0
  59. package/dist/types/tokenizer.d.ts.map +1 -0
  60. package/dist/types/verbatim.d.ts +66 -0
  61. package/dist/types/verbatim.d.ts.map +1 -0
  62. package/dist/types/yield.d.ts +2 -0
  63. package/dist/types/yield.d.ts.map +1 -0
  64. package/package.json +4 -31
  65. /package/{strings.bib → dist/data/strings.bib} +0 -0
  66. /package/{unabbrev.json → dist/data/unabbrev.json} +0 -0
@@ -0,0 +1,188 @@
1
+ declare const _default: {
2
+ '*': {
3
+ '*': {
4
+ verbb: string;
5
+ };
6
+ };
7
+ article: {
8
+ periodical: {
9
+ journalsubtitle: string;
10
+ journaltitle: string;
11
+ };
12
+ };
13
+ book: {
14
+ mvbook: {
15
+ mainsubtitle: string;
16
+ maintitle: string;
17
+ maintitleaddon: string;
18
+ };
19
+ };
20
+ bookinbook: {
21
+ book: {
22
+ author: string;
23
+ bookauthor: string;
24
+ booksubtitle: string;
25
+ booktitle: string;
26
+ booktitleaddon: string;
27
+ };
28
+ mvbook: {
29
+ author: string;
30
+ bookauthor: string;
31
+ mainsubtitle: string;
32
+ maintitle: string;
33
+ maintitleaddon: string;
34
+ };
35
+ };
36
+ collection: {
37
+ mvcollection: {
38
+ mainsubtitle: string;
39
+ maintitle: string;
40
+ maintitleaddon: string;
41
+ };
42
+ mvreference: {
43
+ mainsubtitle: string;
44
+ maintitle: string;
45
+ maintitleaddon: string;
46
+ };
47
+ };
48
+ inbook: {
49
+ '*': {
50
+ bookauthor: string;
51
+ };
52
+ book: {
53
+ author: string;
54
+ bookauthor: string;
55
+ booksubtitle: string;
56
+ booktitle: string;
57
+ booktitleaddon: string;
58
+ };
59
+ mvbook: {
60
+ author: string;
61
+ bookauthor: string;
62
+ mainsubtitle: string;
63
+ maintitle: string;
64
+ maintitleaddon: string;
65
+ };
66
+ };
67
+ incollection: {
68
+ collection: {
69
+ booksubtitle: string;
70
+ booktitle: string;
71
+ booktitleaddon: string;
72
+ };
73
+ mvcollection: {
74
+ mainsubtitle: string;
75
+ maintitle: string;
76
+ maintitleaddon: string;
77
+ };
78
+ mvreference: {
79
+ mainsubtitle: string;
80
+ maintitle: string;
81
+ maintitleaddon: string;
82
+ };
83
+ reference: {
84
+ booksubtitle: string;
85
+ booktitle: string;
86
+ booktitleaddon: string;
87
+ };
88
+ };
89
+ inproceedings: {
90
+ mvproceedings: {
91
+ mainsubtitle: string;
92
+ maintitle: string;
93
+ maintitleaddon: string;
94
+ };
95
+ proceedings: {
96
+ booksubtitle: string;
97
+ booktitle: string;
98
+ booktitleaddon: string;
99
+ };
100
+ };
101
+ inreference: {
102
+ collection: {
103
+ booksubtitle: string;
104
+ booktitle: string;
105
+ booktitleaddon: string;
106
+ };
107
+ mvcollection: {
108
+ mainsubtitle: string;
109
+ maintitle: string;
110
+ maintitleaddon: string;
111
+ };
112
+ mvreference: {
113
+ mainsubtitle: string;
114
+ maintitle: string;
115
+ maintitleaddon: string;
116
+ };
117
+ reference: {
118
+ booksubtitle: string;
119
+ booktitle: string;
120
+ booktitleaddon: string;
121
+ };
122
+ };
123
+ proceedings: {
124
+ mvproceedings: {
125
+ mainsubtitle: string;
126
+ maintitle: string;
127
+ maintitleaddon: string;
128
+ };
129
+ };
130
+ reference: {
131
+ mvcollection: {
132
+ mainsubtitle: string;
133
+ maintitle: string;
134
+ maintitleaddon: string;
135
+ };
136
+ mvreference: {
137
+ mainsubtitle: string;
138
+ maintitle: string;
139
+ maintitleaddon: string;
140
+ };
141
+ };
142
+ suppbook: {
143
+ book: {
144
+ author: string;
145
+ bookauthor: string;
146
+ booksubtitle: string;
147
+ booktitle: string;
148
+ booktitleaddon: string;
149
+ };
150
+ mvbook: {
151
+ author: string;
152
+ bookauthor: string;
153
+ mainsubtitle: string;
154
+ maintitle: string;
155
+ maintitleaddon: string;
156
+ };
157
+ };
158
+ suppcollection: {
159
+ collection: {
160
+ booksubtitle: string;
161
+ booktitle: string;
162
+ booktitleaddon: string;
163
+ };
164
+ mvcollection: {
165
+ mainsubtitle: string;
166
+ maintitle: string;
167
+ maintitleaddon: string;
168
+ };
169
+ mvreference: {
170
+ mainsubtitle: string;
171
+ maintitle: string;
172
+ maintitleaddon: string;
173
+ };
174
+ reference: {
175
+ booksubtitle: string;
176
+ booktitle: string;
177
+ booktitleaddon: string;
178
+ };
179
+ };
180
+ suppperiodical: {
181
+ periodical: {
182
+ journalsubtitle: string;
183
+ journaltitle: string;
184
+ };
185
+ };
186
+ };
187
+ export default _default;
188
+ //# sourceMappingURL=crossref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crossref.d.ts","sourceRoot":"","sources":["../../crossref.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAyLC"}
@@ -0,0 +1,55 @@
1
+ declare const _default: {
2
+ article: string[];
3
+ artwork: string[];
4
+ audio: string[];
5
+ bibnote: string[];
6
+ book: string[];
7
+ bookinbook: string[];
8
+ booklet: string[];
9
+ collection: string[];
10
+ commentary: string[];
11
+ customa: string[];
12
+ customb: string[];
13
+ customc: string[];
14
+ customd: string[];
15
+ custome: string[];
16
+ customf: string[];
17
+ dataset: string[];
18
+ image: string[];
19
+ inbook: string[];
20
+ incollection: string[];
21
+ inproceedings: string[];
22
+ inreference: string[];
23
+ jurisdiction: string[];
24
+ legal: string[];
25
+ legislation: string[];
26
+ letter: string[];
27
+ manual: string[];
28
+ misc: string[];
29
+ movie: string[];
30
+ music: string[];
31
+ mvbook: string[];
32
+ mvcollection: string[];
33
+ mvproceedings: string[];
34
+ mvreference: string[];
35
+ online: string[];
36
+ patent: string[];
37
+ performance: string[];
38
+ periodical: string[];
39
+ proceedings: string[];
40
+ reference: string[];
41
+ report: string[];
42
+ review: string[];
43
+ set: string[];
44
+ software: string[];
45
+ standard: string[];
46
+ suppbook: string[];
47
+ suppcollection: string[];
48
+ suppperiodical: string[];
49
+ thesis: string[];
50
+ unpublished: string[];
51
+ video: string[];
52
+ xdata: string[];
53
+ };
54
+ export default _default;
55
+ //# sourceMappingURL=fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../fields.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAyxNC"}
@@ -0,0 +1,194 @@
1
+ import type { Node } from '@unified-latex/unified-latex-types';
2
+ import * as JabRef from './jabref.js';
3
+ import * as bibtex from './verbatim.js';
4
+ export type { JabRefMetadata } from './jabref.js';
5
+ export type { ParseError } from './verbatim.js';
6
+ export { toSentenceCase } from './sentence-case.js';
7
+ export { tokenize } from './tokenizer.js';
8
+ export type { Token } from './tokenizer.js';
9
+ type CreatorFields = {
10
+ author?: Creator[];
11
+ bookauthor?: Creator[];
12
+ collaborator?: Creator[];
13
+ commentator?: Creator[];
14
+ director?: Creator[];
15
+ editor?: Creator[];
16
+ editora?: Creator[];
17
+ editorb?: Creator[];
18
+ editors?: Creator[];
19
+ holder?: Creator[];
20
+ scriptwriter?: Creator[];
21
+ translator?: Creator[];
22
+ };
23
+ type ArrayFields = {
24
+ keywords?: string[];
25
+ institution?: string[];
26
+ publisher?: string[];
27
+ origpublisher?: string[];
28
+ organization?: string[];
29
+ location?: string[];
30
+ origlocation?: string[];
31
+ };
32
+ type TypedFields = CreatorFields & ArrayFields;
33
+ type Fields = TypedFields & Omit<Record<string, string>, keyof TypedFields>;
34
+ export type Entry = {
35
+ type: string;
36
+ key: string;
37
+ fields: Fields;
38
+ mode: Record<string, ParseMode>;
39
+ crossref?: {
40
+ inherited: string[];
41
+ donated: string[];
42
+ };
43
+ input: string;
44
+ };
45
+ export interface Library {
46
+ /**
47
+ * errors found while parsing
48
+ */
49
+ errors: bibtex.ParseError[];
50
+ /**
51
+ * entries in the order in which they are found, omitting those which could not be parsed.
52
+ */
53
+ entries: Entry[];
54
+ /**
55
+ * `@comment`s found in the bibtex file.
56
+ */
57
+ comments: string[];
58
+ /**
59
+ * `@string`s found in the bibtex file.
60
+ */
61
+ strings: Record<string, string>;
62
+ /**
63
+ * `@preamble` declarations found in the bibtex file
64
+ */
65
+ preamble: string[];
66
+ /**
67
+ * jabref metadata (such as groups information) found in the bibtex file
68
+ */
69
+ jabref: JabRef.JabRefMetadata;
70
+ }
71
+ export interface Options {
72
+ /**
73
+ * Bib(La)TeX handles entries that are in English differently from emtries in other languages. For English-like entries,
74
+ * it expects titles in title-case. Words within braces are recognized as "case-protected" and their original casing is preserved during
75
+ * rendering. For non-English entries, the casing as entered in the entries is rendered as entered. Other reference managers, such as
76
+ * Zotero, expect all titles to be in sentence-case. In this parser you can specify which `langid` values mark an entry to be English so
77
+ * that it can convert those titles to sentence-case, and to carry over case-protection. If no `langid` is present an entry is
78
+ * assumed to be English by bib(la)tex, and the parser follows that convention. Note that sentence-casing uses heuristics and
79
+ * does not employ any kind of natural language processing, so you should always inspect the results. If you offer your own list
80
+ * of english-langids here, do not forget to include the empty string, stands for "`langid` absent". Default languages to sentenceCase
81
+ * are the empty string, plus:
82
+ *
83
+ * - american
84
+ * - british
85
+ * - canadian
86
+ * - english
87
+ * - australian
88
+ * - newzealand
89
+ * - usenglish
90
+ * - ukenglish
91
+ * - en
92
+ * - eng
93
+ * - en-au
94
+ * - en-bz
95
+ * - en-ca
96
+ * - en-cb
97
+ * - en-gb
98
+ * - en-ie
99
+ * - en-jm
100
+ * - en-nz
101
+ * - en-ph
102
+ * - en-tt
103
+ * - en-us
104
+ * - en-za
105
+ * - en-zw
106
+ *
107
+ * If you pass an empty array, or `false`, no sentence casing will be applied (even when there's no language field).
108
+ */
109
+ english?: string[] | boolean;
110
+ /**
111
+ * By default, `langid` and `hyphenation` are used to determine whether an entry is English, but some sources (ab)use the `language` field
112
+ * for this. If you turn on this option, this field will also be taken into account as a source for `langid`.
113
+ */
114
+ languageAsLangid?: boolean;
115
+ sentenceCase?: false | {
116
+ /**
117
+ * Some bibtex files will have English titles in sentence case, or all-uppercase. If this is on, and there is a field that would
118
+ * normally have sentence-casing applied in which there are all-lowercase words that are not prepositions (where `X` is either
119
+ * lower or upper) than mixed-case, it is assumed that you want them this way, and no sentence-casing will be applied to that field
120
+ */
121
+ guess?: boolean;
122
+ /**
123
+ * Retain Capitalised words in sub-sentences after colons. Given the input title "Structured Interviewing For OCB: Construct Validity,
124
+ * Faking, And The Effects Of Question Type":
125
+ * - when `true`, sentence-cases to "Structured interviewing for OCB: Construct validity, faking, and the effects of question type"
126
+ * - when `false`, sentence-cases to "Structured interviewing for OCB: construct validity, faking, and the effects of question type"
127
+ */
128
+ subSentence?: boolean;
129
+ /**
130
+ * If you have sentence-casing on, you can independently choose whether quoted titles within a title are preserved as-is (true)
131
+ * or also sentence-cased (false).
132
+ */
133
+ preserveQuoted?: boolean;
134
+ };
135
+ /**
136
+ * translate braced parts of English-entry titles into a case-protected counterpart; Default == true == as-needed.
137
+ * In as-needed mode the parser will assume that words that have capitals in them imply "nocase" behavior in the consuming application. If you don't want this, turn this option on, and you'll get
138
+ * case protection exactly as the input has it
139
+ */
140
+ caseProtection?: 'as-needed' | 'strict' | boolean;
141
+ /**
142
+ * By default, when a TeX command is encountered which the parser does not know about, the parser will throw an error. You can pass a function here to return the appropriate text output for the command.
143
+ */
144
+ unsupported?: 'ignore' | unsupportedHandler;
145
+ /**
146
+ * Some fields such as `url` are parsed in what is called "verbatim mode" where pretty much everything except braces is treated as regular text, not TeX commands. You can change the default list here if you want,
147
+ * for example to help parse Mendeley `file` fields, which against spec are not in verbatim mode.
148
+ */
149
+ verbatimFields?: (string | RegExp)[];
150
+ /**
151
+ * In the past many bibtex entries would just always wrap a field in double braces, likely because whomever was writing them couldn't figure out the case meddling rules (and who could
152
+ * blame them). Fields listed here will either have one outer layer of braces treated as case-preserve, or have the outer braced be ignored completely, if this is detected.
153
+ */
154
+ removeOuterBraces?: string[];
155
+ /**
156
+ * Specify parsing mode for specific fields
157
+ */
158
+ fieldMode?: Record<string, ParseMode>;
159
+ /**
160
+ * If this flag is set entries will be returned without conversion of LaTeX to unicode equivalents.
161
+ */
162
+ raw?: boolean;
163
+ /**
164
+ * You can pass in an existing `@string` dictionary
165
+ */
166
+ strings?: Record<string, string> | string;
167
+ /**
168
+ * Apply crossref inheritance
169
+ */
170
+ applyCrossRef?: boolean;
171
+ }
172
+ export interface Creator {
173
+ name?: string;
174
+ lastName?: string;
175
+ firstName?: string;
176
+ prefix?: string;
177
+ suffix?: string;
178
+ initial?: string;
179
+ useprefix?: boolean;
180
+ juniorcomma?: boolean;
181
+ }
182
+ export declare const FieldMode: {
183
+ creatorlist: string[];
184
+ title: string[];
185
+ verbatim: (string | RegExp)[];
186
+ richtext: string[];
187
+ literallist: string[];
188
+ };
189
+ type ParseMode = keyof typeof FieldMode | 'literal' | 'verbatimlist';
190
+ export declare const English: string[];
191
+ type unsupportedHandler = (node: Node, tex: string, entry: Entry) => string;
192
+ export declare function parse(input: string, options?: Options): Library;
193
+ export declare function parseAsync(input: string, options?: Options): Promise<Library>;
194
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAuC,IAAI,EAA8B,MAAM,oCAAoC,CAAA;AAM/H,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AA2B3C,KAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,EAAE,CAAA;IACtB,YAAY,CAAC,EAAE,OAAO,EAAE,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,EAAE,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,OAAO,EAAE,CAAA;CACvB,CAAA;AACD,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM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AAEpE,eAAO,MAAM,OAAO,UA0BnB,CAAA;AA8ED,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,MAAM,CAAA;AA8gC3E,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,GAAG,OAAO,CAGnE;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAGvF"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * A JabRef group.
3
+ */
4
+ export interface Group {
5
+ /**
6
+ * the group name
7
+ */
8
+ name: string;
9
+ /**
10
+ * The citation keys which are specified to belong to this group, after intersection calculation has been applied
11
+ */
12
+ entries: string[];
13
+ /**
14
+ * Sub-groups under this group
15
+ */
16
+ groups: Group[];
17
+ }
18
+ export interface JabRefMetadata {
19
+ /**
20
+ * The root groups. You can find the nested groups in their `groups` property
21
+ */
22
+ root: Group[];
23
+ /**
24
+ * JabRef since 3.8 has changed their groups format. Entries have a `groups` field which has the names of the groups they belong to -- this name does not have to be unique in the groups hierarchy so if you
25
+ * have multiple groups with the same name, it's not well-defined where the entries should end up. This property gives you the for each group name the first time the group showed up in the hierarchy. Note that
26
+ * keys from the entries themselves have *not* yet been added to the [[Group]]s. You need to combine this yourself as you're parsing the entries.
27
+ */
28
+ groups: {
29
+ [key: string]: Group;
30
+ };
31
+ /**
32
+ * The base path for file paths
33
+ */
34
+ fileDirectory?: string;
35
+ /**
36
+ * The JabRef metadata format version
37
+ */
38
+ groupsversion?: number;
39
+ /**
40
+ * The JabRef metadata database type
41
+ */
42
+ databaseType?: string;
43
+ }
44
+ /**
45
+ * Import the JabRef groups from the `@string` comments in which they were stored. You would typically pass the comments parsed by [[bibtex.parse]] in here.
46
+ *
47
+ * JabRef knows several group types, and this parser parses most, but not all of them:
48
+ *
49
+ * * independent group: the keys listed in the group are the entries that are considered to belong to it
50
+ * * intersection: the keys listed in the group are considered to belong to the group if they're also in the parent group
51
+ * * union: the keys listed in the group are considered to belong to the group, and also the keys that are in the parent group
52
+ * * query: not supported by this parser
53
+ */
54
+ export declare function parse(comments: string[]): {
55
+ comments: string[];
56
+ jabref: JabRefMetadata;
57
+ };
58
+ //# sourceMappingURL=jabref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jabref.d.ts","sourceRoot":"","sources":["../../jabref.ts"],"names":[],"mappings":"AAuBA;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAA;IAEjB;;OAEG;IACH,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,KAAK,EAAE,CAAA;IAEb;;;;OAIG;IACH,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;KAAE,CAAA;IAEhC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,CAqFxF"}
@@ -0,0 +1,2 @@
1
+ export declare function merge<T>(options: T, defaults: T): T;
2
+ //# sourceMappingURL=merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../merge.ts"],"names":[],"mappings":"AAEA,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAEnD"}
@@ -0,0 +1,3 @@
1
+ declare const _default: string[];
2
+ export default _default;
3
+ //# sourceMappingURL=prepositions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepositions.d.ts","sourceRoot":"","sources":["../../prepositions.ts"],"names":[],"mappings":";AAAA,wBAuFC"}
@@ -0,0 +1,9 @@
1
+ export type Options = {
2
+ preserveQuoted?: boolean;
3
+ subSentenceCapitalization?: boolean;
4
+ markup?: RegExp;
5
+ nocase?: RegExp;
6
+ guess?: boolean;
7
+ };
8
+ export declare function toSentenceCase(title: string, options?: Options): string;
9
+ //# sourceMappingURL=sentence-case.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentence-case.d.ts","sourceRoot":"","sources":["../../sentence-case.ts"],"names":[],"mappings":"AAyDA,MAAM,MAAM,OAAO,GAAG;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,GAAG,MAAM,CAiE3E"}
@@ -0,0 +1,13 @@
1
+ export type Token = {
2
+ type: 'word' | 'domain' | 'whitespace';
3
+ subtype: '' | 'preposition' | 'acronym' | 'whitespace' | 'word' | 'domain';
4
+ text: string;
5
+ start: number;
6
+ end: number;
7
+ shape: string;
8
+ sentenceStart: boolean;
9
+ subSentenceStart: boolean;
10
+ hyphenated?: Token[];
11
+ };
12
+ export declare function tokenize(title: string, markup?: RegExp): Token[];
13
+ //# sourceMappingURL=tokenizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenizer.d.ts","sourceRoot":"","sources":["../../tokenizer.ts"],"names":[],"mappings":"AA+FA,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAA;IACtC,OAAO,EAAE,EAAE,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAA;IAC1E,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,OAAO,CAAA;IACtB,gBAAgB,EAAE,OAAO,CAAA;IACzB,UAAU,CAAC,EAAE,KAAK,EAAE,CAAA;CACrB,CAAA;AAkBD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CA6EhE"}
@@ -0,0 +1,66 @@
1
+ export type Entry = {
2
+ input: string;
3
+ type: string;
4
+ key: string;
5
+ fields: Record<string, string>;
6
+ };
7
+ export interface ParseError {
8
+ error: string;
9
+ input?: string;
10
+ }
11
+ export interface ParserOptions {
12
+ /**
13
+ * stop parsing after `max_entries` entries have been found. Useful for quick detection if a text file is in fact a bibtex file
14
+ */
15
+ max_entries?: number;
16
+ /**
17
+ * preload these strings
18
+ */
19
+ strings?: string | Record<string, string>;
20
+ }
21
+ export declare class Library {
22
+ parsing: string;
23
+ entries: Entry[];
24
+ strings: Record<string, string>;
25
+ comments: string[];
26
+ errors: ParseError[];
27
+ preambles: string[];
28
+ private default_strings;
29
+ private pos;
30
+ private linebreaks;
31
+ private input;
32
+ private max_entries;
33
+ constructor(input: string, options?: ParserOptions);
34
+ parse(): void;
35
+ parseAsync(): Promise<void>;
36
+ private isWhitespace;
37
+ private match;
38
+ private tryMatch;
39
+ private skipWhitespace;
40
+ private value_braces;
41
+ private value_quotes;
42
+ private single_value;
43
+ location(): string;
44
+ error(err: ParseError): void;
45
+ private value;
46
+ private key;
47
+ private key_equals_value;
48
+ private entry;
49
+ private directive;
50
+ private string;
51
+ private preamble;
52
+ private comment;
53
+ private hasMore;
54
+ private bibtex;
55
+ private bibtexAsync;
56
+ private matchGuard;
57
+ private parseNext;
58
+ }
59
+ /**
60
+ * Parses a bibtex source in verbatim mode. Good for detection of bibtex and for later LaTeX-reparsing.
61
+ */
62
+ export declare function parse(input: string, options?: ParserOptions): Library;
63
+ export declare const promises: {
64
+ parse(input: string, options?: ParserOptions): Promise<Library>;
65
+ };
66
+ //# sourceMappingURL=verbatim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verbatim.d.ts","sourceRoot":"","sources":["../../verbatim.ts"],"names":[],"mappings":"AAsBA,MAAM,MAAM,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B,CAAA;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC1C;AAED,qBAAa,OAAO;IACX,OAAO,EAAE,MAAM,CAAA;IAEf,OAAO,EAAE,KAAK,EAAE,CAAK;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAK;IACpC,QAAQ,EAAE,MAAM,EAAE,CAAK;IACvB,MAAM,EAAE,UAAU,EAAE,CAAK;IACzB,SAAS,EAAE,MAAM,EAAE,CAAK;IAE/B,OAAO,CAAC,eAAe,CA4CtB;IAED,OAAO,CAAC,GAAG,CAAI;IACf,OAAO,CAAC,UAAU,CAAe;IACjC,OAAO,CAAC,KAAK,CAAQ;IAErB,OAAO,CAAC,WAAW,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