UNPKG

@maxmind/geoip2-node

Version:

Node.js API for GeoIP2 webservice client and database reader

19 lines (18 loc) 802 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = require("../utils"); const Country_1 = __importDefault(require("./Country")); class City extends Country_1.default { constructor(response, ipAddress, network) { super(response, ipAddress, network); const camelcaseResponse = (0, utils_1.camelcaseKeys)(response); this.city = camelcaseResponse.city || undefined; this.location = camelcaseResponse.location || undefined; this.postal = camelcaseResponse.postal || undefined; this.subdivisions = camelcaseResponse.subdivisions || undefined; } } exports.default = City;