mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-19 15:55:21 +01:00
837a8e15d8
* refactor(frontend): shouldCollapsedを共通化 * refactor(frontend): config.js, worker-multi-dispatch.js, intl-const.jsを共通化 * fix(frontend-shared): fix type error * refactor(frontend): is-link.jsと、同一の振る舞いをする記述を共通化 * fix * fix lint * lint fixes
23 lines
598 B
TypeScript
23 lines
598 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import * as Misskey from 'misskey-js';
|
|
import { url } from '@@/js/config.js';
|
|
|
|
export const acct = (user: Misskey.Acct) => {
|
|
return Misskey.acct.toString(user);
|
|
};
|
|
|
|
export const userName = (user: Misskey.entities.User) => {
|
|
return user.name || user.username;
|
|
};
|
|
|
|
export const userPage = (user: Misskey.Acct, path?: string, absolute = false) => {
|
|
return `${absolute ? url : ''}/@${acct(user)}${(path ? `/${path}` : '')}`;
|
|
};
|
|
|
|
export const notePage = note => {
|
|
return `/notes/${note.id}`;
|
|
};
|