MCPcopy Create free account
hub / github.com/cmliu/CF-Workers-CheckProxyIP / isIPv4

Function isIPv4

_worker.js:232–239  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

230}
231
232function isIPv4(value) {
233 const parts = value.split('.');
234 return parts.length === 4 && parts.every(part => {
235 if (!/^\d{1,3}$/.test(part)) return false;
236 const num = Number(part);
237 return num >= 0 && num <= 255;
238 });
239}
240
241function normalizeTxtValue(value) {
242 const text = String(value ?? '').trim();

Callers 1

handleResolveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected