@helloao/tools 0.0.6 → 0.0.10

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 (109) hide show
  1. package/dist/cjs/generation/api.cjs +366 -0
  2. package/dist/cjs/generation/api.cjs.map +7 -0
  3. package/dist/cjs/generation/audio.cjs +83 -0
  4. package/dist/cjs/generation/audio.cjs.map +7 -0
  5. package/dist/cjs/generation/book-order.cjs +508 -0
  6. package/dist/cjs/generation/book-order.cjs.map +7 -0
  7. package/dist/cjs/generation/common-types.cjs +17 -0
  8. package/dist/cjs/generation/common-types.cjs.map +7 -0
  9. package/dist/cjs/generation/dataset.cjs +238 -0
  10. package/dist/cjs/generation/dataset.cjs.map +7 -0
  11. package/dist/cjs/generation/index.cjs +51 -0
  12. package/dist/cjs/generation/index.cjs.map +7 -0
  13. package/dist/cjs/index.cjs +45 -0
  14. package/dist/cjs/index.cjs.map +7 -0
  15. package/dist/cjs/parser/codex-parser.cjs +187 -0
  16. package/dist/cjs/parser/codex-parser.cjs.map +7 -0
  17. package/dist/cjs/parser/commentary-csv-parser.cjs +133 -0
  18. package/dist/cjs/parser/commentary-csv-parser.cjs.map +7 -0
  19. package/dist/cjs/parser/index.cjs +50 -0
  20. package/dist/cjs/parser/index.cjs.map +7 -0
  21. package/dist/cjs/parser/iterators.cjs +204 -0
  22. package/dist/cjs/parser/iterators.cjs.map +7 -0
  23. package/dist/cjs/parser/types.cjs +17 -0
  24. package/dist/cjs/parser/types.cjs.map +7 -0
  25. package/dist/cjs/parser/usfm-parser.cjs +791 -0
  26. package/dist/cjs/parser/usfm-parser.cjs.map +7 -0
  27. package/dist/cjs/parser/usx-parser.cjs +483 -0
  28. package/dist/cjs/parser/usx-parser.cjs.map +7 -0
  29. package/dist/cjs/utils.cjs +237 -0
  30. package/dist/cjs/utils.cjs.map +7 -0
  31. package/dist/esm/generation/api.js +320 -0
  32. package/dist/esm/generation/api.js.map +7 -0
  33. package/dist/esm/generation/audio.js +53 -0
  34. package/dist/esm/generation/audio.js.map +7 -0
  35. package/dist/esm/generation/book-order.js +478 -0
  36. package/dist/esm/generation/book-order.js.map +7 -0
  37. package/dist/esm/generation/common-types.js +2 -0
  38. package/dist/esm/generation/common-types.js.map +7 -0
  39. package/dist/esm/generation/dataset.js +212 -0
  40. package/dist/esm/generation/dataset.js.map +7 -0
  41. package/dist/esm/generation/index.js +8 -0
  42. package/dist/esm/generation/index.js.map +7 -0
  43. package/dist/esm/index.js +6 -0
  44. package/dist/esm/index.js.map +7 -0
  45. package/dist/esm/parser/codex-parser.js +151 -0
  46. package/dist/esm/parser/codex-parser.js.map +7 -0
  47. package/dist/esm/parser/commentary-csv-parser.js +107 -0
  48. package/dist/esm/parser/commentary-csv-parser.js.map +7 -0
  49. package/dist/esm/parser/index.js +9 -0
  50. package/dist/esm/parser/index.js.map +7 -0
  51. package/dist/esm/parser/iterators.js +152 -0
  52. package/dist/esm/parser/iterators.js.map +7 -0
  53. package/dist/esm/parser/types.js +2 -0
  54. package/dist/esm/parser/types.js.map +7 -0
  55. package/dist/esm/parser/usfm-parser.js +749 -0
  56. package/dist/esm/parser/usfm-parser.js.map +7 -0
  57. package/dist/esm/parser/usx-parser.js +459 -0
  58. package/dist/esm/parser/usx-parser.js.map +7 -0
  59. package/dist/esm/utils.js +201 -0
  60. package/dist/esm/utils.js.map +7 -0
  61. package/{generation → dist/types/generation}/api.d.ts +148 -2
  62. package/{generation → dist/types/generation}/audio.d.ts +1 -1
  63. package/{generation → dist/types/generation}/common-types.d.ts +121 -24
  64. package/{generation → dist/types/generation}/dataset.d.ts +23 -1
  65. package/dist/types/generation/index.d.ts +7 -0
  66. package/dist/types/index.d.ts +5 -0
  67. package/{parser → dist/types/parser}/codex-parser.d.ts +51 -8
  68. package/dist/types/parser/commentary-csv-parser.d.ts +12 -0
  69. package/dist/types/parser/index.d.ts +8 -0
  70. package/{parser → dist/types/parser}/types.d.ts +28 -1
  71. package/{parser → dist/types/parser}/usfm-parser.d.ts +1 -1
  72. package/{parser → dist/types/parser}/usx-parser.d.ts +3 -3
  73. package/{utils.d.ts → dist/types/utils.d.ts} +6 -0
  74. package/package.json +27 -4
  75. package/generation/api.js +0 -187
  76. package/generation/api.spec.d.ts +0 -2
  77. package/generation/api.spec.js +0 -620
  78. package/generation/audio.js +0 -60
  79. package/generation/audio.spec.d.ts +0 -2
  80. package/generation/audio.spec.js +0 -36
  81. package/generation/book-order.js +0 -494
  82. package/generation/book-order.spec.d.ts +0 -2
  83. package/generation/book-order.spec.js +0 -8
  84. package/generation/common-types.js +0 -2
  85. package/generation/dataset.js +0 -106
  86. package/generation/index.d.ts +0 -7
  87. package/generation/index.js +0 -38
  88. package/index.d.ts +0 -5
  89. package/index.js +0 -32
  90. package/parser/codex-parser.js +0 -160
  91. package/parser/codex-parser.spec.d.ts +0 -2
  92. package/parser/codex-parser.spec.js +0 -645
  93. package/parser/index.d.ts +0 -7
  94. package/parser/index.js +0 -35
  95. package/parser/iterators.js +0 -222
  96. package/parser/iterators.spec.d.ts +0 -2
  97. package/parser/iterators.spec.js +0 -174
  98. package/parser/types.js +0 -2
  99. package/parser/usfm-parser.js +0 -840
  100. package/parser/usfm-parser.spec.d.ts +0 -2
  101. package/parser/usfm-parser.spec.js +0 -1593
  102. package/parser/usx-parser.js +0 -486
  103. package/parser/usx-parser.spec.d.ts +0 -2
  104. package/parser/usx-parser.spec.js +0 -1260
  105. package/utils.js +0 -73
  106. package/utils.spec.d.ts +0 -2
  107. package/utils.spec.js +0 -42
  108. /package/{generation → dist/types/generation}/book-order.d.ts +0 -0
  109. /package/{parser → dist/types/parser}/iterators.d.ts +0 -0
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var commentary_csv_parser_exports = {};
20
+ __export(commentary_csv_parser_exports, {
21
+ CommentaryCsvParser: () => CommentaryCsvParser
22
+ });
23
+ module.exports = __toCommonJS(commentary_csv_parser_exports);
24
+ var import_utils = require("../utils");
25
+ var import_papaparse = require("papaparse");
26
+ class CommentaryCsvParser {
27
+ parse(data) {
28
+ const firstLine = data.indexOf("\n");
29
+ data = data.substring(firstLine + 1);
30
+ const lines = (0, import_papaparse.parse)(data, {
31
+ header: false,
32
+ // transformHeader: (_, index) => {
33
+ // const headers = ['book', 'chapter', 'verse', 'commentaries'];
34
+ // if (index < headers.length) {
35
+ // return headers[index];
36
+ // } else {
37
+ // return '';
38
+ // }
39
+ // },
40
+ delimiter: ",",
41
+ escapeChar: '"',
42
+ quoteChar: '"'
43
+ });
44
+ return this.parseLines(
45
+ lines.data.map((line) => ({
46
+ book: line[0],
47
+ chapter: line[1],
48
+ verse: line[2],
49
+ commentaries: line[3]
50
+ }))
51
+ );
52
+ }
53
+ parseLines(data) {
54
+ let tree = {
55
+ type: "commentary/root",
56
+ books: []
57
+ };
58
+ let book = null;
59
+ let chapter = null;
60
+ for (let line of data) {
61
+ if (hasValue(line.book)) {
62
+ const id = (0, import_utils.getBookId)(line.book);
63
+ if (!id) {
64
+ throw new Error("Invalid book: " + line.book);
65
+ }
66
+ book = tree.books.find((b) => b.book === id) ?? null;
67
+ if (!book) {
68
+ book = {
69
+ type: "book",
70
+ book: id,
71
+ introduction: null,
72
+ chapters: []
73
+ };
74
+ tree.books.push(book);
75
+ }
76
+ if (!book.introduction) {
77
+ book.introduction = hasValue(line.commentaries) ? line.commentaries : null;
78
+ }
79
+ } else if (hasValue(line.chapter)) {
80
+ const number = parseInt(line.chapter);
81
+ if (isNaN(number)) {
82
+ throw new Error("Invalid chapter number: " + line.chapter);
83
+ }
84
+ if (!book) {
85
+ throw new Error("Chapter without book");
86
+ }
87
+ chapter = {
88
+ type: "chapter",
89
+ number,
90
+ introduction: hasValue(line.commentaries) ? line.commentaries : null,
91
+ verses: []
92
+ };
93
+ book.chapters.push(chapter);
94
+ } else if (hasValue(line.verse)) {
95
+ const ref = (0, import_utils.parseVerseReference)(line.verse);
96
+ if (ref) {
97
+ if (ref.book === book?.book) {
98
+ if (ref.chapter === chapter?.number) {
99
+ chapter.verses.push({
100
+ type: "verse",
101
+ number: ref.verse,
102
+ content: [line.commentaries]
103
+ });
104
+ } else {
105
+ chapter = {
106
+ type: "chapter",
107
+ number: ref.chapter,
108
+ introduction: null,
109
+ verses: [
110
+ {
111
+ type: "verse",
112
+ number: ref.verse,
113
+ content: [line.commentaries]
114
+ }
115
+ ]
116
+ };
117
+ book.chapters.push(chapter);
118
+ }
119
+ }
120
+ }
121
+ }
122
+ }
123
+ return tree;
124
+ }
125
+ }
126
+ function hasValue(value) {
127
+ return value !== null && value !== void 0 && value !== "" && value.trim() !== "";
128
+ }
129
+ // Annotate the CommonJS export names for ESM import in node:
130
+ 0 && (module.exports = {
131
+ CommentaryCsvParser
132
+ });
133
+ //# sourceMappingURL=commentary-csv-parser.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../parser/commentary-csv-parser.ts"],
4
+ "sourcesContent": ["import {\r\n CommentaryBookNode,\r\n CommentaryChapterNode,\r\n CommentaryParseTree,\r\n} from './types';\r\nimport { getBookId, parseVerseReference } from '../utils';\r\nimport { parse } from 'papaparse';\r\n\r\nexport interface CsvLine {\r\n book: string;\r\n chapter: string;\r\n verse: string;\r\n commentaries: string;\r\n}\r\n\r\nexport class CommentaryCsvParser {\r\n parse(data: string): CommentaryParseTree {\r\n // remove header automatically\r\n const firstLine = data.indexOf('\\n');\r\n data = data.substring(firstLine + 1);\r\n\r\n const lines = parse<string[]>(data, {\r\n header: false,\r\n // transformHeader: (_, index) => {\r\n // const headers = ['book', 'chapter', 'verse', 'commentaries'];\r\n // if (index < headers.length) {\r\n // return headers[index];\r\n // } else {\r\n // return '';\r\n // }\r\n // },\r\n delimiter: ',',\r\n escapeChar: '\"',\r\n quoteChar: '\"',\r\n });\r\n return this.parseLines(\r\n lines.data.map((line: string[]) => ({\r\n book: line[0],\r\n chapter: line[1],\r\n verse: line[2],\r\n commentaries: line[3],\r\n }))\r\n );\r\n }\r\n\r\n parseLines(data: CsvLine[]): CommentaryParseTree {\r\n let tree: CommentaryParseTree = {\r\n type: 'commentary/root',\r\n books: [],\r\n };\r\n\r\n let book: CommentaryBookNode | null = null;\r\n let chapter: CommentaryChapterNode | null = null;\r\n for (let line of data) {\r\n if (hasValue(line.book)) {\r\n const id = getBookId(line.book);\r\n if (!id) {\r\n throw new Error('Invalid book: ' + line.book);\r\n }\r\n\r\n book = tree.books.find((b) => b.book === id) ?? null;\r\n if (!book) {\r\n book = {\r\n type: 'book',\r\n book: id,\r\n introduction: null,\r\n chapters: [],\r\n };\r\n tree.books.push(book);\r\n }\r\n\r\n if (!book.introduction) {\r\n book.introduction = hasValue(line.commentaries)\r\n ? line.commentaries\r\n : null;\r\n }\r\n } else if (hasValue(line.chapter)) {\r\n const number = parseInt(line.chapter);\r\n if (isNaN(number)) {\r\n throw new Error('Invalid chapter number: ' + line.chapter);\r\n }\r\n\r\n if (!book) {\r\n // console.log(line);\r\n throw new Error('Chapter without book');\r\n }\r\n\r\n chapter = {\r\n type: 'chapter',\r\n number,\r\n introduction: hasValue(line.commentaries)\r\n ? line.commentaries\r\n : null,\r\n verses: [],\r\n };\r\n book.chapters.push(chapter);\r\n } else if (hasValue(line.verse)) {\r\n const ref = parseVerseReference(line.verse);\r\n if (ref) {\r\n if (ref.book === book?.book) {\r\n // @ts-ignore\r\n if (ref.chapter === chapter?.number) {\r\n chapter.verses.push({\r\n type: 'verse',\r\n number: ref.verse,\r\n content: [line.commentaries],\r\n });\r\n } else {\r\n chapter = {\r\n type: 'chapter',\r\n number: ref.chapter,\r\n introduction: null,\r\n verses: [\r\n {\r\n type: 'verse',\r\n number: ref.verse,\r\n content: [line.commentaries],\r\n },\r\n ],\r\n };\r\n\r\n book.chapters.push(chapter);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return tree;\r\n }\r\n}\r\n\r\nfunction hasValue(value: string | null): boolean {\r\n return (\r\n value !== null &&\r\n value !== undefined &&\r\n value !== '' &&\r\n value.trim() !== ''\r\n );\r\n}\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,mBAA+C;AAC/C,uBAAsB;AASf,MAAM,oBAAoB;AAAA,EAC7B,MAAM,MAAmC;AAErC,UAAM,YAAY,KAAK,QAAQ,IAAI;AACnC,WAAO,KAAK,UAAU,YAAY,CAAC;AAEnC,UAAM,YAAQ,wBAAgB,MAAM;AAAA,MAChC,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MASR,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,WAAW;AAAA,IACf,CAAC;AACD,WAAO,KAAK;AAAA,MACR,MAAM,KAAK,IAAI,CAAC,UAAoB;AAAA,QAChC,MAAM,KAAK,CAAC;AAAA,QACZ,SAAS,KAAK,CAAC;AAAA,QACf,OAAO,KAAK,CAAC;AAAA,QACb,cAAc,KAAK,CAAC;AAAA,MACxB,EAAE;AAAA,IACN;AAAA,EACJ;AAAA,EAEA,WAAW,MAAsC;AAC7C,QAAI,OAA4B;AAAA,MAC5B,MAAM;AAAA,MACN,OAAO,CAAC;AAAA,IACZ;AAEA,QAAI,OAAkC;AACtC,QAAI,UAA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U;AAAA,gBACN,MAAM;AAAA,gBACN,QAAQ,IAAI;AAAA,gBACZ,cAAc;AAAA,gBACd,QAAQ;AAAA,kBACJ;AAAA,oBACI,MAAM;AAAA,oBACN,QAAQ,IAAI;AAAA,oBACZ,SAAS,CAAC,KAAK,YAAY;AAAA,kBAC/B;AAAA,gBACJ;AAAA,cACJ;AAEA,mBAAK,SAAS,KAAK,OAAO;AAAA,YAC9B;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAEA,WAAO;AAAA,EACX;AACJ;AAEA,SAAS,SAAS,OAA+B;AAC7C,SACI,UAAU,QACV,UAAU,UACV,UAAU,MACV,MAAM,KAAK,MAAM;AAEzB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var parser_exports = {};
31
+ __export(parser_exports, {
32
+ iterators: () => iterators
33
+ });
34
+ module.exports = __toCommonJS(parser_exports);
35
+ __reExport(parser_exports, require("./types.js"), module.exports);
36
+ __reExport(parser_exports, require("./usfm-parser.js"), module.exports);
37
+ __reExport(parser_exports, require("./usx-parser.js"), module.exports);
38
+ __reExport(parser_exports, require("./codex-parser.js"), module.exports);
39
+ __reExport(parser_exports, require("./commentary-csv-parser.js"), module.exports);
40
+ var iterators = __toESM(require("./iterators.js"));
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ iterators,
44
+ ...require("./types.js"),
45
+ ...require("./usfm-parser.js"),
46
+ ...require("./usx-parser.js"),
47
+ ...require("./codex-parser.js"),
48
+ ...require("./commentary-csv-parser.js")
49
+ });
50
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../parser/index.ts"],
4
+ "sourcesContent": ["export * from './types.js';\r\nexport * from './usfm-parser.js';\r\nexport * from './usx-parser.js';\r\nexport * from './codex-parser.js';\r\nexport * from './commentary-csv-parser.js';\r\nimport * as iterators from './iterators.js';\r\n\r\nexport { iterators };\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAc,uBAAd;AACA,2BAAc,6BADd;AAEA,2BAAc,4BAFd;AAGA,2BAAc,8BAHd;AAIA,2BAAc,uCAJd;AAKA,gBAA2B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,204 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var iterators_exports = {};
20
+ __export(iterators_exports, {
21
+ Rewindable: () => Rewindable,
22
+ batch: () => batch,
23
+ children: () => children,
24
+ debug: () => debug,
25
+ elements: () => elements,
26
+ isParent: () => isParent,
27
+ iterateAll: () => iterateAll,
28
+ iterateUntil: () => iterateUntil,
29
+ matchingParent: () => matchingParent,
30
+ parentChar: () => parentChar,
31
+ parentNote: () => parentNote,
32
+ rewindable: () => rewindable,
33
+ toAsyncIterable: () => toAsyncIterable,
34
+ uncompletable: () => uncompletable
35
+ });
36
+ module.exports = __toCommonJS(iterators_exports);
37
+ class Rewindable {
38
+ buffer = [];
39
+ _bufferSize = 0;
40
+ _position = -1;
41
+ _iterator;
42
+ constructor(iterator, bufferSize = 2) {
43
+ this._iterator = iterator;
44
+ this._bufferSize = bufferSize;
45
+ if (this._iterator.return) {
46
+ this.return = (value) => {
47
+ return this._iterator.return(value);
48
+ };
49
+ }
50
+ if (this._iterator.throw) {
51
+ this.throw = (value) => {
52
+ return this._iterator.throw(value);
53
+ };
54
+ }
55
+ }
56
+ rewind(number) {
57
+ this._position += number;
58
+ }
59
+ [Symbol.iterator]() {
60
+ return this;
61
+ }
62
+ next(...args) {
63
+ if (this._position >= 0) {
64
+ let item = this.buffer[this._position];
65
+ this._position--;
66
+ return {
67
+ value: item,
68
+ done: false
69
+ };
70
+ }
71
+ let result = this._iterator.next(...args);
72
+ this.buffer.unshift(result.value);
73
+ if (this.buffer.length > this._bufferSize) {
74
+ this.buffer.splice(this._bufferSize, this.buffer.length - this._bufferSize);
75
+ }
76
+ return result;
77
+ }
78
+ }
79
+ function* debug(label, iterator) {
80
+ for (let value of uncompletable(iterator)) {
81
+ if (value instanceof Element) {
82
+ console.log(label, value.outerHTML);
83
+ } else if (value instanceof Node) {
84
+ console.log(label, value.textContent);
85
+ } else {
86
+ console.log(label, value);
87
+ }
88
+ yield value;
89
+ }
90
+ }
91
+ function rewindable(iterator, bufferSize = 2) {
92
+ return new Rewindable(iterator, bufferSize);
93
+ }
94
+ function* iterateNodes(node) {
95
+ for (let i = 0; i < node.childNodes.length; i++) {
96
+ yield node.childNodes[i];
97
+ }
98
+ }
99
+ function parentChar(node) {
100
+ return matchingParent(node, (n) => n instanceof Element && n.nodeName === "char");
101
+ }
102
+ function parentNote(node) {
103
+ return matchingParent(node, (n) => n instanceof Element && n.nodeName === "note");
104
+ }
105
+ function matchingParent(node, filter) {
106
+ let parent = node.parentNode;
107
+ while (parent) {
108
+ if (filter(parent)) {
109
+ return parent;
110
+ }
111
+ parent = parent.parentNode;
112
+ }
113
+ return null;
114
+ }
115
+ function isParent(node, parent) {
116
+ let parentNode = node.parentNode;
117
+ while (parentNode) {
118
+ if (parentNode === parent) {
119
+ return true;
120
+ }
121
+ parentNode = parentNode.parentNode;
122
+ }
123
+ return false;
124
+ }
125
+ function iterateAll(node) {
126
+ return rewindable(_iterateAll(node));
127
+ }
128
+ function* iterateUntil(iterator, predicate) {
129
+ for (let value of iterator) {
130
+ if (predicate(value)) {
131
+ return;
132
+ }
133
+ yield value;
134
+ }
135
+ }
136
+ function* _iterateAll(node) {
137
+ for (let child of node.childNodes) {
138
+ yield child;
139
+ yield* iterateAll(child);
140
+ }
141
+ }
142
+ function* elements(iterator) {
143
+ for (let node of uncompletable(iterator)) {
144
+ if (node instanceof Element) {
145
+ yield node;
146
+ }
147
+ }
148
+ }
149
+ function* children(iterator, parent) {
150
+ for (let node of uncompletable(iterator)) {
151
+ if (!isParent(node, parent)) {
152
+ iterator.rewind(1);
153
+ return;
154
+ }
155
+ yield node;
156
+ }
157
+ }
158
+ function* uncompletable(iterable) {
159
+ while (true) {
160
+ const { done, value } = iterable.next();
161
+ if (done) {
162
+ return;
163
+ }
164
+ yield value;
165
+ }
166
+ }
167
+ async function* toAsyncIterable(input) {
168
+ for (let item of input) {
169
+ yield item;
170
+ }
171
+ }
172
+ function* batch(input, batchSize) {
173
+ while (true) {
174
+ let batch2 = [];
175
+ for (let item of input) {
176
+ batch2.push(item);
177
+ if (batch2.length >= batchSize) {
178
+ break;
179
+ }
180
+ }
181
+ if (batch2.length === 0) {
182
+ return;
183
+ }
184
+ yield batch2;
185
+ }
186
+ }
187
+ // Annotate the CommonJS export names for ESM import in node:
188
+ 0 && (module.exports = {
189
+ Rewindable,
190
+ batch,
191
+ children,
192
+ debug,
193
+ elements,
194
+ isParent,
195
+ iterateAll,
196
+ iterateUntil,
197
+ matchingParent,
198
+ parentChar,
199
+ parentNote,
200
+ rewindable,
201
+ toAsyncIterable,
202
+ uncompletable
203
+ });
204
+ //# sourceMappingURL=iterators.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../parser/iterators.ts"],
4
+ "sourcesContent": ["\r\n/**\r\n * Defines an interface that represents an iterator that can be rewound.\r\n */\r\nexport interface RewindableIterator<T> extends IterableIterator<T> {\r\n /**\r\n * Rewinds the iterator by the specified number of elements.\r\n * @param number The number of elements to rewind.\r\n */\r\n rewind(number: number): void;\r\n}\r\n\r\n/**\r\n * Defines a class that implements an iterator that can be rewound.\r\n */\r\nexport class Rewindable<T> implements RewindableIterator<T> {\r\n buffer: T[] = [];\r\n\r\n private _bufferSize: number = 0;\r\n private _position: number = -1;\r\n private _iterator: IterableIterator<T>;\r\n\r\n constructor(iterator: IterableIterator<T>, bufferSize: number = 2) {\r\n this._iterator = iterator;\r\n this._bufferSize = bufferSize;\r\n\r\n if(this._iterator.return) {\r\n this.return = (value?: any) => {\r\n return this._iterator.return!(value);\r\n };\r\n }\r\n if(this._iterator.throw) {\r\n this.throw = (value?: any) => {\r\n return this._iterator.throw!(value);\r\n };\r\n }\r\n }\r\n\r\n rewind(number: number): void {\r\n this._position += number;\r\n }\r\n\r\n [Symbol.iterator](): IterableIterator<T> {\r\n return this;\r\n }\r\n\r\n next(...args: [] | [undefined]): IteratorResult<T, any> {\r\n if (this._position >= 0) {\r\n let item = this.buffer[this._position];\r\n this._position--;\r\n return {\r\n value: item,\r\n done: false\r\n };\r\n }\r\n\r\n let result = this._iterator.next(...args);\r\n this.buffer.unshift(result.value);\r\n if (this.buffer.length > this._bufferSize) {\r\n this.buffer.splice(this._bufferSize, this.buffer.length - this._bufferSize);\r\n }\r\n return result;\r\n }\r\n\r\n return?(value?: any): IteratorResult<T, any>;\r\n throw?(e?: any): IteratorResult<T, any>;\r\n}\r\n\r\nexport function *debug(label: string, iterator: IterableIterator<any>) {\r\n for (let value of uncompletable(iterator)) {\r\n if (value instanceof Element) {\r\n console.log(label, value.outerHTML);\r\n } else if(value instanceof Node) {\r\n console.log(label, value.textContent);\r\n } else {\r\n console.log(label, value);\r\n }\r\n yield value;\r\n }\r\n}\r\n\r\n/**\r\n * Creates a new rewindable iterator from the given iterator.\r\n * @param iterator The iterator.\r\n * @param bufferSize The size of the buffer.\r\n */\r\nexport function rewindable<T>(iterator: IterableIterator<T>, bufferSize: number = 2): Rewindable<T> {\r\n return new Rewindable(iterator, bufferSize);\r\n}\r\n\r\n\r\nfunction *iterateNodes(node: Node) {\r\n for(let i = 0; i < node.childNodes.length; i++) {\r\n yield node.childNodes[i];\r\n }\r\n}\r\n\r\n/**\r\n * Gets the char element that is the parent of the given node.\r\n * @param node The node.\r\n */\r\nexport function parentChar(node: Node): Element | null {\r\n return matchingParent(node, n => n instanceof Element && n.nodeName === 'char') as Element | null;\r\n}\r\n\r\n/**\r\n * Gets the note element that is the parent of the given node.\r\n * @param node The node.\r\n */\r\nexport function parentNote(node: Node): Element | null {\r\n return matchingParent(node, n => n instanceof Element && n.nodeName === 'note') as Element | null;\r\n}\r\n\r\n/**\r\n * Gets the parent node that matches the given filter.\r\n * @param node The node to start the search from.\r\n * @param filter The filter that should be used.\r\n */\r\nexport function matchingParent(node: Node, filter: (node: Node) => boolean): Node | null {\r\n let parent = node.parentNode;\r\n while(parent) {\r\n if (filter(parent)) {\r\n return parent;\r\n }\r\n parent = parent.parentNode;\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * Determines if the given node is a child of the parent node.\r\n * @param node The node to test.\r\n * @param parent The parent.\r\n * @returns \r\n */\r\nexport function isParent(node: Node, parent: Node): boolean {\r\n let parentNode = node.parentNode;\r\n while(parentNode) {\r\n if (parentNode === parent) {\r\n return true;\r\n }\r\n parentNode = parentNode.parentNode;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Iterates through all of the nodes in the tree in a depth-first traversal.\r\n * @param node The node to start the traversal from. \r\n */\r\nexport function iterateAll(node: Node): RewindableIterator<Node> {\r\n return rewindable(_iterateAll(node));\r\n}\r\n\r\nexport function *iterateUntil<T>(iterator: IterableIterator<T>, predicate: (value: T) => boolean): IterableIterator<T> {\r\n for(let value of iterator) {\r\n if (predicate(value)) {\r\n return;\r\n }\r\n yield value;\r\n }\r\n}\r\n\r\nfunction *_iterateAll(node: Node): IterableIterator<Node> {\r\n for(let child of node.childNodes) {\r\n yield child;\r\n yield *iterateAll(child);\r\n }\r\n}\r\n\r\n/**\r\n * Iterates only the elements in the iterator.\r\n * @param iterator The iterator that should be used.\r\n */\r\nexport function *elements(iterator: IterableIterator<Node>): IterableIterator<Element> {\r\n for (let node of uncompletable(iterator)) {\r\n if (node instanceof Element) {\r\n yield node;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Iterates only the children of the given node in the iterator.\r\n * @param iterator The iterator that should be used.\r\n * @param parent The parent node.\r\n */\r\nexport function *children(iterator: RewindableIterator<Node>, parent: Node): IterableIterator<Node> {\r\n for (let node of uncompletable(iterator)) {\r\n if (!isParent(node, parent)) {\r\n iterator.rewind(1);\r\n return;\r\n }\r\n\r\n yield node;\r\n }\r\n}\r\n\r\n/**\r\n * Wraps the given iterable in a generator that will prevent consumers from calling return() on the iterator.\r\n * @param iterable The iterable.\r\n */\r\nexport function *uncompletable<T>(iterable: IterableIterator<T>): IterableIterator<T> {\r\n while(true) {\r\n const { done, value } = iterable.next();\r\n if (done) {\r\n return;\r\n }\r\n yield value;\r\n }\r\n}\r\n\r\n/**\r\n * Converts the given iterable into an async iterable.\r\n * @param input The input iterable.\r\n */\r\nexport async function *toAsyncIterable<T>(input: Iterable<T>): AsyncIterable<T> {\r\n for (let item of input) {\r\n yield item;\r\n }\r\n}\r\n\r\n/**\r\n * Batches items from the given iterator.\r\n * @param input The input iterator.\r\n * @param batchSize The size of each batch.\r\n */\r\nexport function* batch<T>(input: Iterable<T>, batchSize: number): Iterable<T[]> {\r\n while(true) {\r\n let batch = [] as T[];\r\n for (let item of input) {\r\n batch.push(item);\r\n if (batch.length >= batchSize) {\r\n break;\r\n }\r\n }\r\n\r\n if (batch.length === 0) {\r\n return;\r\n }\r\n\r\n yield batch;\r\n }\r\n}"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,MAAM,WAA+C;AAAA,EACxD,SAAc,CAAC;AAAA,EAEP,cAAsB;AAAA,EACtB,YAAoB;AAAA,EACpB;AAAA,EAER,YAAY,UAA+B,aAAqB,GAAG;AAC/D,SAAK,YAAY;AACjB,SAAK,cAAc;AAEnB,QAAG,KAAK,UAAU,QAAQ;AACtB,WAAK,SAAS,CAAC,UAAgB;AAC3B,eAAO,KAAK,UAAU,OAAQ,KAAK;AAAA,MACvC;AAAA,IACJ;AACA,Q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ACV;AACJ;AAMA,gBAAuB,gBAAmB,OAAsC;AAC5E,WAAS,QAAQ,OAAO;AACpB,UAAM;AAAA,EACV;AACJ;AAOO,UAAU,MAAS,OAAoB,WAAkC;AAC5E,SAAM,MAAM;AACR,QAAIA,SAAQ,CAAC;AACb,aAAS,QAAQ,OAAO;AACpB,MAAAA,OAAM,KAAK,IAAI;AACf,UAAIA,OAAM,UAAU,WAAW;AAC3B;AAAA,MACJ;AAAA,IACJ;AAEA,QAAIA,OAAM,WAAW,GAAG;AACpB;AAAA,IACJ;AAEA,UAAMA;AAAA,EACV;AACJ;",
6
+ "names": ["batch"]
7
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../parser/types.ts"],
4
+ "sourcesContent": ["/**\r\n * The parse tree that is gathered.\r\n */\r\nexport interface ParseTree {\r\n type: 'root';\r\n\r\n /**\r\n * The ID of the parse tree.\r\n */\r\n id?: string;\r\n\r\n /**\r\n * The header that was associated with the tree.\r\n */\r\n header?: string;\r\n\r\n /**\r\n * The major title that was associated with the tree.\r\n */\r\n title?: string;\r\n\r\n /**\r\n * The list of chapters for the tree.\r\n */\r\n content: (Heading | Chapter)[];\r\n}\r\n\r\nexport interface Heading {\r\n type: 'heading';\r\n content: string[];\r\n}\r\n\r\nexport type ChapterContent = Heading | Verse | HebrewSubtitle | LineBreak;\r\n\r\nexport type VerseContent = string | FootnoteReference | Text;\r\n\r\n/**\r\n * Defines an interface that represents a chapter.\r\n */\r\nexport interface Chapter {\r\n type: 'chapter';\r\n number: number;\r\n\r\n /**\r\n * The contents of the chapter.\r\n */\r\n content: ChapterContent[];\r\n\r\n /**\r\n * The list of footnotes for the chapter.\r\n */\r\n footnotes: Footnote[];\r\n}\r\n\r\n/**\r\n * Defines an interface that represents a hebrew subtitle.\r\n */\r\nexport interface HebrewSubtitle {\r\n type: 'hebrew_subtitle';\r\n\r\n /**\r\n * The contents of the subtitle.\r\n */\r\n content: (string | Text | FootnoteReference)[];\r\n}\r\n\r\n/**\r\n * Defines an interface that represents a verse.\r\n */\r\nexport interface Verse {\r\n type: 'verse';\r\n\r\n number: number;\r\n\r\n /**\r\n * The contents of the verse.\r\n */\r\n content: (\r\n | string\r\n | Text\r\n | InlineHeading\r\n | InlineLineBreak\r\n | FootnoteReference\r\n )[];\r\n}\r\n\r\n/**\r\n * Defines an interface that represents text that has some markup attributes applied to it.\r\n */\r\nexport interface Text {\r\n /**\r\n * The text that is contained.\r\n */\r\n text: string;\r\n\r\n /**\r\n * Whether the text represents a poem.\r\n * The number indicates the level of indent.\r\n */\r\n poem?: number;\r\n\r\n /**\r\n * Whether the text contains the words of Jesus.\r\n */\r\n wordsOfJesus?: boolean;\r\n\r\n /**\r\n * Whether the text is descriptive.\r\n *\r\n * This is only used for \"hebrew subtitles\" that are included inside the verse markers.\r\n */\r\n descriptive?: boolean;\r\n}\r\n\r\n/**\r\n * Defines an interface that represents a heading that is embedded in a verse.\r\n */\r\nexport interface InlineHeading {\r\n /**\r\n * The text of the heading.\r\n */\r\n heading: string;\r\n}\r\n\r\n/**\r\n * Defines an interface that represents a line break that is embedded in a verse.\r\n */\r\nexport interface InlineLineBreak {\r\n lineBreak: true;\r\n}\r\n\r\nexport interface FootnoteReference {\r\n /**\r\n * The ID of the note that is referenced.\r\n */\r\n noteId: number;\r\n}\r\n\r\nexport interface Footnote {\r\n noteId: number;\r\n\r\n /**\r\n * The text of the footnote.\r\n */\r\n text: string;\r\n\r\n /**\r\n * The caller that should be used for the footnote.\r\n * For footnotes, a \"caller\" is the character that is used in the text to reference to footnote.\r\n *\r\n * For example, in the text:\r\n * Hello (a) World\r\n *\r\n * ----\r\n * (a) This is a footnote.\r\n *\r\n * The \"(a)\" is the caller.\r\n *\r\n * If \"+\", then the caller should be autogenerated.\r\n * If null, then the caller should be empty.\r\n * If a string, then the caller should be that string.\r\n */\r\n caller: '+' | string | null;\r\n\r\n /**\r\n * The verse reference for the footnote.\r\n */\r\n reference?: {\r\n chapter: number;\r\n verse: number;\r\n };\r\n}\r\n\r\nexport interface LineBreak {\r\n type: 'line_break';\r\n}\r\n\r\n/**\r\n * The parse tree that is gathered.\r\n */\r\nexport interface CommentaryParseTree {\r\n type: 'commentary/root';\r\n\r\n /**\r\n * The books that are contained in the commentary.\r\n */\r\n books: CommentaryBookNode[];\r\n}\r\n\r\nexport interface CommentaryBookNode {\r\n type: 'book';\r\n book: string;\r\n introduction: string | null;\r\n chapters: CommentaryChapterNode[];\r\n}\r\n\r\nexport interface CommentaryChapterNode {\r\n type: 'chapter';\r\n number: number;\r\n introduction: string | null;\r\n verses: CommentaryVerseNode[];\r\n}\r\n\r\nexport interface CommentaryVerseNode {\r\n type: 'verse';\r\n number: number;\r\n content: string[];\r\n}\r\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }