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

Function extractIPFromText

bgp/bgp.ts:85–101  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

83 if (ip) return ip;
84 }
85
86 const ipRegex = /(\d{1,3}(?:\.\d{1,3}){3})/;
87 const m2 = ipRegex.exec(text);
88 if (m2) {
89 const ip = normalizeIP(m2[1]);
90 if (ip) return ip;
91 }
92
93 return null;
94}
95
96function isPlaceholderSvg(svgText: string): boolean {
97 return svgText.includes("Not_Visible") && svgText.includes("in_DFZ");
98}
99
100type BgpFetchResult =
101 | { status: "ok"; svgBuffer: Buffer; usedPrefix: string }
102 | { status: "placeholder"; usedPrefix: string | null }
103 | { status: "none" };
104

Callers 1

resolveTargetIPFunction · 0.85

Calls 2

normalizeIPFunction · 0.85
execMethod · 0.80

Tested by

no test coverage detected