diff options
| author | yxshv <[email protected]> | 2024-04-11 16:37:46 +0530 |
|---|---|---|
| committer | yxshv <[email protected]> | 2024-04-11 16:37:46 +0530 |
| commit | 539f50367d2964579dbb6aa62876fab973b17840 (patch) | |
| tree | a071ab8c30d2448207bc68c92a57d5663dd73724 /apps/web/src/lib | |
| parent | merge pls (diff) | |
| parent | Merge branch 'main' of https://github.com/Dhravya/supermemory (diff) | |
| download | supermemory-539f50367d2964579dbb6aa62876fab973b17840.tar.xz supermemory-539f50367d2964579dbb6aa62876fab973b17840.zip | |
Merge branch 'main' of https://github.com/dhravya/supermemory
Diffstat (limited to 'apps/web/src/lib')
| -rw-r--r-- | apps/web/src/lib/utils.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/web/src/lib/utils.ts b/apps/web/src/lib/utils.ts index 5eca08cc..4f34e990 100644 --- a/apps/web/src/lib/utils.ts +++ b/apps/web/src/lib/utils.ts @@ -18,6 +18,11 @@ export function cleanUrl(url: string) { : url; } +export function getIdsFromSource(sourceIds: string[]) { + // This function converts an id from a form of `websiteURL-userID` to just the websiteURL + return sourceIds.map((id) => id.split("-").slice(0, -1).join("-")); +} + export function generateId() { return Math.random().toString(36).slice(2, 9); } |