mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-29 12:10:24 +00:00
15 lines
316 B
JavaScript
15 lines
316 B
JavaScript
// src/utils/ips.tsx
|
|
import ipRegex from "ip-regex";
|
|
function isIpAddress(ip) {
|
|
return ipRegex({ exact: true }).test(ip);
|
|
}
|
|
function assertIpAddress(ip) {
|
|
if (!isIpAddress(ip)) {
|
|
throw new Error(`Invalid IP address: ${ip}`);
|
|
}
|
|
}
|
|
export {
|
|
assertIpAddress,
|
|
isIpAddress
|
|
};
|
|
//# sourceMappingURL=ips.js.map
|