@promptbook/markdown-utils 0.67.3 → 0.67.5

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/esm/index.es.js CHANGED
@@ -1,10 +1,10 @@
1
- import spaceTrim$1, { spaceTrim } from 'spacetrim';
1
+ import spaceTrim, { spaceTrim as spaceTrim$1 } from 'spacetrim';
2
2
 
3
3
  // ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
4
4
  /**
5
5
  * The version of the Promptbook library
6
6
  */
7
- var PROMPTBOOK_VERSION = '0.67.2';
7
+ var PROMPTBOOK_VERSION = '0.67.4';
8
8
  // TODO: !!!! List here all the versions and annotate + put into script
9
9
 
10
10
  /*! *****************************************************************************
@@ -94,15 +94,196 @@ var ParsingError = /** @class */ (function (_super) {
94
94
  }(Error));
95
95
 
96
96
  /**
97
- * Removes HTML or Markdown comments from a string.
97
+ * Makes first letter of a string uppercase
98
98
  *
99
- * @param {string} content - The string to remove comments from.
100
- * @returns {string} The input string with all comments removed.
99
+ * @public exported from `@promptbook/utils`
100
+ */
101
+ function capitalize(word) {
102
+ return word.substring(0, 1).toUpperCase() + word.substring(1);
103
+ }
104
+
105
+ /**
106
+ * Extracts all code blocks from markdown.
107
+ *
108
+ * Note: There are multiple simmilar function:
109
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
110
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
111
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
112
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
113
+ *
114
+ * @param markdown any valid markdown
115
+ * @returns code blocks with language and content
116
+ * @throws {ParsingError} if block is not closed properly
101
117
  * @public exported from `@promptbook/markdown-utils`
102
118
  */
