@promptbook/markdown-utils 0.75.3 → 0.75.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
@@ -20,7 +20,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
20
20
  *
21
21
  * @see https://github.com/webgptorg/promptbook
22
22
  */
23
- var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
23
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.4';
24
24
  /**
25
25
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
26
26
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1963,6 +1963,42 @@ var PipelineExecutionError = /** @class */ (function (_super) {
1963
1963
  return PipelineExecutionError;
1964
1964
  }(Error));
1965
1965
 
1966
+ /**
1967
+ * This error indicates problems parsing the format value
1968
+ *
1969
+ * For example, when the format value is not a valid JSON or CSV
1970
+ * This is not thrown directly but in extended classes
1971
+ *
1972
+ * @public exported from `@promptbook/core`
1973
+ */
1974
+ var AbstractFormatError = /** @class */ (function (_super) {
1975
+ __extends(AbstractFormatError, _super);
1976
+ // Note: To allow instanceof do not put here error `name`
1977
+ // public readonly name = 'AbstractFormatError';
1978
+ function AbstractFormatError(message) {
1979
+ var _this = _super.call(this, message) || this;
1980
+ Object.setPrototypeOf(_this, AbstractFormatError.prototype);
1981
+ return _this;
1982
+ }
1983
+ return AbstractFormatError;
1984
+ }(Error));
1985
+
1986
+ /**
1987
+ * This error indicates problem with parsing of CSV
1988
+ *
1989
+ * @public exported from `@promptbook/core`
1990
+ */
1991
+ var CsvFormatError = /** @class */ (function (_super) {
1992
+ __extends(CsvFormatError, _super);
1993
+ function CsvFormatError(message) {
1994
+ var _this = _super.call(this, message) || this;
1995
+ _this.name = 'CsvFormatError';
1996
+ Object.setPrototypeOf(_this, CsvFormatError.prototype);
1997
+ return _this;
1998
+ }
1999
+ return CsvFormatError;
2000
+ }(AbstractFormatError));
2001
+
1966
2002
  /**
1967
2003
  * This error indicates that the pipeline collection cannot be propperly loaded
1968
2004
  *
@@ -2014,6 +2050,22 @@ var ExpectError = /** @class */ (function (_super) {
2014
2050
  return ExpectError;
2015
2051
  }(Error));
2016
2052
 
2053
+ /**
2054
+ * This error indicates that the promptbook can not retrieve knowledge from external sources
2055
+ *
2056
+ * @public exported from `@promptbook/core`
2057
+ */
2058
+ var KnowledgeScrapeError = /** @class */ (function (_super) {
2059
+ __extends(KnowledgeScrapeError, _super);
2060
+ function KnowledgeScrapeError(message) {
2061
+ var _this = _super.call(this, message) || this;
2062
+ _this.name = 'KnowledgeScrapeError';
2063
+ Object.setPrototypeOf(_this, KnowledgeScrapeError.prototype);
2064
+ return _this;
2065
+ }
2066
+ return KnowledgeScrapeError;
2067
+ }(Error));
2068
+
2017
2069
  /**
2018
2070
  * This error type indicates that some limit was reached
2019
2071
  *
@@ -2052,10 +2104,14 @@ var NotYetImplementedError = /** @class */ (function (_super) {
2052
2104
  * @public exported from `@promptbook/core`
2053
2105
  */
2054
2106
  var ERRORS = {
2055
- ExpectError: ExpectError,
2107
+ AbstractFormatError: AbstractFormatError,
2108
+ CsvFormatError: CsvFormatError,
2056
2109
  CollectionError: CollectionError,
2057
2110
  EnvironmentMismatchError: EnvironmentMismatchError,
2111
+ ExpectError: ExpectError,
2112
+ KnowledgeScrapeError: KnowledgeScrapeError,
2058
2113
  LimitReachedError: LimitReachedError,
2114
+ MissingToolsError: MissingToolsError,
2059
2115
  NotFoundError: NotFoundError,
2060
2116
  NotYetImplementedError: NotYetImplementedError,
2061
2117
  ParseError: ParseError,
@@ -2856,22 +2912,6 @@ function preparePersona(personaDescription, tools, options) {
2856
2912
  * TODO: [🏢] !! Check validity of `temperature` in pipeline
2857
2913
  */
2858
2914
 
2859
- /**
2860
- * This error indicates that the promptbook can not retrieve knowledge from external sources
2861
- *
2862
- * @public exported from `@promptbook/core`
2863
- */
2864
- var KnowledgeScrapeError = /** @class */ (function (_super) {
2865
- __extends(KnowledgeScrapeError, _super);
2866
- function KnowledgeScrapeError(message) {
2867
- var _this = _super.call(this, message) || this;
2868
- _this.name = 'KnowledgeScrapeError';
2869
- Object.setPrototypeOf(_this, KnowledgeScrapeError.prototype);
2870
- return _this;
2871
- }
2872
- return KnowledgeScrapeError;
2873
- }(Error));
2874
-
2875
2915
  /**
2876
2916
  * @@@
2877
2917
  *
@@ -3042,8 +3082,8 @@ var $scrapersRegister = new $Register('scraper_constructors');
3042
3082
  *
3043
3083
  * @private internal function of `createScrapersFromConfiguration` and `createScrapersFromEnv`
3044
3084
  */
3045
- function $registeredScrapersMessage() {
3046
- var e_1, _a, e_2, _b;
3085
+ function $registeredScrapersMessage(availableScrapers) {
3086
+ var e_1, _a, e_2, _b, e_3, _c;
3047
3087
  /**
3048
3088
  * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
3049
3089
  */
@@ -3055,15 +3095,15 @@ function $registeredScrapersMessage() {
3055
3095
  all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
3056
3096
  };
3057
3097
  try {
3058
- for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
3059
- var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
3098
+ for (var _d = __values($scrapersMetadataRegister.list()), _e = _d.next(); !_e.done; _e = _d.next()) {
3099
+ var _f = _e.value, packageName = _f.packageName, className = _f.className, mimeTypes = _f.mimeTypes, documentationUrl = _f.documentationUrl, isAvilableInBrowser = _f.isAvilableInBrowser;
3060
3100
  _loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
3061
3101
  }
3062
3102
  }
3063
3103
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
3064
3104
  finally {
3065
3105
  try {
3066
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
3106
+ if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
3067
3107
  }
3068
3108
  finally { if (e_1) throw e_1.error; }
3069
3109
  }
@@ -3074,18 +3114,31 @@ function $registeredScrapersMessage() {
3074
3114
  all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
3075
3115
  };
3076
3116
  try {
3077
- for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
3078
- var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
3117
+ for (var _g = __values($scrapersRegister.list()), _h = _g.next(); !_h.done; _h = _g.next()) {
3118
+ var _j = _h.value, packageName = _j.packageName, className = _j.className, mimeTypes = _j.mimeTypes, documentationUrl = _j.documentationUrl, isAvilableInBrowser = _j.isAvilableInBrowser;
3079
3119
  _loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
3080
3120
  }
3081
3121
  }
3082
3122
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
3083
3123
  finally {
3084
3124
  try {
3085
- if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
3125
+ if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
3086
3126
  }
3087
3127
  finally { if (e_2) throw e_2.error; }
3088
3128
  }
3129
+ try {
3130
+ for (var availableScrapers_1 = __values(availableScrapers), availableScrapers_1_1 = availableScrapers_1.next(); !availableScrapers_1_1.done; availableScrapers_1_1 = availableScrapers_1.next()) {
3131
+ var metadata_1 = availableScrapers_1_1.value.metadata;
3132
+ all.push(metadata_1);
3133
+ }
3134
+ }
3135
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
3136
+ finally {
3137
+ try {
3138
+ if (availableScrapers_1_1 && !availableScrapers_1_1.done && (_c = availableScrapers_1.return)) _c.call(availableScrapers_1);
3139
+ }
3140
+ finally { if (e_3) throw e_3.error; }
3141
+ }
3089
3142
  var metadata = all.map(function (metadata) {
3090
3143
  var isMetadataAviailable = $scrapersMetadataRegister
3091
3144
  .list()
@@ -3099,42 +3152,44 @@ function $registeredScrapersMessage() {
3099
3152
  var packageName = _a.packageName, className = _a.className;
3100
3153
  return metadata.packageName === packageName && metadata.className === className;
3101
3154
  });
3102
- return __assign(__assign({}, metadata), { isMetadataAviailable: isMetadataAviailable, isInstalled: isInstalled });
3155
+ var isAvilableInTools = availableScrapers.some(function (_a) {
3156
+ var _b = _a.metadata, packageName = _b.packageName, className = _b.className;
3157
+ return metadata.packageName === packageName && metadata.className === className;
3158
+ });
3159
+ return __assign(__assign({}, metadata), { isMetadataAviailable: isMetadataAviailable, isInstalled: isInstalled, isAvilableInTools: isAvilableInTools });
3103
3160
  });
3104
3161
  if (metadata.length === 0) {
3105
- return "No scrapers are available";
3162
+ return spaceTrim("\n **No scrapers are available**\n\n This is a unexpected behavior, you are probably using some broken version of Promptbook\n At least there should be available the metadata of the scrapers\n ");
3106
3163
  }
3107
3164
  return spaceTrim(function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
3108
3165
  .map(function (_a, i) {
3109
- var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
3110
- var more;
3111
- // TODO: Use documentationUrl
3112
- if (just(false)) {
3113
- more = '';
3114
- }
3115
- else if (!isMetadataAviailable && !isInstalled) {
3116
- // TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
3117
- more = "*(not installed and no metadata, looks like a unexpected behavior)*";
3118
- }
3119
- else if (isMetadataAviailable && !isInstalled) {
3120
- // TODO: [�][�]
3121
- more = "*(not installed)*";
3122
- }
3123
- else if (!isMetadataAviailable && isInstalled) {
3124
- more = "*(no metadata, looks like a unexpected behavior)*";
3125
- }
3126
- else if (isMetadataAviailable && isInstalled) {
3127
- more = "(installed)";
3128
- }
3129
- else {
3130
- more = "*(unknown state, looks like a unexpected behavior)*";
3131
- }
3166
+ var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser, isAvilableInTools = _a.isAvilableInTools;
3167
+ var more = [];
3168
+ // TODO: [🧠] Maybe use `documentationUrl`
3169
+ if (isMetadataAviailable) {
3170
+ more.push("\u2B1C Metadata registered");
3171
+ } // not else
3172
+ if (isInstalled) {
3173
+ more.push("\uD83D\uDFE9 Installed");
3174
+ } // not else
3175
+ if (isAvilableInTools) {
3176
+ more.push("\uD83D\uDFE6 Available in tools");
3177
+ } // not else
3178
+ if (!isMetadataAviailable && isInstalled) {
3179
+ more.push("When no metadata registered but scraper is installed, it is an unexpected behavior");
3180
+ } // not else
3181
+ if (!isInstalled && isAvilableInTools) {
3182
+ more.push("When the scraper is not installed but available in tools, it is an unexpected compatibility behavior");
3183
+ } // not else
3132
3184
  if (!isAvilableInBrowser) {
3133
- more += " *(not available in browser)*";
3185
+ more.push("Not usable in browser");
3134
3186
  }
3135
- return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
3187
+ var moreText = more.length === 0 ? '' : " *(".concat(more.join('; '), ")*");
3188
+ return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes
3189
+ .map(function (mimeType) { return "\"".concat(mimeType, "\""); })
3190
+ .join(', ')).concat(moreText);
3136
3191
  })
3137
- .join('\n')), "\n "); });
3192
+ .join('\n')), "\n\n Legend:\n - \u2B1C **Metadata registered** means that Promptbook knows about the scraper, it is similar to registration in some registry\n - \uD83D\uDFE9 **Installed** means that you have imported package with particular scraper\n - \uD83D\uDFE6 **Available in tools** means that you have passed scraper as dependency into prepare or execution process\n\n "); });
3138
3193
  }
