effect-errors 1.7.27 → 1.7.29
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/cjs/capture-errors.js +18 -21
- package/cjs/capture-errors.js.map +1 -1
- package/cjs/index.js +20 -69
- package/cjs/index.js.map +1 -1
- package/cjs/logic/effects/fs/fs-error.js +4 -6
- package/cjs/logic/effects/fs/fs-error.js.map +1 -1
- package/cjs/logic/effects/fs/fs-extra.effects.js +20 -45
- package/cjs/logic/effects/fs/fs-extra.effects.js.map +1 -1
- package/cjs/logic/errors/capture-errors-from-cause.js +10 -13
- package/cjs/logic/errors/capture-errors-from-cause.js.map +1 -1
- package/cjs/logic/errors/extract-error-details.js +53 -57
- package/cjs/logic/errors/extract-error-details.js.map +1 -1
- package/cjs/logic/errors/parse-error.js +17 -19
- package/cjs/logic/errors/parse-error.js.map +1 -1
- package/cjs/logic/pretty-printing/format-failures-title.js +11 -14
- package/cjs/logic/pretty-printing/format-failures-title.js.map +1 -1
- package/cjs/logic/pretty-printing/format-span-attributes.js +38 -51
- package/cjs/logic/pretty-printing/format-span-attributes.js.map +1 -1
- package/cjs/logic/pretty-printing/maybe-print-node-stacktrace.js +13 -19
- package/cjs/logic/pretty-printing/maybe-print-node-stacktrace.js.map +1 -1
- package/cjs/logic/pretty-printing/maybe-print-span-attributes.js +18 -26
- package/cjs/logic/pretty-printing/maybe-print-span-attributes.js.map +1 -1
- package/cjs/logic/pretty-printing/maybe-warn-about-plain-strings.js +9 -14
- package/cjs/logic/pretty-printing/maybe-warn-about-plain-strings.js.map +1 -1
- package/cjs/logic/pretty-printing/print-effect-stacktrace.js +12 -19
- package/cjs/logic/pretty-printing/print-effect-stacktrace.js.map +1 -1
- package/cjs/logic/spans/get-span-attributes.js +16 -25
- package/cjs/logic/spans/get-span-attributes.js.map +1 -1
- package/cjs/logic/spans/get-span-duration.js +10 -15
- package/cjs/logic/spans/get-span-duration.js.map +1 -1
- package/cjs/logic/spans/maybe-add-error-to-spans-stack.js +13 -16
- package/cjs/logic/spans/maybe-add-error-to-spans-stack.js.map +1 -1
- package/cjs/logic/spans/spans-stack-trailing-char.js +6 -11
- package/cjs/logic/spans/spans-stack-trailing-char.js.map +1 -1
- package/cjs/logic/spans/split-spans-attributes-by-type.js +12 -15
- package/cjs/logic/spans/split-spans-attributes-by-type.js.map +1 -1
- package/cjs/logic/stack/filter-stack.js +14 -17
- package/cjs/logic/stack/filter-stack.js.map +1 -1
- package/cjs/logic/stack/stack-regex.js +4 -7
- package/cjs/logic/stack/stack-regex.js.map +1 -1
- package/cjs/logic/strip-cwd-path.js +3 -6
- package/cjs/logic/strip-cwd-path.js.map +1 -1
- package/cjs/logic/util/big-int-replacer.js +8 -11
- package/cjs/logic/util/big-int-replacer.js.map +1 -1
- package/cjs/package.json +1 -0
- package/cjs/pretty-print.js +34 -40
- package/cjs/pretty-print.js.map +1 -1
- package/cjs/runners/run-promise.js +11 -14
- package/cjs/runners/run-promise.js.map +1 -1
- package/cjs/runners/run-sync.js +10 -13
- package/cjs/runners/run-sync.js.map +1 -1
- package/cjs/source-maps/get-error-location-from-file-path.js +11 -18
- package/cjs/source-maps/get-error-location-from-file-path.js.map +1 -1
- package/cjs/source-maps/get-error-related-sources.js +22 -29
- package/cjs/source-maps/get-error-related-sources.js.map +1 -1
- package/cjs/source-maps/get-source-code.js +18 -22
- package/cjs/source-maps/get-source-code.js.map +1 -1
- package/cjs/source-maps/get-sources-from-map-file.js +42 -45
- package/cjs/source-maps/get-sources-from-map-file.js.map +1 -1
- package/cjs/source-maps/get-sources-from-span.js +36 -48
- package/cjs/source-maps/get-sources-from-span.js.map +1 -1
- package/cjs/source-maps/get-sources-from-stack.js +16 -19
- package/cjs/source-maps/get-sources-from-stack.js.map +1 -1
- package/cjs/source-maps/maybe-map-sourcemaps.js +24 -25
- package/cjs/source-maps/maybe-map-sourcemaps.js.map +1 -1
- package/cjs/source-maps/transform-raw-error.js +30 -48
- package/cjs/source-maps/transform-raw-error.js.map +1 -1
- package/cjs/types/pretty-error.type.js +13 -16
- package/cjs/types/pretty-error.type.js.map +1 -1
- package/cjs/types/pretty-print-options.type.js +5 -8
- package/cjs/types/pretty-print-options.type.js.map +1 -1
- package/dts/capture-errors.d.ts +0 -1
- package/dts/index.d.ts +0 -1
- package/dts/logic/effects/fs/fs-error.d.ts +0 -1
- package/dts/logic/effects/fs/fs-extra.effects.d.ts +0 -1
- package/dts/logic/errors/capture-errors-from-cause.d.ts +0 -1
- package/dts/logic/errors/extract-error-details.d.ts +0 -1
- package/dts/logic/errors/parse-error.d.ts +0 -1
- package/dts/logic/pretty-printing/format-failures-title.d.ts +0 -1
- package/dts/logic/pretty-printing/format-span-attributes.d.ts +0 -1
- package/dts/logic/pretty-printing/maybe-print-node-stacktrace.d.ts +0 -1
- package/dts/logic/pretty-printing/maybe-print-span-attributes.d.ts +0 -1
- package/dts/logic/pretty-printing/maybe-warn-about-plain-strings.d.ts +0 -1
- package/dts/logic/pretty-printing/print-effect-stacktrace.d.ts +0 -1
- package/dts/logic/spans/get-span-attributes.d.ts +0 -1
- package/dts/logic/spans/get-span-duration.d.ts +0 -1
- package/dts/logic/spans/maybe-add-error-to-spans-stack.d.ts +0 -1
- package/dts/logic/spans/spans-stack-trailing-char.d.ts +0 -1
- package/dts/logic/spans/split-spans-attributes-by-type.d.ts +0 -1
- package/dts/logic/stack/filter-stack.d.ts +0 -1
- package/dts/logic/stack/stack-regex.d.ts +0 -1
- package/dts/logic/strip-cwd-path.d.ts +0 -1
- package/dts/logic/util/big-int-replacer.d.ts +0 -1
- package/dts/pretty-print.d.ts +0 -1
- package/dts/runners/run-promise.d.ts +0 -1
- package/dts/runners/run-sync.d.ts +0 -1
- package/dts/source-maps/get-error-location-from-file-path.d.ts +0 -1
- package/dts/source-maps/get-error-related-sources.d.ts +0 -1
- package/dts/source-maps/get-source-code.d.ts +0 -1
- package/dts/source-maps/get-sources-from-map-file.d.ts +0 -1
- package/dts/source-maps/get-sources-from-span.d.ts +0 -1
- package/dts/source-maps/get-sources-from-stack.d.ts +0 -1
- package/dts/source-maps/maybe-map-sourcemaps.d.ts +0 -1
- package/dts/source-maps/transform-raw-error.d.ts +0 -1
- package/dts/types/pretty-error.type.d.ts +0 -1
- package/dts/types/pretty-print-options.type.d.ts +0 -1
- package/esm/capture-errors.js +12 -12
- package/esm/capture-errors.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/logic/effects/fs/fs-error.js +2 -1
- package/esm/logic/effects/fs/fs-error.js.map +1 -1
- package/esm/logic/effects/fs/fs-extra.effects.js +12 -32
- package/esm/logic/effects/fs/fs-extra.effects.js.map +1 -1
- package/esm/logic/errors/capture-errors-from-cause.js +7 -7
- package/esm/logic/errors/capture-errors-from-cause.js.map +1 -1
- package/esm/logic/errors/extract-error-details.js +50 -51
- package/esm/logic/errors/extract-error-details.js.map +1 -1
- package/esm/logic/errors/parse-error.js +13 -12
- package/esm/logic/errors/parse-error.js.map +1 -1
- package/esm/logic/pretty-printing/format-failures-title.js +6 -4
- package/esm/logic/pretty-printing/format-failures-title.js.map +1 -1
- package/esm/logic/pretty-printing/format-span-attributes.js +28 -36
- package/esm/logic/pretty-printing/format-span-attributes.js.map +1 -1
- package/esm/logic/pretty-printing/maybe-print-node-stacktrace.js +7 -8
- package/esm/logic/pretty-printing/maybe-print-node-stacktrace.js.map +1 -1
- package/esm/logic/pretty-printing/maybe-print-span-attributes.js +12 -15
- package/esm/logic/pretty-printing/maybe-print-span-attributes.js.map +1 -1
- package/esm/logic/pretty-printing/maybe-warn-about-plain-strings.js +4 -4
- package/esm/logic/pretty-printing/maybe-warn-about-plain-strings.js.map +1 -1
- package/esm/logic/pretty-printing/print-effect-stacktrace.js +6 -8
- package/esm/logic/pretty-printing/print-effect-stacktrace.js.map +1 -1
- package/esm/logic/spans/get-span-attributes.js +10 -14
- package/esm/logic/spans/get-span-attributes.js.map +1 -1
- package/esm/logic/spans/get-span-duration.js +5 -5
- package/esm/logic/spans/get-span-duration.js.map +1 -1
- package/esm/logic/spans/maybe-add-error-to-spans-stack.js +11 -11
- package/esm/logic/spans/maybe-add-error-to-spans-stack.js.map +1 -1
- package/esm/logic/spans/spans-stack-trailing-char.js +1 -1
- package/esm/logic/spans/spans-stack-trailing-char.js.map +1 -1
- package/esm/logic/spans/split-spans-attributes-by-type.js +11 -11
- package/esm/logic/spans/split-spans-attributes-by-type.js.map +1 -1
- package/esm/logic/stack/filter-stack.js +10 -10
- package/esm/logic/stack/filter-stack.js.map +1 -1
- package/esm/logic/stack/stack-regex.js.map +1 -1
- package/esm/logic/strip-cwd-path.js +2 -2
- package/esm/logic/strip-cwd-path.js.map +1 -1
- package/esm/logic/util/big-int-replacer.js +7 -7
- package/esm/logic/util/big-int-replacer.js.map +1 -1
- package/esm/package.json +1 -0
- package/esm/pretty-print.js +20 -21
- package/esm/pretty-print.js.map +1 -1
- package/esm/runners/run-promise.js +8 -8
- package/esm/runners/run-promise.js.map +1 -1
- package/esm/runners/run-sync.js +7 -7
- package/esm/runners/run-sync.js.map +1 -1
- package/esm/source-maps/get-error-location-from-file-path.js +9 -13
- package/esm/source-maps/get-error-location-from-file-path.js.map +1 -1
- package/esm/source-maps/get-error-related-sources.js +18 -22
- package/esm/source-maps/get-error-related-sources.js.map +1 -1
- package/esm/source-maps/get-source-code.js +15 -16
- package/esm/source-maps/get-source-code.js.map +1 -1
- package/esm/source-maps/get-sources-from-map-file.js +34 -32
- package/esm/source-maps/get-sources-from-map-file.js.map +1 -1
- package/esm/source-maps/get-sources-from-span.js +31 -40
- package/esm/source-maps/get-sources-from-span.js.map +1 -1
- package/esm/source-maps/get-sources-from-stack.js +11 -11
- package/esm/source-maps/get-sources-from-stack.js.map +1 -1
- package/esm/source-maps/maybe-map-sourcemaps.js +20 -18
- package/esm/source-maps/maybe-map-sourcemaps.js.map +1 -1
- package/esm/source-maps/transform-raw-error.js +23 -38
- package/esm/source-maps/transform-raw-error.js.map +1 -1
- package/esm/types/pretty-error.type.js +12 -12
- package/esm/types/pretty-error.type.js.map +1 -1
- package/esm/types/pretty-print-options.type.js +3 -3
- package/esm/types/pretty-print-options.type.js.map +1 -1
- package/package.json +13 -12
- package/dts/capture-errors.d.ts.map +0 -1
- package/dts/index.d.ts.map +0 -1
- package/dts/logic/effects/fs/fs-error.d.ts.map +0 -1
- package/dts/logic/effects/fs/fs-extra.effects.d.ts.map +0 -1
- package/dts/logic/errors/capture-errors-from-cause.d.ts.map +0 -1
- package/dts/logic/errors/extract-error-details.d.ts.map +0 -1
- package/dts/logic/errors/parse-error.d.ts.map +0 -1
- package/dts/logic/pretty-printing/format-failures-title.d.ts.map +0 -1
- package/dts/logic/pretty-printing/format-span-attributes.d.ts.map +0 -1
- package/dts/logic/pretty-printing/maybe-print-node-stacktrace.d.ts.map +0 -1
- package/dts/logic/pretty-printing/maybe-print-span-attributes.d.ts.map +0 -1
- package/dts/logic/pretty-printing/maybe-warn-about-plain-strings.d.ts.map +0 -1
- package/dts/logic/pretty-printing/print-effect-stacktrace.d.ts.map +0 -1
- package/dts/logic/spans/get-span-attributes.d.ts.map +0 -1
- package/dts/logic/spans/get-span-duration.d.ts.map +0 -1
- package/dts/logic/spans/maybe-add-error-to-spans-stack.d.ts.map +0 -1
- package/dts/logic/spans/spans-stack-trailing-char.d.ts.map +0 -1
- package/dts/logic/spans/split-spans-attributes-by-type.d.ts.map +0 -1
- package/dts/logic/stack/filter-stack.d.ts.map +0 -1
- package/dts/logic/stack/stack-regex.d.ts.map +0 -1
- package/dts/logic/strip-cwd-path.d.ts.map +0 -1
- package/dts/logic/util/big-int-replacer.d.ts.map +0 -1
- package/dts/pretty-print.d.ts.map +0 -1
- package/dts/runners/run-promise.d.ts.map +0 -1
- package/dts/runners/run-sync.d.ts.map +0 -1
- package/dts/source-maps/get-error-location-from-file-path.d.ts.map +0 -1
- package/dts/source-maps/get-error-related-sources.d.ts.map +0 -1
- package/dts/source-maps/get-source-code.d.ts.map +0 -1
- package/dts/source-maps/get-sources-from-map-file.d.ts.map +0 -1
- package/dts/source-maps/get-sources-from-span.d.ts.map +0 -1
- package/dts/source-maps/get-sources-from-stack.d.ts.map +0 -1
- package/dts/source-maps/maybe-map-sourcemaps.d.ts.map +0 -1
- package/dts/source-maps/transform-raw-error.d.ts.map +0 -1
- package/dts/types/pretty-error.type.d.ts.map +0 -1
- package/dts/types/pretty-print-options.type.d.ts.map +0 -1
- package/esm/tsconfig-prod.tsbuildinfo +0 -1
package/cjs/capture-errors.js
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.captureErrors = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const effect_1 = require("effect");
|
|
5
|
+
const Cause_1 = require("effect/Cause");
|
|
6
|
+
const capture_errors_from_cause_js_1 = require("./logic/errors/capture-errors-from-cause.js");
|
|
7
|
+
const transform_raw_error_js_1 = require("./source-maps/transform-raw-error.js");
|
|
11
8
|
const captureErrors = (cause, options = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}) =>
|
|
15
|
-
|
|
9
|
+
reverseSpans: true,
|
|
10
|
+
stripCwd: true,
|
|
11
|
+
}) => effect_1.Effect.gen(function* () {
|
|
12
|
+
if ((0, Cause_1.isInterruptedOnly)(cause)) {
|
|
13
|
+
return {
|
|
14
|
+
interrupted: true,
|
|
15
|
+
errors: [],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const rawErrors = (0, capture_errors_from_cause_js_1.captureErrorsFrom)(cause);
|
|
19
|
+
const errors = yield* effect_1.Effect.forEach(rawErrors, (0, transform_raw_error_js_1.transformRawError)(options));
|
|
16
20
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
interrupted: false,
|
|
22
|
+
errors,
|
|
19
23
|
};
|
|
20
|
-
}
|
|
21
|
-
const rawErrors = (0, _captureErrorsFromCause.captureErrorsFrom)(cause);
|
|
22
|
-
const errors = yield* _effect.Effect.forEach(rawErrors, (0, _transformRawError.transformRawError)(options));
|
|
23
|
-
return {
|
|
24
|
-
interrupted: false,
|
|
25
|
-
errors
|
|
26
|
-
};
|
|
27
24
|
});
|
|
28
25
|
exports.captureErrors = captureErrors;
|
|
29
26
|
//# sourceMappingURL=capture-errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-errors.js","
|
|
1
|
+
{"version":3,"file":"capture-errors.js","sourceRoot":"","sources":["../../src/capture-errors.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,wCAA6D;AAG7D,8FAAgF;AAGhF,iFAAyE;AA8BlE,MAAM,aAAa,GAAG,CAC3B,KAAe,EACf,UAAgC;IAC9B,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,IAAI;CACf,EACuC,EAAE,CAC1C,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,IAAI,IAAA,yBAAiB,EAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,EAAE;SACX,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,IAAA,gDAAiB,EAAI,KAAK,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,eAAM,CAAC,OAAO,CAAC,SAAS,EAAE,IAAA,0CAAiB,EAAC,OAAO,CAAC,CAAC,CAAC;IAE5E,OAAO;QACL,WAAW,EAAE,KAAK;QAClB,MAAM;KACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAtBQ,QAAA,aAAa,iBAsBrB"}
|
package/cjs/index.js
CHANGED
|
@@ -1,72 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(_prettyPrint).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _prettyPrint[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _prettyPrint[key];
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
7
|
}
|
|
15
|
-
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _runSync[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _runSync[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _prettyPrintOptionsType = /*#__PURE__*/require("./types/pretty-print-options.type.js");
|
|
40
|
-
Object.keys(_prettyPrintOptionsType).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _prettyPrintOptionsType[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _prettyPrintOptionsType[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _captureErrors = /*#__PURE__*/require("./capture-errors.js");
|
|
51
|
-
Object.keys(_captureErrors).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _captureErrors[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _captureErrors[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _bigIntReplacer = /*#__PURE__*/require("./logic/util/big-int-replacer.js");
|
|
62
|
-
Object.keys(_bigIntReplacer).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _bigIntReplacer[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _bigIntReplacer[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./pretty-print.js"), exports);
|
|
18
|
+
__exportStar(require("./runners/run-promise.js"), exports);
|
|
19
|
+
__exportStar(require("./runners/run-sync.js"), exports);
|
|
20
|
+
__exportStar(require("./types/pretty-print-options.type.js"), exports);
|
|
21
|
+
__exportStar(require("./capture-errors.js"), exports);
|
|
22
|
+
__exportStar(require("./logic/util/big-int-replacer.js"), exports);
|
|
72
23
|
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,2DAAyC;AACzC,wDAAsC;AACtC,uEAAqD;AACrD,sDAAoC;AACpC,mEAAiD"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.FsError = void 0;
|
|
7
|
-
|
|
8
|
-
class FsError extends (0,
|
|
4
|
+
const Data_1 = require("effect/Data");
|
|
5
|
+
class FsError extends (0, Data_1.TaggedError)('fs-error') {
|
|
6
|
+
}
|
|
9
7
|
exports.FsError = FsError;
|
|
10
8
|
//# sourceMappingURL=fs-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-error.js","
|
|
1
|
+
{"version":3,"file":"fs-error.js","sourceRoot":"","sources":["../../../../../src/logic/effects/fs/fs-error.ts"],"names":[],"mappings":";;;AAAA,sCAA0C;AAE1C,MAAa,OAAQ,SAAQ,IAAA,kBAAW,EAAC,UAAU,CAGjD;CAAG;AAHL,0BAGK"}
|
|
@@ -1,50 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.readJsonEffect = exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
const readFileEffect = path => (0, _effect.pipe)(_effect.Effect.tryPromise({
|
|
16
|
-
try: async () => await _fsExtra.default.readFile(path, {
|
|
17
|
-
encoding: 'utf8'
|
|
18
|
-
}),
|
|
19
|
-
catch: e => new _fsError.FsError({
|
|
20
|
-
cause: e
|
|
21
|
-
})
|
|
22
|
-
}), _effect.Effect.withSpan('readFile', {
|
|
23
|
-
attributes: {
|
|
24
|
-
path
|
|
25
|
-
}
|
|
26
|
-
}));
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.readJsonEffect = exports.existsEffect = exports.readFileEffect = void 0;
|
|
7
|
+
const effect_1 = require("effect");
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const fs_error_js_1 = require("./fs-error.js");
|
|
10
|
+
const readFileEffect = (path) => (0, effect_1.pipe)(effect_1.Effect.tryPromise({
|
|
11
|
+
try: async () => await fs_extra_1.default.readFile(path, { encoding: 'utf8' }),
|
|
12
|
+
catch: (e) => new fs_error_js_1.FsError({ cause: e }),
|
|
13
|
+
}), effect_1.Effect.withSpan('readFile', { attributes: { path } }));
|
|
27
14
|
exports.readFileEffect = readFileEffect;
|
|
28
|
-
const existsEffect = path => (0,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})
|
|
33
|
-
}), _effect.Effect.withSpan('exists', {
|
|
34
|
-
attributes: {
|
|
35
|
-
path
|
|
36
|
-
}
|
|
37
|
-
}));
|
|
15
|
+
const existsEffect = (path) => (0, effect_1.pipe)(effect_1.Effect.tryPromise({
|
|
16
|
+
try: async () => await fs_extra_1.default.exists(path),
|
|
17
|
+
catch: (e) => new fs_error_js_1.FsError({ cause: e }),
|
|
18
|
+
}), effect_1.Effect.withSpan('exists', { attributes: { path } }));
|
|
38
19
|
exports.existsEffect = existsEffect;
|
|
39
|
-
const readJsonEffect = path => (0,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
44
|
-
}), _effect.Effect.withSpan('readJson', {
|
|
45
|
-
attributes: {
|
|
46
|
-
path
|
|
47
|
-
}
|
|
48
|
-
}));
|
|
20
|
+
const readJsonEffect = (path) => (0, effect_1.pipe)(effect_1.Effect.tryPromise({
|
|
21
|
+
try: async () => await fs_extra_1.default.readJson(path),
|
|
22
|
+
catch: (e) => new fs_error_js_1.FsError({ cause: e }),
|
|
23
|
+
}), effect_1.Effect.withSpan('readJson', { attributes: { path } }));
|
|
49
24
|
exports.readJsonEffect = readJsonEffect;
|
|
50
25
|
//# sourceMappingURL=fs-extra.effects.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-extra.effects.js","
|
|
1
|
+
{"version":3,"file":"fs-extra.effects.js","sourceRoot":"","sources":["../../../../../src/logic/effects/fs/fs-extra.effects.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAsC;AACtC,wDAA0B;AAE1B,+CAAwC;AAEjC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAE,CAC7C,IAAA,aAAI,EACF,eAAM,CAAC,UAAU,CAAC;IAChB,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,kBAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC9D,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,qBAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;CACxC,CAAC,EACF,eAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CACtD,CAAC;AAPS,QAAA,cAAc,kBAOvB;AAEG,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE,CAC3C,IAAA,aAAI,EACF,eAAM,CAAC,UAAU,CAAC;IAChB,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,IAAI,CAAC;IACtC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,qBAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;CACxC,CAAC,EACF,eAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CACpD,CAAC;AAPS,QAAA,YAAY,gBAOrB;AAEG,MAAM,cAAc,GAAG,CAAU,IAAY,EAAE,EAAE,CACtD,IAAA,aAAI,EACF,eAAM,CAAC,UAAU,CAAC;IAChB,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,MAAO,kBAAE,CAAC,QAAQ,CAAC,IAAI,CAAsB;IAC9D,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,qBAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;CACxC,CAAC,EACF,eAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CACtD,CAAC;AAPS,QAAA,cAAc,kBAOvB"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.captureErrorsFrom = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const captureErrorsFrom = cause => (0,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
const Cause_1 = require("effect/Cause");
|
|
5
|
+
const parse_error_js_1 = require("./parse-error.js");
|
|
6
|
+
const captureErrorsFrom = (cause) => (0, Cause_1.reduceWithContext)(cause, undefined, {
|
|
7
|
+
emptyCase: () => [],
|
|
8
|
+
dieCase: (_, unknownError) => [(0, parse_error_js_1.parseError)(unknownError)],
|
|
9
|
+
failCase: (_, error) => [(0, parse_error_js_1.parseError)(error)],
|
|
10
|
+
interruptCase: () => [],
|
|
11
|
+
parallelCase: (_, l, r) => [...l, ...r],
|
|
12
|
+
sequentialCase: (_, l, r) => [...l, ...r],
|
|
16
13
|
});
|
|
17
14
|
exports.captureErrorsFrom = captureErrorsFrom;
|
|
18
15
|
//# sourceMappingURL=capture-errors-from-cause.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-errors-from-cause.js","
|
|
1
|
+
{"version":3,"file":"capture-errors-from-cause.js","sourceRoot":"","sources":["../../../../src/logic/errors/capture-errors-from-cause.ts"],"names":[],"mappings":";;;AAAA,wCAA6D;AAI7D,qDAA8C;AAEvC,MAAM,iBAAiB,GAAG,CAAI,KAAe,EAA0B,EAAE,CAC9E,IAAA,yBAAiB,EAAC,KAAK,EAAE,SAAS,EAAE;IAClC,SAAS,EAAE,GAA2B,EAAE,CAAC,EAAE;IAC3C,OAAO,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC,IAAA,2BAAU,EAAC,YAAY,CAAC,CAAC;IACxD,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,IAAA,2BAAU,EAAC,KAAK,CAAC,CAAC;IAC3C,aAAa,EAAE,GAAG,EAAE,CAAC,EAAE;IACvB,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACvC,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;CAC1C,CAAC,CAAC;AARQ,QAAA,iBAAiB,qBAQzB"}
|
|
@@ -1,63 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.extractErrorDetails = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const extractErrorDetails = error => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
// TaggedError with cause
|
|
17
|
-
if (error instanceof Error && (0, _Predicate.hasProperty)(error, 'cause') && (0, _Predicate.hasProperty)(error, '_tag')) {
|
|
18
|
-
return {
|
|
19
|
-
isPlainString: false,
|
|
20
|
-
type: error._tag,
|
|
21
|
-
message: error.cause
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
// TaggedError with error ctor
|
|
25
|
-
if (error instanceof Error && (0, _Predicate.hasProperty)(error, 'error')) {
|
|
26
|
-
return {
|
|
27
|
-
isPlainString: false,
|
|
28
|
-
type: error.name,
|
|
29
|
-
message: error.error
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
// Plain objects with tag attribute
|
|
33
|
-
if ((0, _Predicate.hasProperty)(error, '_tag') && (0, _Predicate.hasProperty)(error, 'message')) {
|
|
34
|
-
return {
|
|
35
|
-
isPlainString: false,
|
|
36
|
-
type: error._tag,
|
|
37
|
-
message: error.message
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
// Plain objects with toString impl
|
|
41
|
-
if ((0, _Predicate.hasProperty)(error, 'toString') && (0, _Function.isFunction)(error.toString) && error.toString !== Object.prototype.toString && error.toString !== Array.prototype.toString) {
|
|
42
|
-
const message = error.toString();
|
|
43
|
-
const maybeWithUnderlyingType = message.split(': ');
|
|
44
|
-
if (maybeWithUnderlyingType.length > 1) {
|
|
45
|
-
const [type, ...message] = maybeWithUnderlyingType;
|
|
46
|
-
return {
|
|
47
|
-
isPlainString: false,
|
|
48
|
-
type,
|
|
49
|
-
message
|
|
50
|
-
};
|
|
4
|
+
const Function_1 = require("effect/Function");
|
|
5
|
+
const Predicate_1 = require("effect/Predicate");
|
|
6
|
+
const extractErrorDetails = (error) => {
|
|
7
|
+
if (typeof error === 'string') {
|
|
8
|
+
return {
|
|
9
|
+
isPlainString: true,
|
|
10
|
+
message: error,
|
|
11
|
+
};
|
|
51
12
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
13
|
+
// TaggedError with cause
|
|
14
|
+
if (error instanceof Error &&
|
|
15
|
+
(0, Predicate_1.hasProperty)(error, 'cause') &&
|
|
16
|
+
(0, Predicate_1.hasProperty)(error, '_tag')) {
|
|
17
|
+
return {
|
|
18
|
+
isPlainString: false,
|
|
19
|
+
type: error._tag,
|
|
20
|
+
message: error.cause,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
// TaggedError with error ctor
|
|
24
|
+
if (error instanceof Error && (0, Predicate_1.hasProperty)(error, 'error')) {
|
|
25
|
+
return {
|
|
26
|
+
isPlainString: false,
|
|
27
|
+
type: error.name,
|
|
28
|
+
message: error.error,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// Plain objects with tag attribute
|
|
32
|
+
if ((0, Predicate_1.hasProperty)(error, '_tag') && (0, Predicate_1.hasProperty)(error, 'message')) {
|
|
33
|
+
return {
|
|
34
|
+
isPlainString: false,
|
|
35
|
+
type: error._tag,
|
|
36
|
+
message: error.message,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// Plain objects with toString impl
|
|
40
|
+
if ((0, Predicate_1.hasProperty)(error, 'toString') &&
|
|
41
|
+
(0, Function_1.isFunction)(error.toString) &&
|
|
42
|
+
error.toString !== Object.prototype.toString &&
|
|
43
|
+
error.toString !== Array.prototype.toString) {
|
|
44
|
+
const message = error.toString();
|
|
45
|
+
const maybeWithUnderlyingType = message.split(': ');
|
|
46
|
+
if (maybeWithUnderlyingType.length > 1) {
|
|
47
|
+
const [type, ...message] = maybeWithUnderlyingType;
|
|
48
|
+
return {
|
|
49
|
+
isPlainString: false,
|
|
50
|
+
type,
|
|
51
|
+
message,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return { message, isPlainString: false };
|
|
55
|
+
}
|
|
56
|
+
return { message: `Error: ${JSON.stringify(error)}`, isPlainString: false };
|
|
61
57
|
};
|
|
62
58
|
exports.extractErrorDetails = extractErrorDetails;
|
|
63
59
|
//# sourceMappingURL=extract-error-details.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-error-details.js","
|
|
1
|
+
{"version":3,"file":"extract-error-details.js","sourceRoot":"","sources":["../../../../src/logic/errors/extract-error-details.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAC7C,gDAA+C;AAQxC,MAAM,mBAAmB,GAAG,CAAC,KAAc,EAAgB,EAAE;IAClE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,OAAO,EAAE,KAAK;SACf,CAAC;IACJ,CAAC;IAED,yBAAyB;IACzB,IACE,KAAK,YAAY,KAAK;QACtB,IAAA,uBAAW,EAAC,KAAK,EAAE,OAAO,CAAC;QAC3B,IAAA,uBAAW,EAAC,KAAK,EAAE,MAAM,CAAC,EAC1B,CAAC;QACD,OAAO;YACL,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,KAAK;SACrB,CAAC;IACJ,CAAC;IAED,8BAA8B;IAC9B,IAAI,KAAK,YAAY,KAAK,IAAI,IAAA,uBAAW,EAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;QAC1D,OAAO;YACL,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,KAAK;SACrB,CAAC;IACJ,CAAC;IAED,mCAAmC;IACnC,IAAI,IAAA,uBAAW,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,IAAA,uBAAW,EAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;QAChE,OAAO;YACL,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC;IACJ,CAAC;IAED,mCAAmC;IACnC,IACE,IAAA,uBAAW,EAAC,KAAK,EAAE,UAAU,CAAC;QAC9B,IAAA,qBAAU,EAAC,KAAK,CAAC,QAAQ,CAAC;QAC1B,KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,SAAS,CAAC,QAAQ;QAC5C,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,SAAS,CAAC,QAAQ,EAC3C,CAAC;QACD,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjC,MAAM,uBAAuB,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEpD,IAAI,uBAAuB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,MAAM,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,uBAAuB,CAAC;YAEnD,OAAO;gBACL,aAAa,EAAE,KAAK;gBACpB,IAAI;gBACJ,OAAO;aACR,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAC3C,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AAC9E,CAAC,CAAC;AA/DW,QAAA,mBAAmB,uBA+D9B"}
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.parseError = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const spanSymbol =
|
|
11
|
-
const parseError = error => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
const Predicate_1 = require("effect/Predicate");
|
|
5
|
+
const pretty_error_type_js_1 = require("../../types/pretty-error.type.js");
|
|
6
|
+
const extract_error_details_js_1 = require("./extract-error-details.js");
|
|
7
|
+
const spanSymbol = Symbol.for('effect/SpanAnnotation');
|
|
8
|
+
const parseError = (error) => {
|
|
9
|
+
const span = (0, Predicate_1.hasProperty)(error, spanSymbol)
|
|
10
|
+
? error[spanSymbol]
|
|
11
|
+
: undefined;
|
|
12
|
+
const { message, type, isPlainString } = (0, extract_error_details_js_1.extractErrorDetails)(error);
|
|
13
|
+
if (error instanceof Error) {
|
|
14
|
+
return new pretty_error_type_js_1.PrettyError(message, error.stack
|
|
15
|
+
?.split('\n')
|
|
16
|
+
.filter((el) => /at (.*)/.exec(el))
|
|
17
|
+
.join('\r\n'), span, false, type);
|
|
18
|
+
}
|
|
19
|
+
return new pretty_error_type_js_1.PrettyError(message, undefined, span, isPlainString, type);
|
|
22
20
|
};
|
|
23
21
|
exports.parseError = parseError;
|
|
24
22
|
//# sourceMappingURL=parse-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-error.js","
|
|
1
|
+
{"version":3,"file":"parse-error.js","sourceRoot":"","sources":["../../../../src/logic/errors/parse-error.ts"],"names":[],"mappings":";;;AAAA,gDAA+C;AAG/C,2EAA+D;AAE/D,yEAAiE;AAEjE,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAEhD,MAAM,UAAU,GAAG,CAAC,KAAc,EAAe,EAAE;IACxD,MAAM,IAAI,GAAG,IAAA,uBAAW,EAAC,KAAK,EAAE,UAAU,CAAC;QACzC,CAAC,CAAE,KAAK,CAAC,UAAU,CAAU;QAC7B,CAAC,CAAC,SAAS,CAAC;IACd,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,IAAA,8CAAmB,EAAC,KAAK,CAAC,CAAC;IAEpE,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,IAAI,kCAAW,CACpB,OAAO,EACP,KAAK,CAAC,KAAK;YACT,EAAE,KAAK,CAAC,IAAI,CAAC;aACZ,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aAClC,IAAI,CAAC,MAAM,CAAC,EACf,IAAI,EACJ,KAAK,EACL,IAAI,CACL,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,kCAAW,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;AACxE,CAAC,CAAC;AApBW,QAAA,UAAU,cAoBrB"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.formatFailuresTitle = void 0;
|
|
7
|
-
|
|
8
|
-
function _interopRequireDefault(e) {
|
|
9
|
-
return e && e.__esModule ? e : {
|
|
10
|
-
default: e
|
|
11
|
-
};
|
|
12
|
-
}
|
|
7
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
13
8
|
const formatFailuresTitle = (errorType, message, failuresLength, failureIndex) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
const failuresCount = failuresLength > 1
|
|
10
|
+
? picocolors_1.default.bgRed(picocolors_1.default.white(` #${failureIndex + 1} -`))
|
|
11
|
+
: '';
|
|
12
|
+
const type = picocolors_1.default.bgRed(picocolors_1.default.white(` ${errorType ?? 'Unknown error'} `));
|
|
13
|
+
const formattedMessage = picocolors_1.default.bold(picocolors_1.default.white(` • ${message}`));
|
|
14
|
+
return `💥 ${failuresCount}${type}${formattedMessage}\r\n`;
|
|
18
15
|
};
|
|
19
16
|
exports.formatFailuresTitle = formatFailuresTitle;
|
|
20
17
|
//# sourceMappingURL=format-failures-title.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-failures-title.js","
|
|
1
|
+
{"version":3,"file":"format-failures-title.js","sourceRoot":"","sources":["../../../../src/logic/pretty-printing/format-failures-title.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAExB,MAAM,mBAAmB,GAAG,CACjC,SAAkB,EAClB,OAAgB,EAChB,cAAsB,EACtB,YAAoB,EACpB,EAAE;IACF,MAAM,aAAa,GACjB,cAAc,GAAG,CAAC;QAChB,CAAC,CAAC,oBAAK,CAAC,KAAK,CAAC,oBAAK,CAAC,KAAK,CAAC,KAAK,YAAY,GAAG,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC,CAAC,EAAE,CAAC;IACT,MAAM,IAAI,GAAG,oBAAK,CAAC,KAAK,CACtB,oBAAK,CAAC,KAAK,CAAC,IAAK,SAAgC,IAAI,eAAe,GAAG,CAAC,CACzE,CAAC;IACF,MAAM,gBAAgB,GAAG,oBAAK,CAAC,IAAI,CAAC,oBAAK,CAAC,KAAK,CAAC,MAAM,OAAiB,EAAE,CAAC,CAAC,CAAC;IAE5E,OAAO,MAAM,aAAa,GAAG,IAAI,GAAG,gBAAgB,MAAM,CAAC;AAC7D,CAAC,CAAC;AAhBW,QAAA,mBAAmB,uBAgB9B"}
|