summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Emanuele Stoppa <bholmesdev@users.noreply.github.com> 2024-08-13 14:48:00 +0000
committerGravatar astrobot-houston <fred+astrobot@astro.build> 2024-08-13 14:48:00 +0000
commitcb98b74881355de9ec9d90a613a3f1d27d154463 (patch)
treec253230e67e558d0e2d55ea5f6ee27dfd0ebf914
parentc7bda4cd672864babc3cebd19a2dd2e1af85c087 (diff)
downloadastro-cb98b74881355de9ec9d90a613a3f1d27d154463.tar.gz
astro-cb98b74881355de9ec9d90a613a3f1d27d154463.tar.zst
astro-cb98b74881355de9ec9d90a613a3f1d27d154463.zip
[ci] format
-rw-r--r--packages/astro/src/actions/runtime/virtual/shared.ts19
1 files changed, 10 insertions, 9 deletions
diff --git a/packages/astro/src/actions/runtime/virtual/shared.ts b/packages/astro/src/actions/runtime/virtual/shared.ts
index 00233bf41..d792a9af5 100644
--- a/packages/astro/src/actions/runtime/virtual/shared.ts
+++ b/packages/astro/src/actions/runtime/virtual/shared.ts
@@ -214,7 +214,7 @@ export type SerializedActionResult =
export function serializeActionResult(res: SafeResult<any, any>): SerializedActionResult {
if (res.error) {
if (import.meta.env?.DEV) {
- actionResultErrorStack.set(res.error.stack)
+ actionResultErrorStack.set(res.error.stack);
}
return {
type: 'error',
@@ -222,7 +222,7 @@ export function serializeActionResult(res: SafeResult<any, any>): SerializedActi
contentType: 'application/json',
body: JSON.stringify({
...res.error,
- message: res.error.message
+ message: res.error.message,
}),
};
}
@@ -251,8 +251,9 @@ export function deserializeActionResult(res: SerializedActionResult): SafeResult
const error = ActionError.fromJson(JSON.parse(res.body));
error.stack = actionResultErrorStack.get();
return {
- error, data: undefined
- }
+ error,
+ data: undefined,
+ };
}
}
if (res.type === 'empty') {
@@ -266,8 +267,8 @@ export function deserializeActionResult(res: SerializedActionResult): SafeResult
};
}
-// in-memory singleton to save the stack trace
-const actionResultErrorStack = function actionResultErrorStackFn() {
+// in-memory singleton to save the stack trace
+const actionResultErrorStack = (function actionResultErrorStackFn() {
let errorStack: string | undefined;
return {
set(stack: string | undefined) {
@@ -275,6 +276,6 @@ const actionResultErrorStack = function actionResultErrorStackFn() {
},
get() {
return errorStack;
- }
- }
-}();
+ },
+ };
+})();