MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / cleanEntityId

Function cleanEntityId

bs/bs.ts:213–225  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

211}
212
213function cleanEntityId(value: any): string | undefined {
214 if (value === undefined || value === null) return undefined;
215 let text: string;
216 if (typeof value === "bigint") {
217 text = value.toString();
218 } else {
219 text = String(value);
220 }
221 if (!text) return undefined;
222 if (text.startsWith("-100")) return text.slice(4);
223 if (text.startsWith("-")) return text.slice(1);
224 return text;
225}
226
227function buildEntityLink(entity: any): string | undefined {
228 if (!entity) return undefined;

Callers 2

buildEntityLinkFunction · 0.85
buildMessageLinkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected