mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-11 05:56:55 +03:00
6 lines
202 B
TypeScript
6 lines
202 B
TypeScript
export function maskIP(ip: string = ''): string {
|
|
const ipv4Regex = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
|
|
|
|
return ip.replace(ipv4Regex, (_match, _p1, _p2, _p3, p4) => `XX.XX.XX.${p4}`);
|
|
}
|