diff --git a/index.test.ts b/index.test.ts index 4c76e54..7bb85a9 100644 --- a/index.test.ts +++ b/index.test.ts @@ -105,12 +105,14 @@ test('person props default to null if no values present', async () => { }) expect(event!.properties!.$set_once).toEqual({ $initial_geoip_city_name: null, // default to null + $initial_geoip_city_confidence: null, $initial_geoip_country_name: 'Sweden', $initial_geoip_country_code: 'SE', $initial_geoip_continent_name: 'Europe', $initial_geoip_continent_code: 'EU', $initial_geoip_latitude: 58.4167, $initial_geoip_longitude: 15.6167, + $initial_geoip_accuracy_radius: 76, $initial_geoip_time_zone: 'Europe/Stockholm', $initial_geoip_subdivision_1_code: 'E', $initial_geoip_subdivision_1_name: 'Östergötland County', diff --git a/index.ts b/index.ts index 13ccd74..3cb67b4 100644 --- a/index.ts +++ b/index.ts @@ -54,7 +54,7 @@ const plugin: Plugin = { const location: Record = {} if (response.city) { location['city_name'] = response.city.names?.en - location['city_confidence'] = response.city.confidence + location['city_confidence'] = response.city.confidence ?? null } if (response.country) { location['country_name'] = response.country.names?.en