pmj-data
Advanced tools
Comparing version 1.1.2 to 1.1.4
@@ -63,2 +63,3 @@ interface Response { | ||
export declare function GetCityDetails(city: string): cities[]; | ||
export declare function GetTopAirportsInCountry(country_code: string, max: number): Response[]; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GetCityDetails = exports.GetAirportNearbyCity = exports.GetCountryDetails = exports.AirlineDetails = exports.SearchAirports = exports.GetAirportDetails = void 0; | ||
exports.GetTopAirportsInCountry = exports.GetCityDetails = exports.GetAirportNearbyCity = exports.GetCountryDetails = exports.AirlineDetails = exports.SearchAirports = exports.GetAirportDetails = void 0; | ||
const airlines_1 = require("./data/airlines"); | ||
@@ -124,1 +124,18 @@ const airports_1 = require("./data/airports"); | ||
exports.GetCityDetails = GetCityDetails; | ||
function GetTopAirportsInCountry(country_code, max) { | ||
let data = []; | ||
const findData = airports_1.AIRPORTS.data.insert_airports.results.filter((i) => { | ||
if (i.country_code.toLowerCase() === country_code.toLowerCase()) { | ||
return i?.top_location_in_country === true; | ||
} | ||
else { | ||
return []; | ||
} | ||
}); | ||
data = findData; | ||
if (max) { | ||
return data.slice(0, 10); | ||
} | ||
return data; | ||
} | ||
exports.GetTopAirportsInCountry = GetTopAirportsInCountry; |
{ | ||
"name": "pmj-data", | ||
"version": "1.1.2", | ||
"version": "1.1.4", | ||
"description": "Search Airports, Cities, Countries and many other data in Plan My Journey DATABASE.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
69924759
9818