( data: Record<string, unknown>, )
| 280 | } |
| 281 | |
| 282 | function privacySignalsFromIpinfo( |
| 283 | data: Record<string, unknown>, |
| 284 | ): FreeModeIpPrivacySignal[] { |
| 285 | const anonymous = |
| 286 | data.anonymous && typeof data.anonymous === 'object' |
| 287 | ? (data.anonymous as Record<string, unknown>) |
| 288 | : {} |
| 289 | const signals: FreeModeIpPrivacySignal[] = [] |
| 290 | if (data.vpn === true || anonymous.is_vpn === true) signals.push('vpn') |
| 291 | if (data.proxy === true || anonymous.is_proxy === true) signals.push('proxy') |
| 292 | if (data.tor === true || anonymous.is_tor === true) signals.push('tor') |
| 293 | if (data.relay === true || anonymous.is_relay === true) signals.push('relay') |
| 294 | if (anonymous.is_res_proxy === true) signals.push('res_proxy') |
| 295 | if (data.hosting === true || data.is_hosting === true) { |
| 296 | signals.push('hosting') |
| 297 | } |
| 298 | if ( |
| 299 | data.service === true || |
| 300 | (typeof data.service === 'string' && data.service.length > 0) |
| 301 | ) { |
| 302 | signals.push('service') |
| 303 | } |
| 304 | if (data.is_anonymous === true) { |
| 305 | signals.push('anonymous') |
| 306 | } |
| 307 | return signals |
| 308 | } |
| 309 | |
| 310 | function pushUniqueSignal( |
| 311 | signals: FreeModeIpPrivacySignal[], |
no outgoing calls
no test coverage detected