3139
3194
  /**
3140
3195
  * TODO: [®] DRY Register logic
@@ -3382,57 +3437,75 @@ function prepareKnowledgePieces(knowledgeSources, tools, options) {
3382
3437
  _a = options.maxParallelCount, maxParallelCount = _a === void 0 ? DEFAULT_MAX_PARALLEL_COUNT : _a, rootDirname = options.rootDirname, _b = options.isVerbose, isVerbose = _b === void 0 ? DEFAULT_IS_VERBOSE : _b;
3383
3438
  knowledgePreparedUnflatten = new Array(knowledgeSources.length);
3384
3439
  return [4 /*yield*/, forEachAsync(knowledgeSources, { maxParallelCount: maxParallelCount }, function (knowledgeSource, index) { return __awaiter(_this, void 0, void 0, function () {
3385
- var partialPieces, sourceHandler, _a, _b, scraper, partialPiecesUnchecked, e_1_1, pieces;
3386
- var e_1, _c;
3387
- return __generator(this, function (_d) {
3388
- switch (_d.label) {
3440
+ var partialPieces, sourceHandler, scrapers, _loop_1, scrapers_1, scrapers_1_1, scraper, state_1, e_1_1, pieces;
3441
+ var e_1, _a;
3442
+ return __generator(this, function (_b) {
3443
+ switch (_b.label) {
3389
3444
  case 0:
3390
3445
  partialPieces = null;
3391
3446
  return [4 /*yield*/, makeKnowledgeSourceHandler(knowledgeSource, tools, { rootDirname: rootDirname, isVerbose: isVerbose })];
3392
3447
  case 1:
3393
- sourceHandler = _d.sent();
3394
- _d.label = 2;
3448
+ sourceHandler = _b.sent();
3449
+ scrapers = arrayableToArray(tools.scrapers);
3450
+ _loop_1 = function (scraper) {
3451
+ var partialPiecesUnchecked;
3452
+ return __generator(this, function (_c) {
3453
+ switch (_c.label) {
3454
+ case 0:
3455
+ if (!scraper.metadata.mimeTypes.includes(sourceHandler.mimeType)
3456
+ // <- TODO: [🦔] Implement mime-type wildcards
3457
+ ) {
3458
+ return [2 /*return*/, "continue"];
3459
+ }
3460
+ return [4 /*yield*/, scraper.scrape(sourceHandler)];
3461
+ case 1:
3462
+ partialPiecesUnchecked = _c.sent();
3463
+ if (partialPiecesUnchecked !== null) {
3464
+ partialPieces = __spreadArray([], __read(partialPiecesUnchecked), false);
3465
+ return [2 /*return*/, "break"];
3466
+ }
3467
+ console.warn(spaceTrim(function (block) { return "\n Cannot scrape knowledge from source despite the scraper `".concat(scraper.metadata.className, "` supports the mime type \"").concat(sourceHandler.mimeType, "\".\n \n The source:\n > ").concat(block(knowledgeSource.sourceContent
3468
+ .split('\n')
3469
+ .map(function (line) { return "> ".concat(line); })
3470
+ .join('\n')), "\n\n ").concat(block($registeredScrapersMessage(scrapers)), "\n\n\n "); }));
3471
+ return [2 /*return*/];
3472
+ }
3473
+ });
3474
+ };
3475
+ _b.label = 2;
3395
3476
  case 2:
3396
- _d.trys.push([2, 7, 8, 9]);
3397
- _a = __values(arrayableToArray(tools.scrapers)), _b = _a.next();
3398
- _d.label = 3;
3477
+ _b.trys.push([2, 7, 8, 9]);
3478
+ scrapers_1 = __values(scrapers), scrapers_1_1 = scrapers_1.next();
3479
+ _b.label = 3;
3399
3480
  case 3:
3400
- if (!!_b.done) return [3 /*break*/, 6];
3401
- scraper = _b.value;
3402
- if (!scraper.metadata.mimeTypes.includes(sourceHandler.mimeType)
3403
- // <- TODO: [🦔] Implement mime-type wildcards
3404
- ) {
3405
- return [3 /*break*/, 5];
3406
- }
3407
- return [4 /*yield*/, scraper.scrape(sourceHandler)];
3481
+ if (!!scrapers_1_1.done) return [3 /*break*/, 6];
3482
+ scraper = scrapers_1_1.value;
3483
+ return [5 /*yield**/, _loop_1(scraper)];
3408
3484
  case 4:
3409
- partialPiecesUnchecked = _d.sent();
3410
- if (partialPiecesUnchecked !== null) {
3411
- partialPieces = __spreadArray([], __read(partialPiecesUnchecked), false);
3412
- // <- TODO: [🪓] Here should be no need for spreading new array, just `partialPieces = partialPiecesUnchecked`
3485
+ state_1 = _b.sent();
3486
+ if (state_1 === "break")
3413
3487
  return [3 /*break*/, 6];
3414
- }
3415
- _d.label = 5;
3488
+ _b.label = 5;
3416
3489
  case 5:
3417
- _b = _a.next();
3490
+ scrapers_1_1 = scrapers_1.next();
3418
3491
  return [3 /*break*/, 3];
3419
3492
  case 6: return [3 /*break*/, 9];
3420
3493
  case 7:
3421
- e_1_1 = _d.sent();
3494
+ e_1_1 = _b.sent();
3422
3495
  e_1 = { error: e_1_1 };
3423
3496
  return [3 /*break*/, 9];
3424
3497
  case 8:
3425
3498
  try {
3426
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
3499
+ if (scrapers_1_1 && !scrapers_1_1.done && (_a = scrapers_1.return)) _a.call(scrapers_1);
3427
3500
  }
3428
3501
  finally { if (e_1) throw e_1.error; }
3429
3502
  return [7 /*endfinally*/];
3430
3503
  case 9:
3431
3504
  if (partialPieces === null) {
3432
- throw new KnowledgeScrapeError(spaceTrim(function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
3505
+ throw new KnowledgeScrapeError(spaceTrim(function (block) { return "\n Cannot scrape knowledge\n \n The source:\n > ".concat(block(knowledgeSource.sourceContent
3433
3506
  .split('\n')
3434
3507
  .map(function (line) { return "> ".concat(line); })
3435
- .join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
3508
+ .join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage(scrapers)), "\n\n\n "); }));
3436
3509
  }
3437
3510
  pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
3438
3511
  {
@@ -3858,42 +3931,6 @@ function union() {
3858
3931
  return union;
3859
3932
  }
3860
3933
 
3861
- /**
3862
- * This error indicates problems parsing the format value
3863
- *
3864
- * For example, when the format value is not a valid JSON or CSV
3865
- * This is not thrown directly but in extended classes
3866
- *
3867
- * @public exported from `@promptbook/core`
3868
- */
3869
- var AbstractFormatError = /** @class */ (function (_super) {
3870
- __extends(AbstractFormatError, _super);
3871
- // Note: To allow instanceof do not put here error `name`
3872
- // public readonly name = 'AbstractFormatError';
3873
- function AbstractFormatError(message) {
3874
- var _this = _super.call(this, message) || this;
3875
- Object.setPrototypeOf(_this, AbstractFormatError.prototype);
3876
- return _this;
3877
- }
3878
- return AbstractFormatError;
3879
- }(Error));
3880
-
3881
- /**
3882
- * This error indicates problem with parsing of CSV
3883
- *
3884
- * @public exported from `@promptbook/core`
3885
- */
3886
- var CsvFormatError = /** @class */ (function (_super) {
3887
- __extends(CsvFormatError, _super);
3888
- function CsvFormatError(message) {
3889
- var _this = _super.call(this, message) || this;
3890
- _this.name = 'CsvFormatError';
3891
- Object.setPrototypeOf(_this, CsvFormatError.prototype);
3892
- return _this;
3893
- }
3894
- return CsvFormatError;
3895
- }(AbstractFormatError));
3896
-
3897
3934
  /**
3898
3935
  * @@@
3899
3936
  *
@@ -3934,7 +3971,7 @@ var CsvFormatDefinition = {
3934
3971
  case 0:
3935
3972
  csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
3936
3973
  if (csv.errors.length !== 0) {
3937
- throw new CsvFormatError(spaceTrim(function (block) { return "\n CSV parsing error\n\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n "); }));
3974
+ throw new CsvFormatError(spaceTrim(function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
3938
3975
  }
3939
3976
  return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) { return __awaiter(_this, void 0, void 0, function () {
3940
3977
  var _a, _b;
@@ -3972,7 +4009,7 @@ var CsvFormatDefinition = {
3972
4009
  case 0:
3973
4010
  csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
3974
4011
  if (csv.errors.length !== 0) {
3975
- throw new CsvFormatError(spaceTrim(function (block) { return "\n CSV parsing error\n\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n "); }));
4012
+ throw new CsvFormatError(spaceTrim(function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
3976
4013
  }
3977
4014
  return [4 /*yield*/, Promise.all(csv.data.map(function (row, rowIndex) { return __awaiter(_this, void 0, void 0, function () {
3978
4015
  var _this = this;