ea8e6d88ab
* shareでより多くの情報を渡せるように
* from chat ui post-form, remove instant and add share
* fix await eating array, make document
* add changelog
* 3581bf9a06 (r692265037)
* reply, renoteにも型定義
* 🎨
* 閉じなければ100ms後タイムラインに
11 lines
373 B
TypeScript
11 lines
373 B
TypeScript
import * as Misskey from 'misskey-js';
|
|
|
|
export const getAcct = (user: Misskey.Acct) => {
|
|
return user.host == null ? user.username : `${user.username}@${user.host}`;
|
|
};
|
|
|
|
export const parseAcct = (acct: string): Misskey.Acct => {
|
|
if (acct.startsWith('@')) acct = acct.substr(1);
|
|
const split = acct.split('@', 2);
|
|
return { username: split[0], host: split[1] || null };
|
|
};
|