MCPcopy Create free account
hub / github.com/TanStack/ai / scoreLanCandidate

Function scoreLanCandidate

examples/ts-react-native-chat/scripts/dev.mjs:74–82  ·  view source on GitHub ↗
(candidate)

Source from the content-addressed store, hash-verified

72}
73
74function scoreLanCandidate(candidate) {
75 let score = 0
76
77 if (isPrivateIpv4(candidate.address)) score += 100
78 if (isLikelyPhysicalInterface(candidate.interfaceName)) score += 50
79 if (isLikelyVirtualInterface(candidate.interfaceName)) score -= 100
80
81 return score
82}
83
84export function pickLanAddressInfo(interfaces = networkInterfaces()) {
85 const usable = enumerateIpv4Candidates(interfaces).filter(isUsableIpv4)

Callers 1

pickLanAddressInfoFunction · 0.85

Calls 3

isPrivateIpv4Function · 0.85
isLikelyVirtualInterfaceFunction · 0.85

Tested by

no test coverage detected