MCPcopy Create free account
hub / github.com/WardAnalytics/WardGraph / generateShortUrl

Function generateShortUrl

src/utils/generateShortUrl.ts:9–14  ·  view source on GitHub ↗

* Stores the url in the database and returns the shortened url * * @param url The original url to be shortened * @returns The shortened url

()

Source from the content-addressed store, hash-verified

7 * @returns The shortened url
8 */
9function generateShortUrl(): string {
10 const key = uuidv4();
11
12 const shortenedUrl = `${window.location.origin}/short/${key}`;
13 return shortenedUrl;
14}
15
16export default generateShortUrl;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected