From d7cf341320fb2e1af5d1e40e67c2fed2d65d3a5c Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 24 Apr 2021 14:30:48 +0200 Subject: [PATCH] :bug: fix Webhook model --- package.json | 2 +- src/models/Webhook.ts | 1 + src/util/String.ts | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 04dc0460..ea4bc997 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fosscord/server-util", - "version": "1.0.5", + "version": "1.0.6", "description": "Utility functions for the all server repositories", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/models/Webhook.ts b/src/models/Webhook.ts index 4660686d..7379e98f 100644 --- a/src/models/Webhook.ts +++ b/src/models/Webhook.ts @@ -80,4 +80,5 @@ WebhookSchema.virtual("source_channel", { WebhookSchema.set("removeResponse", ["source_channel_id", "source_guild_id"]); +// @ts-ignore export const WebhookModel = db.model("Webhook", WebhookSchema, "webhooks"); diff --git a/src/util/String.ts b/src/util/String.ts index 161336f1..bac7905f 100644 --- a/src/util/String.ts +++ b/src/util/String.ts @@ -1,6 +1,7 @@ import { DOUBLE_WHITE_SPACE, SPECIAL_CHAR } from "./Regex"; -export function trimSpecial(str?: string) { +export function trimSpecial(str?: string): string { + // @ts-ignore if (!str) return; return str.replace(SPECIAL_CHAR, "").replace(DOUBLE_WHITE_SPACE, " ").trim(); }