mirror of https://codeberg.org/pzp/pzp-db.git
18 lines
356 B
JavaScript
18 lines
356 B
JavaScript
/**
|
|
* @typedef {import('.').Msg} Msg
|
|
*/
|
|
|
|
/**
|
|
* @param {string} accountId
|
|
* @returns {string}
|
|
*/
|
|
function stripAccount(accountId) {
|
|
if (accountId.startsWith('ppppp:account/v4/') === false) return accountId
|
|
const withoutPrefix = accountId.replace('ppppp:account/v4/', '')
|
|
return withoutPrefix.split('/')[0]
|
|
}
|
|
|
|
module.exports = {
|
|
stripAccount,
|
|
}
|