summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-03-30 01:58:43 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-03-30 01:58:43 -0400
commitea2a3be70f87cc8b953c37ffe82633be3ad4978c (patch)
treed8255e09eaebbaf5080775114fa11da811f3bcb2 /packages/backend/src/misc
parentMerge branch 'misskey-develop' into merge/2025-03-24 (diff)
parentmerge: More Mastodon API fixes (resolves #405, #471, and #984) (!954) (diff)
downloadsharkey-ea2a3be70f87cc8b953c37ffe82633be3ad4978c.tar.gz
sharkey-ea2a3be70f87cc8b953c37ffe82633be3ad4978c.tar.bz2
sharkey-ea2a3be70f87cc8b953c37ffe82633be3ad4978c.zip
Merge branch 'develop' into merge/2025-03-24
# Conflicts: # packages/backend/src/core/activitypub/models/ApPersonService.ts
Diffstat (limited to 'packages/backend/src/misc')
-rw-r--r--packages/backend/src/misc/append-content-warning.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/backend/src/misc/append-content-warning.ts b/packages/backend/src/misc/append-content-warning.ts
index 152cd6760e..9f61776b1d 100644
--- a/packages/backend/src/misc/append-content-warning.ts
+++ b/packages/backend/src/misc/append-content-warning.ts
@@ -14,10 +14,13 @@
* @param additional Content warning to append
* @param reverse If true, then the additional CW will be prepended instead of appended.
*/
-export function appendContentWarning(original: string | null | undefined, additional: string, reverse = false): string {
+export function appendContentWarning(original: string | null | undefined, additional: string, reverse?: boolean): string;
+export function appendContentWarning(original: string, additional: string | null | undefined, reverse?: boolean): string;
+export function appendContentWarning(original: string | null | undefined, additional: string | null | undefined, reverse?: boolean): string | null;
+export function appendContentWarning(original: string | null | undefined, additional: string | null | undefined, reverse = false): string | null {
// Easy case - if original is empty, then additional replaces it.
if (!original) {
- return additional;
+ return additional ?? null;
}
// Easy case - if the additional CW is empty, then don't append it.