file uploads
This commit is contained in:
@@ -47,3 +47,16 @@ export function joinPaths(base: string, other: string): string {
|
||||
|
||||
return base + other;
|
||||
}
|
||||
|
||||
export function splitOnce(
|
||||
str: string,
|
||||
search: string
|
||||
): [string, string | null] {
|
||||
const index = str.indexOf(search);
|
||||
|
||||
if (index === -1) {
|
||||
return [str, null];
|
||||
}
|
||||
|
||||
return [str.slice(0, index), str.slice(index + 1)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user