MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / getDisplayName

Function getDisplayName

packages/utilities/src/getDisplayName.ts:3–12  ·  view source on GitHub ↗
(userId: string, mentions?: SerializedUser[])

Source from the content-addressed store, hash-verified

1import { SerializedUser } from '@linen/types';
2
3export function getDisplayName(userId: string, mentions?: SerializedUser[]) {
4 if (!mentions) {
5 return 'User';
6 }
7 return userId === 'channel'
8 ? userId
9 : mentions.find(
10 (user) => user.id === userId || user.externalUserId === userId
11 )?.displayName || 'User';
12}

Callers 2

getTitleFunction · 0.90
MentionFunction · 0.90

Calls 1

findMethod · 0.45

Tested by

no test coverage detected