Remove ts-ignore from request.cf

This commit is contained in:
dangered wolf 2023-09-10 17:30:33 -04:00
parent c77e50b2a1
commit e880cc7c37
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58

View file

@ -349,14 +349,8 @@ const versionRequest = async (request: IRequest) => {
request.headers.get('x-real-ip') ?? request.headers.get('x-real-ip') ??
request.headers.get('cf-connecting-ip') ?? request.headers.get('cf-connecting-ip') ??
'Unknown IP', 'Unknown IP',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - @cloudflare/workers-types v4 is missing IncomingRequestCfProperties.city despite it being a real property
city: request.cf?.city ?? 'Unknown City', city: request.cf?.city ?? 'Unknown City',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - @cloudflare/workers-types v4 is missing IncomingRequestCfProperties.country / region despite it being a real property
region: request.cf?.region ?? request.cf?.country ?? 'Unknown Region', region: request.cf?.region ?? request.cf?.country ?? 'Unknown Region',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - @cloudflare/workers-types v4 is missing IncomingRequestCfProperties.country despite it being a real property
country: request.cf?.country ?? 'Unknown Country', country: request.cf?.country ?? 'Unknown Country',
asn: `AS${request.cf?.asn ?? '??'} (${ asn: `AS${request.cf?.asn ?? '??'} (${
request.cf?.asOrganization ?? 'Unknown ASN' request.cf?.asOrganization ?? 'Unknown ASN'