MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / getMentionIndex

Function getMentionIndex

apps/web/ui/MessageForm/index.tsx:66–71  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

64}
65
66function getMentionIndex(text: string) {
67 const index1 = text.lastIndexOf('!');
68 const index2 = text.lastIndexOf('@');
69 const indexes = [index1, index2];
70 return Math.max.apply(Math, indexes) + 1;
71}
72
73function isMentionMode(message: string, position: number) {
74 const current = message[position - 1];

Callers 1

MessageFormFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected