diff options
| author | Dhravya <[email protected]> | 2024-04-10 22:02:32 -0700 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-04-10 22:02:32 -0700 |
| commit | f8068a6e01241e06398e893f31a8bf9cfc6342b2 (patch) | |
| tree | b8344549031cff1fd2a357fb0070160dea8375ce /apps/web/src/lib/utils.ts | |
| parent | Merge pull request #5 from Dhravya/new-ui (diff) | |
| download | supermemory-f8068a6e01241e06398e893f31a8bf9cfc6342b2.tar.xz supermemory-f8068a6e01241e06398e893f31a8bf9cfc6342b2.zip | |
changes in how we save vectors
Diffstat (limited to 'apps/web/src/lib/utils.ts')
| -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); } |