mirror of
https://github.com/PretendoNetwork/miiverse-api.git
synced 2026-07-03 17:11:14 -05:00
Simplify check a bit
We don't have to assert the string array, as it could be undefined and we can handle that.
This commit is contained in:
parent
3a71193ff8
commit
2eb969c0f1
|
|
@ -236,7 +236,7 @@ async function newPost(request: express.Request, response: express.Response): Pr
|
|||
const screenshot: string = bodyCheck.data.screenshot?.replace(/\0/g, '').trim() || '';
|
||||
const appData: string = bodyCheck.data.app_data?.replace(/[^A-Za-z0-9+/=\s]/g, '').trim() || '';
|
||||
const feelingID: number = parseInt(bodyCheck.data.feeling_id);
|
||||
const searchKey: string[] | undefined = (typeof bodyCheck.data.search_key === 'string' ? [bodyCheck.data.search_key as string] : bodyCheck.data.search_key as string[]) || [];
|
||||
const searchKey: string[] | undefined = (typeof bodyCheck.data.search_key === 'string' ? [bodyCheck.data.search_key as string] : bodyCheck.data.search_key) || [];
|
||||
const topicTag: string | undefined = bodyCheck.data.topic_tag || '';
|
||||
const autopost: string = bodyCheck.data.is_autopost;
|
||||
const spoiler: string | undefined = bodyCheck.data.is_spoiler;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user