]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/helpers/actors.ts
Merge remote-tracking branch 'weblate/develop' into develop
[github/Chocobozzz/PeerTube.git] / server / helpers / actors.ts
1 import { WEBSERVER } from '@server/initializers/constants'
2
3 function handleToNameAndHost (handle: string) {
4 let [ name, host ] = handle.split('@')
5 if (host === WEBSERVER.HOST) host = null
6
7 return { name, host, handle }
8 }
9
10 function handlesToNameAndHost (handles: string[]) {
11 return handles.map(h => handleToNameAndHost(h))
12 }
13
14 export {
15 handleToNameAndHost,
16 handlesToNameAndHost
17 }