103
- function removeContentComments(content) {
104
- return spaceTrim(content.replace(/<!--(.*?)-->/gs, ''));
119
+ function extractAllBlocksFromMarkdown(markdown) {
120
+ var e_1, _a;
121
+ var codeBlocks = [];
122
+ var lines = markdown.split('\n');
123
+ // Note: [0] Ensure that the last block notated by gt > will be closed
124
+ lines.push('');
125
+ var currentCodeBlock = null;
126
+ try {
127
+ for (var lines_1 = __values(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) {
128
+ var line = lines_1_1.value;
129
+ if (line.startsWith('> ') || line === '>') {
130
+ if (currentCodeBlock === null) {
131
+ currentCodeBlock = { blockNotation: '>', language: null, content: '' };
132
+ } /* not else */
133
+ if (currentCodeBlock.blockNotation === '>') {
134
+ if (currentCodeBlock.content !== '') {
135
+ currentCodeBlock.content += '\n';
136
+ }
137
+ currentCodeBlock.content += line.slice(2);
138
+ }
139
+ }
140
+ else if (currentCodeBlock !== null && currentCodeBlock.blockNotation === '>' /* <- Note: [0] */) {
141
+ codeBlocks.push(currentCodeBlock);
142
+ currentCodeBlock = null;
143
+ }
144
+ /* not else */
145
+ if (line.startsWith('```')) {
146
+ var language = line.slice(3).trim() || null;
147
+ if (currentCodeBlock === null) {
148
+ currentCodeBlock = { blockNotation: '```', language: language, content: '' };
149
+ }
150
+ else {
151
+ if (language !== null) {
152
+ throw new ParsingError("".concat(capitalize(currentCodeBlock.language || 'the'), " code block was not closed and already opening new ").concat(language, " code block"));
153
+ }
154
+ codeBlocks.push(currentCodeBlock);
155
+ currentCodeBlock = null;
156
+ }
157
+ }
158
+ else if (currentCodeBlock !== null && currentCodeBlock.blockNotation === '```') {
159
+ if (currentCodeBlock.content !== '') {
160
+ currentCodeBlock.content += '\n';
161
+ }
162
+ currentCodeBlock.content += line.split('\\`\\`\\`').join('```') /* <- TODO: Maybe make propper unescape */;
163
+ }
164
+ }
165
+ }
166
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
167
+ finally {
168
+ try {
169
+ if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1);
170
+ }
171
+ finally { if (e_1) throw e_1.error; }
172
+ }
173
+ if (currentCodeBlock !== null) {
174
+ throw new ParsingError("".concat(capitalize(currentCodeBlock.language || 'the'), " code block was not closed at the end of the markdown"));
175
+ }
176
+ return codeBlocks;
177
+ }
178
+ /**
179
+ * TODO: Maybe name for `blockNotation` instead of '```' and '>'
180
+ */
181
+
182
+ /**
183
+ * Extracts exactly ONE code block from markdown.
184
+ *
185
+ * - When there are multiple or no code blocks the function throws a `ParsingError`
186
+ *
187
+ * Note: There are multiple simmilar function:
188
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
189
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
190
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
191
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
192
+ *
193
+ * @param markdown any valid markdown
194
+ * @returns code block with language and content
195
+ * @public exported from `@promptbook/markdown-utils`
196
+ * @throws {ParsingError} if there is not exactly one code block in the markdown
197
+ */
198
+ function extractOneBlockFromMarkdown(markdown) {
199
+ var codeBlocks = extractAllBlocksFromMarkdown(markdown);
200
+ if (codeBlocks.length !== 1) {
201
+ throw new ParsingError(spaceTrim(function (block) { return "\n There should be exactly 1 code block, found ".concat(codeBlocks.length, " code blocks\n\n ").concat(block(codeBlocks.map(function (block, i) { return "Block ".concat(i + 1, ":\n").concat(block.content); }).join('\n\n\n')), "\n "); }));
202
+ }
203
+ return codeBlocks[0];
204
+ }
205
+ /***
206
+ * TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
207
+ */
208
+
209
+ /**
210
+ * Extracts code block from markdown.
211
+ *
212
+ * - When there are multiple or no code blocks the function throws a `ParsingError`
213
+ *
214
+ * Note: There are multiple simmilar function:
215
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
216
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
217
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
218
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
219
+ *
220
+ * @public exported from `@promptbook/markdown-utils`
221
+ * @throws {ParsingError} if there is not exactly one code block in the markdown
222
+ */
223
+ function extractBlock(markdown) {
224
+ var content = extractOneBlockFromMarkdown(markdown).content;
225
+ return content;
226
+ }
227
+
228
+ /**
229
+ * Function isValidJsonString will tell you if the string is valid JSON or not
230
+ *
231
+ * @public exported from `@promptbook/utils`
232
+ */
233
+ function isValidJsonString(value /* <- [👨‍⚖️] */) {
234
+ try {
235
+ JSON.parse(value);
236
+ return true;
237
+ }
238
+ catch (error) {
239
+ if (!(error instanceof Error)) {
240
+ throw error;
241
+ }
242
+ if (error.message.includes('Unexpected token')) {
243
+ return false;
244
+ }
245
+ return false;
246
+ }
247
+ }
248
+
249
+ /**
250
+ * Extracts extracts exactly one valid JSON code block
251
+ *
252
+ * - When given string is a valid JSON as it is, it just returns it
253
+ * - When there is no JSON code block the function throws a `ParsingError`
254
+ * - When there are multiple JSON code blocks the function throws a `ParsingError`
255
+ *
256
+ * Note: It is not important if marked as ```json BUT if it is VALID JSON
257
+ * Note: There are multiple simmilar function:
258
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
259
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
260
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
261
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
262
+ *
263
+ * @public exported from `@promptbook/markdown-utils`
264
+ * @throws {ParsingError} if there is no valid JSON block in the markdown
265
+ */
266
+ function extractJsonBlock(markdown) {
267
+ if (isValidJsonString(markdown)) {
268
+ return markdown;
269
+ }
270
+ var codeBlocks = extractAllBlocksFromMarkdown(markdown);
271
+ var jsonBlocks = codeBlocks.filter(function (_a) {
272
+ var content = _a.content;
273
+ return isValidJsonString(content);
274
+ });
275
+ if (jsonBlocks.length === 0) {
276
+ throw new Error('There is no valid JSON block in the markdown');
277
+ }
278
+ if (jsonBlocks.length > 1) {
279
+ throw new Error('There are multiple JSON code blocks in the markdown');
280
+ }
281
+ return jsonBlocks[0].content;
105
282
  }
283
+ /**
284
+ * TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
285
+ * TODO: [🏢] Make this logic part of `JsonFormatDefinition` or `isValidJsonString`
286
+ */
106
287
 
107
288
  /**
108
289
  * @@@
@@ -146,7 +327,7 @@ function $deepFreeze(objectValue) {
146
327
  var UnexpectedError = /** @class */ (function (_super) {
147
328
  __extends(UnexpectedError, _super);
148
329
  function UnexpectedError(message) {
149
- var _this = _super.call(this, spaceTrim(function (block) { return "\n ".concat(block(message), "\n\n Note: This error should not happen.\n It's probbably a bug in the pipeline collection\n\n Please report issue:\n https://github.com/webgptorg/promptbook/issues\n\n Or contact us on me@pavolhejny.com\n\n "); })) || this;
330
+ var _this = _super.call(this, spaceTrim$1(function (block) { return "\n ".concat(block(message), "\n\n Note: This error should not happen.\n It's probbably a bug in the pipeline collection\n\n Please report issue:\n https://github.com/webgptorg/promptbook/issues\n\n Or contact us on me@pavolhejny.com\n\n "); })) || this;
150
331
  _this.name = 'UnexpectedError';
151
332
  Object.setPrototypeOf(_this, UnexpectedError.prototype);
152
333
  return _this;
@@ -204,7 +385,7 @@ function checkSerializableAsJson(name, value) {
204
385
  }
205
386
  else if (typeof value === 'object') {
206
387
  if (value instanceof Date) {
207
- throw new UnexpectedError(spaceTrim$1("\n ".concat(name, " is Date\n\n Use `string_date_iso8601` instead\n ")));
388
+ throw new UnexpectedError(spaceTrim("\n ".concat(name, " is Date\n\n Use `string_date_iso8601` instead\n ")));
208
389
  }
209
390
  else if (value instanceof Map) {
210
391
  throw new UnexpectedError("".concat(name, " is Map"));
@@ -216,7 +397,7 @@ function checkSerializableAsJson(name, value) {
216
397
  throw new UnexpectedError("".concat(name, " is RegExp"));
217
398
  }
218
399
  else if (value instanceof Error) {
219
- throw new UnexpectedError(spaceTrim$1("\n ".concat(name, " is unserialized Error\n\n Use function `serializeError`\n ")));
400
+ throw new UnexpectedError(spaceTrim("\n ".concat(name, " is unserialized Error\n\n Use function `serializeError`\n ")));
220
401
  }
221
402
  else {
222
403
  try {
@@ -243,7 +424,7 @@ function checkSerializableAsJson(name, value) {
243
424
  if (!(error instanceof Error)) {
244
425
  throw error;
245
426
  }
246
- throw new UnexpectedError(spaceTrim$1(function (block) { return "\n ".concat(name, " is not serializable\n\n ").concat(block(error.toString()), "\n "); }));
427
+ throw new UnexpectedError(spaceTrim(function (block) { return "\n ".concat(name, " is not serializable\n\n ").concat(block(error.toString()), "\n "); }));
247
428
  }
248
429
  /*
249
430
  TODO: [0] Is there some more elegant way to check circular references?
@@ -322,6 +503,17 @@ $asDeeplyFrozenSerializableJson('RESERVED_PARAMETER_NAMES', [
322
503
  * TODO: [🧠][🧜‍♂️] Maybe join remoteUrl and path into single value
323
504
  */
324
505
 
506
+ /**
507
+ * Removes HTML or Markdown comments from a string.
508
+ *
509
+ * @param {string} content - The string to remove comments from.
510
+ * @returns {string} The input string with all comments removed.
511
+ * @public exported from `@promptbook/markdown-utils`
512
+ */
513
+ function removeContentComments(content) {
514
+ return spaceTrim$1(content.replace(/<!--(.*?)-->/gs, ''));
515
+ }
516
+
325
517
  /**
326
518
  * Add or modify an auto-generated section in a markdown file
327
519
  *
@@ -333,12 +525,12 @@ function addAutoGeneratedSection(content, options) {
333
525
  var sectionRegex = new RegExp("<!--".concat(sectionName, "-->([\\s\\S]*?)<!--/").concat(sectionName, "-->"), 'g');
334
526
  var sectionMatch = content.match(sectionRegex);
335
527
  if (sectionMatch) {
336
- return content.replace(sectionRegex, spaceTrim(function (block) { return "\n <!--".concat(sectionName, "-->\n ").concat(block(warningLine), "\n ").concat(block(sectionContent), "\n <!--/").concat(sectionName, "-->\n "); }));
528
+ return content.replace(sectionRegex, spaceTrim$1(function (block) { return "\n <!--".concat(sectionName, "-->\n ").concat(block(warningLine), "\n ").concat(block(sectionContent), "\n <!--/").concat(sectionName, "-->\n "); }));
337
529
  }
338
530
  var placeForSection = removeContentComments(content).match(/^##.*$/im);
339
531
  if (!placeForSection) {
340
532
  throw new ParsingError(
341
- // <- [🧠] Maybe something better than `ParsingError`
533
+ // <- [🧠] Maybe something better tha `ParsingError`
342
534
  "No place where to put the section <!--".concat(sectionName, "-->"));
343
535
  // <- [🚞]
344
536
  }
@@ -465,90 +657,6 @@ function escapeMarkdownBlock(value) {
465
657
  * TODO: [🏛] This can be part of markdown builder
466
658
  */
467
659
 
468
- /**
469
- * Makes first letter of a string uppercase
470
- *
471
- * @public exported from `@promptbook/utils`
472
- */
473
- function capitalize(word) {
474
- return word.substring(0, 1).toUpperCase() + word.substring(1);
475
- }
476
-
477
- /**
478
- * Extracts all code blocks from markdown.
479
- *
480
- * Note: There are 3 simmilar function:
481
- * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
482
- * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
483
- * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
484
- *
485
- * @param markdown any valid markdown
486
- * @returns code blocks with language and content
487
- * @public exported from `@promptbook/markdown-utils`
488
- */
489
- function extractAllBlocksFromMarkdown(markdown) {
490
- var e_1, _a;
491
- var codeBlocks = [];
492
- var lines = markdown.split('\n');
493
- // Note: [0] Ensure that the last block notated by gt > will be closed
494
- lines.push('');
495
- var currentCodeBlock = null;
496
- try {
497
- for (var lines_1 = __values(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) {
498
- var line = lines_1_1.value;
499
- if (line.startsWith('> ') || line === '>') {
500
- if (currentCodeBlock === null) {
501
- currentCodeBlock = { blockNotation: '>', language: null, content: '' };
502
- } /* not else */
503
- if (currentCodeBlock.blockNotation === '>') {
504
- if (currentCodeBlock.content !== '') {
505
- currentCodeBlock.content += '\n';
506
- }
507
- currentCodeBlock.content += line.slice(2);
508
- }
509
- }
510
- else if (currentCodeBlock !== null && currentCodeBlock.blockNotation === '>' /* <- Note: [0] */) {
511
- codeBlocks.push(currentCodeBlock);
512
- currentCodeBlock = null;
513
- }
514
- /* not else */
515
- if (line.startsWith('```')) {
516
- var language = line.slice(3).trim() || null;
517
- if (currentCodeBlock === null) {
518
- currentCodeBlock = { blockNotation: '```', language: language, content: '' };
519
- }
520
- else {
521
- if (language !== null) {
522
- throw new ParsingError("".concat(capitalize(currentCodeBlock.language || 'the'), " code block was not closed and already opening new ").concat(language, " code block"));
523
- }
524
- codeBlocks.push(currentCodeBlock);
525
- currentCodeBlock = null;
526
- }
527
- }
528
- else if (currentCodeBlock !== null && currentCodeBlock.blockNotation === '```') {
529
- if (currentCodeBlock.content !== '') {
530
- currentCodeBlock.content += '\n';
531
- }
532
- currentCodeBlock.content += line.split('\\`\\`\\`').join('```') /* <- TODO: Maybe make propper unescape */;
533
- }
534
- }
535
- }
536
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
537
- finally {
538
- try {
539
- if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1);
540
- }
541
- finally { if (e_1) throw e_1.error; }
542
- }
543
- if (currentCodeBlock !== null) {
544
- throw new ParsingError("".concat(capitalize(currentCodeBlock.language || 'the'), " code block was not closed at the end of the markdown"));
545
- }
546
- return codeBlocks;
547
- }
548
- /**
549
- * TODO: Maybe name for `blockNotation` instead of '```' and '>'
550
- */
551
-
552
660
  /**
553
661
  * Utility function to extract all list items from markdown
554
662
  *
@@ -589,31 +697,6 @@ function extractAllListItemsFromMarkdown(markdown) {
589
697
  return listItems;
590
698
  }
591
699
 
592
- /**
593
- * Extracts exactly ONE code block from markdown.
594
- *
595
- * Note: If there are multiple or no code blocks the function throws an error
596
- *
597
- * Note: There are 3 simmilar function:
598
- * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
599
- * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
600
- * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
601
- *
602
- * @param markdown any valid markdown
603
- * @returns code block with language and content
604
- * @public exported from `@promptbook/markdown-utils`
605
- */
606
- function extractOneBlockFromMarkdown(markdown) {
607
- var codeBlocks = extractAllBlocksFromMarkdown(markdown);
608
- if (codeBlocks.length !== 1) {
609
- throw new ParsingError(spaceTrim$1(function (block) { return "\n There should be exactly 1 code block, found ".concat(codeBlocks.length, " code blocks\n\n ").concat(block(codeBlocks.map(function (block, i) { return "Block ".concat(i + 1, ":\n").concat(block.content); }).join('\n\n\n')), "\n "); }));
610
- }
611
- return codeBlocks[0];
612
- }
613
- /***
614
- * TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
615
- */
616
-
617
700
  /**
618
701
  * Parses markdown section to title its level and content
619
702
  *
@@ -627,7 +710,7 @@ function parseMarkdownSection(value) {
627
710
  }
628
711
  var title = lines[0].replace(/^#+\s*/, '');
629
712
  var level = (_b = (_a = lines[0].match(/^#+/)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0;
630
- var content = spaceTrim$1(lines.slice(1).join('\n'));
713
+ var content = spaceTrim(lines.slice(1).join('\n'));
631
714
  if (level < 1 || level > 6) {
632
715
  throw new ParsingError('Markdown section must have heading level between 1 and 6');
633
716
  }
@@ -655,7 +738,7 @@ function splitMarkdownIntoSections(markdown) {
655
738
  if (buffer.length === 0) {
656
739
  return;
657
740
  }
658
- var section = spaceTrim$1(buffer.join('\n'));
741
+ var section = spaceTrim(buffer.join('\n'));
659
742
  if (section === '') {
660
743
  return;
661
744
  }
@@ -751,7 +834,7 @@ function flattenMarkdown(markdown) {
751
834
  }
752
835
  finally { if (e_1) throw e_1.error; }
753
836
  }
754
- return spaceTrim$1(flattenedMarkdown);
837
+ return spaceTrim(flattenedMarkdown);
755
838
  }
756
839
  /**
757
840
  * TODO: [🏛] This can be part of markdown builder
@@ -778,5 +861,5 @@ function removeMarkdownFormatting(str) {
778
861
  return str;
779
862
  }
780
863
 
781
- export { PROMPTBOOK_VERSION, addAutoGeneratedSection, createMarkdownChart, createMarkdownTable, escapeMarkdownBlock, extractAllBlocksFromMarkdown, extractAllListItemsFromMarkdown, extractOneBlockFromMarkdown, flattenMarkdown, parseMarkdownSection, removeContentComments, removeMarkdownFormatting, splitMarkdownIntoSections };
864
+ export { PROMPTBOOK_VERSION, addAutoGeneratedSection, createMarkdownChart, createMarkdownTable, escapeMarkdownBlock, extractAllBlocksFromMarkdown, extractAllListItemsFromMarkdown, extractBlock, extractJsonBlock, extractOneBlockFromMarkdown, flattenMarkdown, parseMarkdownSection, removeContentComments, removeMarkdownFormatting, splitMarkdownIntoSections };
782
865
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../../../../src/version.ts","../../../node_modules/tslib/tslib.es6.js","../../../../src/errors/ParsingError.ts","../../../../src/utils/markdown/removeContentComments.ts","../../../../src/utils/serialization/$deepFreeze.ts","../../../../src/errors/UnexpectedError.ts","../../../../src/utils/serialization/checkSerializableAsJson.ts","../../../../src/utils/serialization/$asDeeplyFrozenSerializableJson.ts","../../../../src/config.ts","../../../../src/utils/markdown/addAutoGeneratedSection.ts","../../../../src/utils/formatNumber.ts","../../../../src/utils/removeEmojis.ts","../../../../src/utils/markdown/createMarkdownTable.ts","../../../../src/utils/markdown/createMarkdownChart.ts","../../../../src/utils/markdown/escapeMarkdownBlock.ts","../../../../src/utils/normalization/capitalize.ts","../../../../src/utils/markdown/extractAllBlocksFromMarkdown.ts","../../../../src/utils/markdown/extractAllListItemsFromMarkdown.ts","../../../../src/utils/markdown/extractOneBlockFromMarkdown.ts","../../../../src/utils/markdown/parseMarkdownSection.ts","../../../../src/utils/markdown/splitMarkdownIntoSections.ts","../../../../src/utils/markdown/flattenMarkdown.ts","../../../../src/utils/markdown/removeMarkdownFormatting.ts"],"sourcesContent":[null,"/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["spaceTrim"],"mappings":";;AAAA;AAIA;;;IAGa,kBAAkB,GAA8B,SAAS;AAGtE;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AAC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AC;SACzC;;;;;;;;;IAED,OAAOA,WAAS,CAAC,iBAAiB,CAAa,CAAC;AACpD,CAAC;AAED;;;;;;;;ACvCA;;;;;;;SAOgB,wBAAwB,CAAC,GAAyB;;IAE9D,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;;IAG1C,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;;IAGtC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAEpC,OAAO,GAAG,CAAC;AACf;;;;"}
1
+ {"version":3,"file":"index.es.js","sources":["../../../../src/version.ts","../../../node_modules/tslib/tslib.es6.js","../../../../src/errors/ParsingError.ts","../../../../src/utils/normalization/capitalize.ts","../../../../src/utils/markdown/extractAllBlocksFromMarkdown.ts","../../../../src/utils/markdown/extractOneBlockFromMarkdown.ts","../../../../src/postprocessing/utils/extractBlock.ts","../../../../src/formats/json/utils/isValidJsonString.ts","../../../../src/postprocessing/utils/extractJsonBlock.ts","../../../../src/utils/serialization/$deepFreeze.ts","../../../../src/errors/UnexpectedError.ts","../../../../src/utils/serialization/checkSerializableAsJson.ts","../../../../src/utils/serialization/$asDeeplyFrozenSerializableJson.ts","../../../../src/config.ts","../../../../src/utils/markdown/removeContentComments.ts","../../../../src/utils/markdown/addAutoGeneratedSection.ts","../../../../src/utils/formatNumber.ts","../../../../src/utils/removeEmojis.ts","../../../../src/utils/markdown/createMarkdownTable.ts","../../../../src/utils/markdown/createMarkdownChart.ts","../../../../src/utils/markdown/escapeMarkdownBlock.ts","../../../../src/utils/markdown/extractAllListItemsFromMarkdown.ts","../../../../src/utils/markdown/parseMarkdownSection.ts","../../../../src/utils/markdown/splitMarkdownIntoSections.ts","../../../../src/utils/markdown/flattenMarkdown.ts","../../../../src/utils/markdown/removeMarkdownFormatting.ts"],"sourcesContent":[null,"/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["spaceTrim"],"mappings":";;AAAA;AAIA;;;IAGa,kBAAkB,GAA8B,SAAS;AAGtE;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,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AAO,aAAA;YACvB,iBAAiB,IAAI,aAAM,KAAK,CAAE,GAAG,MAAM,CAAC;YAC5C,iBAAiB,IAAI,OAAO,GAAG,MAAM,CAAC;SACzC;;;;;;;;;IAED,OAAO,SAAS,CAAC,iBAAiB,CAAa,CAAC;AACpD,CAAC;AAED;;;;;;;;ACvCA;;;;;;;SAOgB,wBAAwB,CAAC,GAAyB;;IAE9D,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;;IAG1C,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;;IAGtC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAEpC,OAAO,GAAG,CAAC;AACf;;;;"}
@@ -1,4 +1,6 @@
1
1
  import { PROMPTBOOK_VERSION } from '../version';
2
+ import { extractBlock } from '../postprocessing/utils/extractBlock';
3
+ import { extractJsonBlock } from '../postprocessing/utils/extractJsonBlock';
2
4
  import type { string_markdown } from '../types/typeAliases';
3
5
  import type { string_markdown_section } from '../types/typeAliases';
4
6
  import type { string_markdown_section_content } from '../types/typeAliases';
@@ -17,6 +19,8 @@ import { removeContentComments } from '../utils/markdown/removeContentComments';
17
19
  import { removeMarkdownFormatting } from '../utils/markdown/removeMarkdownFormatting';
18
20
  import { splitMarkdownIntoSections } from '../utils/markdown/splitMarkdownIntoSections';
19
21
  export { PROMPTBOOK_VERSION };
22
+ export { extractBlock };
23
+ export { extractJsonBlock };
20
24
  export type { string_markdown };
21
25
  export type { string_markdown_section };
22
26
  export type { string_markdown_section_content };
@@ -8,7 +8,6 @@ import { deserializeError } from '../errors/utils/deserializeError';
8
8
  import { serializeError } from '../errors/utils/serializeError';
9
9
  import { forEachAsync } from '../execution/utils/forEachAsync';
10
10
  import { isValidJsonString } from '../formats/json/utils/isValidJsonString';
11
- import { extractBlock } from '../postprocessing/utils/extractBlock';
12
11
  import { $currentDate } from '../utils/$currentDate';
13
12
  import { $isRunningInBrowser } from '../utils/environment/$isRunningInBrowser';
14
13
  import { $isRunningInNode } from '../utils/environment/$isRunningInNode';
@@ -80,7 +79,6 @@ export { deserializeError };
80
79
  export { serializeError };
81
80
  export { forEachAsync };
82
81
  export { isValidJsonString };
83
- export { extractBlock };
84
82
  export { $currentDate };
85
83
  export { $isRunningInBrowser };
86
84
  export { $isRunningInNode };
@@ -62,6 +62,7 @@ export type FormatDefinition<TValue extends TPartialValue, TPartialValue extends
62
62
  extractValues(value: string, schema?: TSchema): Array<string>;
63
63
  };
64
64
  /**
65
+ * TODO: [♏] Add some prepare hook to modify prompt according to the format
65
66
  * TODO: [🍓]`name` and `aliases` should be UPPERCASE only and interpreted as case-insensitive (via normalization)
66
67
  * TODO: [🍓][👨‍⚖️] Compute TPartialValue dynamically - PartialString<TValue>
67
68
  * TODO: [🍓][🧠] Should execution tools be aviable to heal, canBeValid and isValid?
@@ -2,16 +2,15 @@ import type { string_markdown } from '../../types/typeAliases';
2
2
  /**
3
3
  * Extracts code block from markdown.
4
4
  *
5
- * Note: If there are multiple or no code blocks the function throws an error
5
+ * - When there are multiple or no code blocks the function throws a `ParsingError`
6
6
  *
7
- * Note: There are 3 simmilar function:
7
+ * Note: There are multiple simmilar function:
8
8
  * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
9
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
9
10
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
10
11
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
11
12
  *
12
- * @public exported from `@promptbook/utils`
13
+ * @public exported from `@promptbook/markdown-utils`
14
+ * @throws {ParsingError} if there is not exactly one code block in the markdown
13
15
  */
14
16
  export declare function extractBlock(markdown: string_markdown): string;
15
- /**
16
- * TODO: [🧠][🌻] Maybe export through `@promptbook/markdown-utils` not `@promptbook/utils`
17
- */
@@ -0,0 +1,25 @@
1
+ import type { string_json } from '../../types/typeAliases';
2
+ import type { string_markdown } from '../../types/typeAliases';
3
+ import type { really_unknown } from '../../utils/organization/really_unknown';
4
+ /**
5
+ * Extracts extracts exactly one valid JSON code block
6
+ *
7
+ * - When given string is a valid JSON as it is, it just returns it
8
+ * - When there is no JSON code block the function throws a `ParsingError`
9
+ * - When there are multiple JSON code blocks the function throws a `ParsingError`
10
+ *
11
+ * Note: It is not important if marked as ```json BUT if it is VALID JSON
12
+ * Note: There are multiple simmilar function:
13
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
14
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
15
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
16
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
17
+ *
18
+ * @public exported from `@promptbook/markdown-utils`
19
+ * @throws {ParsingError} if there is no valid JSON block in the markdown
20
+ */
21
+ export declare function extractJsonBlock(markdown: string_markdown): string_json<really_unknown>;
22
+ /**
23
+ * TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
24
+ * TODO: [🏢] Make this logic part of `JsonFormatDefinition` or `isValidJsonString`
25
+ */
@@ -19,13 +19,15 @@ export type CodeBlock = {
19
19
  /**
20
20
  * Extracts all code blocks from markdown.
21
21
  *
22
- * Note: There are 3 simmilar function:
22
+ * Note: There are multiple simmilar function:
23
23
  * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
24
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
24
25
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
25
26
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
26
27
  *
27
28
  * @param markdown any valid markdown
28
29
  * @returns code blocks with language and content
30
+ * @throws {ParsingError} if block is not closed properly
29
31
  * @public exported from `@promptbook/markdown-utils`
30
32
  */
31
33
  export declare function extractAllBlocksFromMarkdown(markdown: string_markdown): Array<CodeBlock>;
@@ -3,16 +3,18 @@ import type { CodeBlock } from './extractAllBlocksFromMarkdown';
3
3
  /**
4
4
  * Extracts exactly ONE code block from markdown.
5
5
  *
6
- * Note: If there are multiple or no code blocks the function throws an error
6
+ * - When there are multiple or no code blocks the function throws a `ParsingError`
7
7
  *
8
- * Note: There are 3 simmilar function:
8
+ * Note: There are multiple simmilar function:
9
9
  * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
10
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
10
11
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
11
12
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
12
13
  *
13
14
  * @param markdown any valid markdown
14
15
  * @returns code block with language and content
15
16
  * @public exported from `@promptbook/markdown-utils`
17
+ * @throws {ParsingError} if there is not exactly one code block in the markdown
16
18
  */
17
19
  export declare function extractOneBlockFromMarkdown(markdown: string_markdown): CodeBlock;
18
20
  /***
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/markdown-utils",
3
- "version": "0.67.3",
3
+ "version": "0.67.5",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -12,7 +12,7 @@
12
12
  /**
13
13
  * The version of the Promptbook library
14
14
  */
15
- var PROMPTBOOK_VERSION = '0.67.2';
15
+ var PROMPTBOOK_VERSION = '0.67.4';
16
16
  // TODO: !!!! List here all the versions and annotate + put into script
17
17
 
18
18
  /*! *****************************************************************************
@@ -102,15 +102,196 @@
102
102
  }(Error));
103
103
 
104
104
  /**
105
- * Removes HTML or Markdown comments from a string.
105
+ * Makes first letter of a string uppercase
106
106
  *
107
- * @param {string} content - The string to remove comments from.
108
- * @returns {string} The input string with all comments removed.
107
+ * @public exported from `@promptbook/utils`
108
+ */
109
+ function capitalize(word) {
110
+ return word.substring(0, 1).toUpperCase() + word.substring(1);
111
+ }
112
+
113
+ /**
114
+ * Extracts all code blocks from markdown.
115
+ *
116
+ * Note: There are multiple simmilar function:
117
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
118
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
119
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
120
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
121
+ *
122
+ * @param markdown any valid markdown
123
+ * @returns code blocks with language and content
124
+ * @throws {ParsingError} if block is not closed properly
109
125
  * @public exported from `@promptbook/markdown-utils`
110
126
  */
111
- function removeContentComments(content) {
112
- return spaceTrim.spaceTrim(content.replace(/<!--(.*?)-->/gs, ''));
127
+ function extractAllBlocksFromMarkdown(markdown) {
128
+ var e_1, _a;
129
+ var codeBlocks = [];
130
+ var lines = markdown.split('\n');
131
+ // Note: [0] Ensure that the last block notated by gt > will be closed
132
+ lines.push('');
133
+ var currentCodeBlock = null;
134
+ try {
135
+ for (var lines_1 = __values(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) {
136
+ var line = lines_1_1.value;
137
+ if (line.startsWith('> ') || line === '>') {
138
+ if (currentCodeBlock === null) {
139
+ currentCodeBlock = { blockNotation: '>', language: null, content: '' };
140
+ } /* not else */
141
+ if (currentCodeBlock.blockNotation === '>') {
142
+ if (currentCodeBlock.content !== '') {
143
+ currentCodeBlock.content += '\n';
144
+ }
145
+ currentCodeBlock.content += line.slice(2);
146
+ }
147
+ }
148
+ else if (currentCodeBlock !== null && currentCodeBlock.blockNotation === '>' /* <- Note: [0] */) {
149
+ codeBlocks.push(currentCodeBlock);
150
+ currentCodeBlock = null;
151
+ }
152
+ /* not else */
153
+ if (line.startsWith('```')) {
154
+ var language = line.slice(3).trim() || null;
155
+ if (currentCodeBlock === null) {
156
+ currentCodeBlock = { blockNotation: '```', language: language, content: '' };
157
+ }
158
+ else {
159
+ if (language !== null) {
160
+ throw new ParsingError("".concat(capitalize(currentCodeBlock.language || 'the'), " code block was not closed and already opening new ").concat(language, " code block"));
161
+ }
162
+ codeBlocks.push(currentCodeBlock);
163
+ currentCodeBlock = null;
164
+ }
165
+ }
166
+ else if (currentCodeBlock !== null && currentCodeBlock.blockNotation === '```') {
167
+ if (currentCodeBlock.content !== '') {
168
+ currentCodeBlock.content += '\n';
169
+ }
170
+ currentCodeBlock.content += line.split('\\`\\`\\`').join('```') /* <- TODO: Maybe make propper unescape */;
171
+ }
172
+ }
173
+ }
174
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
175
+ finally {
176
+ try {
177
+ if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1);
178
+ }
179
+ finally { if (e_1) throw e_1.error; }
180
+ }
181
+ if (currentCodeBlock !== null) {
182
+ throw new ParsingError("".concat(capitalize(currentCodeBlock.language || 'the'), " code block was not closed at the end of the markdown"));
183
+ }
184
+ return codeBlocks;
185
+ }
186
+ /**
187
+ * TODO: Maybe name for `blockNotation` instead of '```' and '>'
188
+ */
189
+
190
+ /**
191
+ * Extracts exactly ONE code block from markdown.
192
+ *
193
+ * - When there are multiple or no code blocks the function throws a `ParsingError`
194
+ *
195
+ * Note: There are multiple simmilar function:
196
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
197
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
198
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
199
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
200
+ *
201
+ * @param markdown any valid markdown
202
+ * @returns code block with language and content
203
+ * @public exported from `@promptbook/markdown-utils`
204
+ * @throws {ParsingError} if there is not exactly one code block in the markdown
205
+ */
206
+ function extractOneBlockFromMarkdown(markdown) {
207
+ var codeBlocks = extractAllBlocksFromMarkdown(markdown);
208
+ if (codeBlocks.length !== 1) {
209
+ throw new ParsingError(spaceTrim__default["default"](function (block) { return "\n There should be exactly 1 code block, found ".concat(codeBlocks.length, " code blocks\n\n ").concat(block(codeBlocks.map(function (block, i) { return "Block ".concat(i + 1, ":\n").concat(block.content); }).join('\n\n\n')), "\n "); }));
210
+ }
211
+ return codeBlocks[0];
212
+ }
213
+ /***
214
+ * TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
215
+ */
216
+
217
+ /**
218
+ * Extracts code block from markdown.
219
+ *
220
+ * - When there are multiple or no code blocks the function throws a `ParsingError`
221
+ *
222
+ * Note: There are multiple simmilar function:
223
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
224
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
225
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
226
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
227
+ *
228
+ * @public exported from `@promptbook/markdown-utils`
229
+ * @throws {ParsingError} if there is not exactly one code block in the markdown
230
+ */
231
+ function extractBlock(markdown) {
232
+ var content = extractOneBlockFromMarkdown(markdown).content;
233
+ return content;
234
+ }
235
+
236
+ /**
237
+ * Function isValidJsonString will tell you if the string is valid JSON or not
238
+ *
239
+ * @public exported from `@promptbook/utils`
240
+ */
241
+ function isValidJsonString(value /* <- [👨‍⚖️] */) {
242
+ try {
243
+ JSON.parse(value);
244
+ return true;
245
+ }
246
+ catch (error) {
247
+ if (!(error instanceof Error)) {
248
+ throw error;
249
+ }
250
+ if (error.message.includes('Unexpected token')) {
251
+ return false;
252
+ }
253
+ return false;
254
+ }
255
+ }
256
+
257
+ /**
258
+ * Extracts extracts exactly one valid JSON code block
259
+ *
260
+ * - When given string is a valid JSON as it is, it just returns it
261
+ * - When there is no JSON code block the function throws a `ParsingError`
262
+ * - When there are multiple JSON code blocks the function throws a `ParsingError`
263
+ *
264
+ * Note: It is not important if marked as ```json BUT if it is VALID JSON
265
+ * Note: There are multiple simmilar function:
266
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
267
+ * - `extractJsonBlock` extracts exactly one valid JSON code block
268
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
269
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
270
+ *
271
+ * @public exported from `@promptbook/markdown-utils`
272
+ * @throws {ParsingError} if there is no valid JSON block in the markdown
273
+ */
274
+ function extractJsonBlock(markdown) {
275
+ if (isValidJsonString(markdown)) {
276
+ return markdown;
277
+ }
278
+ var codeBlocks = extractAllBlocksFromMarkdown(markdown);
279
+ var jsonBlocks = codeBlocks.filter(function (_a) {
280
+ var content = _a.content;
281
+ return isValidJsonString(content);
282
+ });
283
+ if (jsonBlocks.length === 0) {
284
+ throw new Error('There is no valid JSON block in the markdown');
285
+ }
286
+ if (jsonBlocks.length > 1) {
287
+ throw new Error('There are multiple JSON code blocks in the markdown');
288
+ }
289
+ return jsonBlocks[0].content;
113
290
  }
291
+ /**
292
+ * TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
293
+ * TODO: [🏢] Make this logic part of `JsonFormatDefinition` or `isValidJsonString`
294
+ */
114
295
 
115
296
  /**
116
297
  * @@@
@@ -330,6 +511,17 @@
330
511
  * TODO: [🧠][🧜‍♂️] Maybe join remoteUrl and path into single value
331
512
  */
332
513
 
514
+ /**
515
+ * Removes HTML or Markdown comments from a string.
516
+ *
517
+ * @param {string} content - The string to remove comments from.
518
+ * @returns {string} The input string with all comments removed.
519
+ * @public exported from `@promptbook/markdown-utils`
520
+ */
521
+ function removeContentComments(content) {
522
+ return spaceTrim.spaceTrim(content.replace(/<!--(.*?)-->/gs, ''));
523
+ }
524
+
333
525
  /**
334
526
  * Add or modify an auto-generated section in a markdown file
335
527
  *
@@ -346,7 +538,7 @@
346
538
  var placeForSection = removeContentComments(content).match(/^##.*$/im);
347
539
  if (!placeForSection) {
348
540
  throw new ParsingError(
349
- // <- [🧠] Maybe something better than `ParsingError`
541
+ // <- [🧠] Maybe something better tha `ParsingError`
350
542
  "No place where to put the section <!--".concat(sectionName, "-->"));
351
543
  // <- [🚞]
352
544
  }
@@ -473,90 +665,6 @@
473
665
  * TODO: [🏛] This can be part of markdown builder
474
666
  */
475
667
 
476
- /**
477
- * Makes first letter of a string uppercase
478
- *
479
- * @public exported from `@promptbook/utils`
480
- */
481
- function capitalize(word) {
482
- return word.substring(0, 1).toUpperCase() + word.substring(1);
483
- }
484
-
485
- /**
486
- * Extracts all code blocks from markdown.
487
- *
488
- * Note: There are 3 simmilar function:
489
- * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
490
- * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
491
- * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
492
- *
493
- * @param markdown any valid markdown
494
- * @returns code blocks with language and content
495
- * @public exported from `@promptbook/markdown-utils`
496
- */
497
- function extractAllBlocksFromMarkdown(markdown) {
498
- var e_1, _a;
499
- var codeBlocks = [];
500
- var lines = markdown.split('\n');
501
- // Note: [0] Ensure that the last block notated by gt > will be closed
502
- lines.push('');
503
- var currentCodeBlock = null;
504
- try {
505
- for (var lines_1 = __values(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) {
506
- var line = lines_1_1.value;
507
- if (line.startsWith('> ') || line === '>') {
508
- if (currentCodeBlock === null) {
509
- currentCodeBlock = { blockNotation: '>', language: null, content: '' };
510
- } /* not else */
511
- if (currentCodeBlock.blockNotation === '>') {
512
- if (currentCodeBlock.content !== '') {
513
- currentCodeBlock.content += '\n';
514
- }
515
- currentCodeBlock.content += line.slice(2);
516
- }
517
- }
518
- else if (currentCodeBlock !== null && currentCodeBlock.blockNotation === '>' /* <- Note: [0] */) {
519
- codeBlocks.push(currentCodeBlock);
520
- currentCodeBlock = null;
521
- }
522
- /* not else */
523
- if (line.startsWith('```')) {
524
- var language = line.slice(3).trim() || null;
525
- if (currentCodeBlock === null) {
526
- currentCodeBlock = { blockNotation: '```', language: language, content: '' };
527
- }
528
- else {
529
- if (language !== null) {
530
- throw new ParsingError("".concat(capitalize(currentCodeBlock.language || 'the'), " code block was not closed and already opening new ").concat(language, " code block"));
531
- }
532
- codeBlocks.push(currentCodeBlock);
533
- currentCodeBlock = null;
534
- }
535
- }
536
- else if (currentCodeBlock !== null && currentCodeBlock.blockNotation === '```') {
537
- if (currentCodeBlock.content !== '') {
538
- currentCodeBlock.content += '\n';
539
- }
540
- currentCodeBlock.content += line.split('\\`\\`\\`').join('```') /* <- TODO: Maybe make propper unescape */;
541
- }
542
- }
543
- }
544
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
545
- finally {
546
- try {
547
- if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1);
548
- }
549
- finally { if (e_1) throw e_1.error; }
550
- }
551
- if (currentCodeBlock !== null) {
552
- throw new ParsingError("".concat(capitalize(currentCodeBlock.language || 'the'), " code block was not closed at the end of the markdown"));
553
- }
554
- return codeBlocks;
555
- }
556
- /**
557
- * TODO: Maybe name for `blockNotation` instead of '```' and '>'
558
- */
559
-
560
668
  /**
561
669
  * Utility function to extract all list items from markdown
562
670
  *
@@ -597,31 +705,6 @@
597
705
  return listItems;
598
706
  }
599
707
 
600
- /**
601
- * Extracts exactly ONE code block from markdown.
602
- *
603
- * Note: If there are multiple or no code blocks the function throws an error
604
- *
605
- * Note: There are 3 simmilar function:
606
- * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
607
- * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
608
- * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
609
- *
610
- * @param markdown any valid markdown
611
- * @returns code block with language and content
612
- * @public exported from `@promptbook/markdown-utils`
613
- */
614
- function extractOneBlockFromMarkdown(markdown) {
615
- var codeBlocks = extractAllBlocksFromMarkdown(markdown);
616
- if (codeBlocks.length !== 1) {
617
- throw new ParsingError(spaceTrim__default["default"](function (block) { return "\n There should be exactly 1 code block, found ".concat(codeBlocks.length, " code blocks\n\n ").concat(block(codeBlocks.map(function (block, i) { return "Block ".concat(i + 1, ":\n").concat(block.content); }).join('\n\n\n')), "\n "); }));
618
- }
619
- return codeBlocks[0];
620
- }
621
- /***
622
- * TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
623
- */
624
-
625
708
  /**
626
709
  * Parses markdown section to title its level and content
627
710
  *
@@ -793,6 +876,8 @@
793
876
  exports.escapeMarkdownBlock = escapeMarkdownBlock;
794
877
  exports.extractAllBlocksFromMarkdown = extractAllBlocksFromMarkdown;
795
878
  exports.extractAllListItemsFromMarkdown = extractAllListItemsFromMarkdown;
879
+ exports.extractBlock = extractBlock;
880
+ exports.extractJsonBlock = extractJsonBlock;
796
881
  exports.extractOneBlockFromMarkdown = extractOneBlockFromMarkdown;
797
882
  exports.flattenMarkdown = flattenMarkdown;
798
883
  exports.parseMarkdownSection = parseMarkdownSection;
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../../../../src/version.ts","../../../node_modules/tslib/tslib.es6.js","../../../../src/errors/ParsingError.ts","../../../../src/utils/markdown/removeContentComments.ts","../../../../src/utils/serialization/$deepFreeze.ts","../../../../src/errors/UnexpectedError.ts","../../../../src/utils/serialization/checkSerializableAsJson.ts","../../../../src/utils/serialization/$asDeeplyFrozenSerializableJson.ts","../../../../src/config.ts","../../../../src/utils/markdown/addAutoGeneratedSection.ts","../../../../src/utils/formatNumber.ts","../../../../src/utils/removeEmojis.ts","../../../../src/utils/markdown/createMarkdownTable.ts","../../../../src/utils/markdown/createMarkdownChart.ts","../../../../src/utils/markdown/escapeMarkdownBlock.ts","../../../../src/utils/normalization/capitalize.ts","../../../../src/utils/markdown/extractAllBlocksFromMarkdown.ts","../../../../src/utils/markdown/extractAllListItemsFromMarkdown.ts","../../../../src/utils/markdown/extractOneBlockFromMarkdown.ts","../../../../src/utils/markdown/parseMarkdownSection.ts","../../../../src/utils/markdown/splitMarkdownIntoSections.ts","../../../../src/utils/markdown/flattenMarkdown.ts","../../../../src/utils/markdown/removeMarkdownFormatting.ts"],"sourcesContent":[null,"/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["spaceTrim"],"mappings":";;;;;;;;;;IAAA;IAIA;;;QAGa,kBAAkB,GAA8B,SAAS;IAGtE;;ICVA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,E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MAAM,CAAC;SAC9C;;YAED,KAAiC,IAAA,mBAAA,SAAA,cAAc,CAAA,8CAAA,0EAAE;gBAAtC,IAAA,6BAAkB,EAAhB,KAAK,WAAA,EAAE,OAAO,aAAA;gBACvB,iBAAiB,IAAI,aAAM,KAAK,CAAE,GAAG,MAAM,CAAC;gBAC5C,iBAAiB,IAAI,OAAO,GAAG,MAAM,CAAC;aACzC;;;;;;;;;QAED,OAAOA,6BAAS,CAAC,iBAAiB,CAAa,CAAC;IACpD,CAAC;IAED;;;;;;;;ICvCA;;;;;;;aAOgB,wBAAwB,CAAC,GAAyB;;QAE9D,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;;QAG1C,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;;QAGtC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAEpC,OAAO,GAAG,CAAC;IACf;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.umd.js","sources":["../../../../src/version.ts","../../../node_modules/tslib/tslib.es6.js","../../../../src/errors/ParsingError.ts","../../../../src/utils/normalization/capitalize.ts","../../../../src/utils/markdown/extractAllBlocksFromMarkdown.ts","../../../../src/utils/markdown/extractOneBlockFromMarkdown.ts","../../../../src/postprocessing/utils/extractBlock.ts","../../../../src/formats/json/utils/isValidJsonString.ts","../../../../src/postprocessing/utils/extractJsonBlock.ts","../../../../src/utils/serialization/$deepFreeze.ts","../../../../src/errors/UnexpectedError.ts","../../../../src/utils/serialization/checkSerializableAsJson.ts","../../../../src/utils/serialization/$asDeeplyFrozenSerializableJson.ts","../../../../src/config.ts","../../../../src/utils/markdown/removeContentComments.ts","../../../../src/utils/markdown/addAutoGeneratedSection.ts","../../../../src/utils/formatNumber.ts","../../../../src/utils/removeEmojis.ts","../../../../src/utils/markdown/createMarkdownTable.ts","../../../../src/utils/markdown/createMarkdownChart.ts","../../../../src/utils/markdown/escapeMarkdownBlock.ts","../../../../src/utils/markdown/extractAllListItemsFromMarkdown.ts","../../../../src/utils/markdown/parseMarkdownSection.ts","../../../../src/utils/markdown/splitMarkdownIntoSections.ts","../../../../src/utils/markdown/flattenMarkdown.ts","../../../../src/utils/markdown/removeMarkdownFormatting.ts"],"sourcesContent":[null,"/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["spaceTrim"],"mappings":";;;;;;;;;;IAAA;IAIA;;;QAGa,kBAAkB,GAA8B,SAAS;IAGtE;;ICVA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG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