mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-07 22:38:02 +03:00
Add PATCH /users/:userID endpoint
This commit is contained in:
@@ -75,4 +75,24 @@ export function IsString(val: unknown): val is string {
|
||||
|
||||
export function DedupeArr<T>(arr: T[]): T[] {
|
||||
return [...new Set(arr)];
|
||||
}
|
||||
}
|
||||
|
||||
export function StripUrl(url: string, userInput: string | null) {
|
||||
if (!userInput) {
|
||||
return userInput;
|
||||
}
|
||||
|
||||
if (userInput.toLowerCase().includes(url)) {
|
||||
return userInput.split(url)[1];
|
||||
}
|
||||
|
||||
return userInput;
|
||||
}
|
||||
|
||||
export function DeleteUndefinedProps(record: any) {
|
||||
for (const key in record) {
|
||||
if (record[key] === undefined) {
|
||||
delete record[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user