add documentation

This commit is contained in:
Vipra 2023-07-13 19:46:14 +02:00
parent 97553400cf
commit c5518b1867

View file

@ -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("/");