aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/mastodon.json/+server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/api/mastodon.json/+server.ts')
-rw-r--r--src/routes/api/mastodon.json/+server.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/routes/api/mastodon.json/+server.ts b/src/routes/api/mastodon.json/+server.ts
index 72cbd38..f14f726 100644
--- a/src/routes/api/mastodon.json/+server.ts
+++ b/src/routes/api/mastodon.json/+server.ts
@@ -31,8 +31,8 @@ export const POST = async({ fetch }) => {
/*** HELPER ------------------------------------------- ***/
-function findCreateType(arr: Array<{ [key: string]: any }>): { [key: string]: any } | undefined {
- return arr.find(obj => obj.type === "Create");
+function findCreateType(arr: Array<{ [key: string]: any }>): { [key: string]: any; } {
+ return arr.find(obj => obj.type === "Create") || {};
}
function processAttachments(attachments: Array<{ [key: string]: any }>): Array<string> {