Skip to content

Commit

Permalink
refactor: Update NetworkService to include ASN information in IpInfoData
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Lopez committed Nov 13, 2024
1 parent 67c1e38 commit 5db36fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/services/network.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type IpInfoData = {
org: string;
postal: string;
timezone: string;
asn?: string | any;
};
@Injectable({
providedIn: 'root',
Expand Down Expand Up @@ -98,6 +99,7 @@ export class NetworkService {
org: source?.org ?? '',
postal: source?.postal ?? '',
timezone: source?.timezone ?? '',
asn: source?.asn?.asn ?? source?.org.match(/AS[0-9]+/)?.[0] ?? '',
};
}
}

0 comments on commit 5db36fb

Please sign in to comment.