UNPKG

@maxmind/geoip2-node

Version:

Node.js API for GeoIP2 webservice client and database reader

17 lines (16 loc) 595 B
import { camelcaseKeys } from '../utils.js'; import Country from './Country.js'; export default class City extends Country { city; location; postal; subdivisions; constructor(response, ipAddress, network) { super(response, ipAddress, network); const camelcaseResponse = camelcaseKeys(response); this.city = camelcaseResponse.city || undefined; this.location = camelcaseResponse.location || undefined; this.postal = camelcaseResponse.postal || undefined; this.subdivisions = camelcaseResponse.subdivisions || undefined; } }