From c5518b1867532f6de177b958678d93564db1d2c0 Mon Sep 17 00:00:00 2001 From: Vipra Date: Thu, 13 Jul 2023 19:46:14 +0200 Subject: [PATCH] add documentation --- src/libs/protootshelpers.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libs/protootshelpers.js b/src/libs/protootshelpers.js index 70c09e6..3f668dd 100644 --- a/src/libs/protootshelpers.js +++ b/src/libs/protootshelpers.js @@ -17,6 +17,13 @@ export function normaliseAccountName(name) { return name; } +/** + * Turns a link to an account on a remote instance into a username. + * + * e.g. `https://example.com/@test` -> `@test@example.com` + * @param {string} url URL to an account on their own instance + * @returns {string} username (not normalised) + */ export function accountNameFromURL(url) { const splitURL = url.split("/");