Socket
Socket
Sign inDemoInstall

google-flights-wrapper1

Package Overview
Dependencies
47
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.7 to 1.0.8

39

index.js

@@ -24,2 +24,4 @@ module.exports = function(apikey){

var flightNumber;
var origin;
var destination;

@@ -31,2 +33,5 @@ if(body.error) return console.error(body.error);

if(body.trips.data.carrier[j].code==body.trips.tripOption[i].slice[0].segment[k].flight.carrier){
if(airline!=""){
airline = airline + "Connecting Airline: "+body.trips.data.carrier[j].name
}
airline = body.trips.data.carrier[j].name;

@@ -36,9 +41,31 @@ break;

}
flightNumber = body.trips.tripOption[i].slice[0].segment[k].flight.number;
price = body.trips.tripOption[i].saleTotal;
arrivalTime = body.trips.tripOption[i].slice[0].segment[k].leg[body.trips.tripOption[i].slice[0].segment[k].leg.length-1].arrivalTime;
departureTime = body.trips.tripOption[i].slice[0].segment[k].leg[0].departureTime;
jsonObject = {"airline": airline , "price": price, "departureTime:":departureTime, "arrivalTime:":arrivalTime, "flightNumber:":flightNumber};
info.push(jsonObject);
if(origin != ""){
origin = origin + "Connecting Origin: "+ body.trips.tripOption[i].slice[0].segment[k].leg[0].origin;
}else{
origin = body.trips.tripOption[i].slice[0].segment[k].leg[0].origin;
}
if(destination != ""){
destination = destination + "Connecting Destination: "+ body.trips.tripOption[i].slice[0].segment[k].leg[0].destination;
}else{
destination = body.trips.tripOption[i].slice[0].segment[k].leg[0].destination;
}
if(flightNumber != ""){
flightNumber = flightNumber + "Connecting Flight Number: "+body.trips.tripOption[i].slice[0].segment[k].flight.number;
}else{
flightNumber = body.trips.tripOption[i].slice[0].segment[k].flight.number;
}
price = body.trips.tripOption[i].saleTotal;
if(arrivalTime != ""){
arrivalTime = arrivalTime + "Connecting Flight Arrival Time: " + body.trips.tripOption[i].slice[0].segment[k].leg[body.trips.tripOption[i].slice[0].segment[k].leg.length-1].arrivalTime;
}else{
arrivalTime = body.trips.tripOption[i].slice[0].segment[k].leg[body.trips.tripOption[i].slice[0].segment[k].leg.length-1].arrivalTime;
}
if(departureTime != ""){
departureTime = departureTime + "Connecting Flight Departure Time: " + body.trips.tripOption[i].slice[0].segment[k].leg[0].departureTime;
}else{
departureTime = body.trips.tripOption[i].slice[0].segment[k].leg[0].departureTime;
}
jsonObject = {"airline": airline , "price": price, "departureTime:":departureTime, "arrivalTime:":arrivalTime, "flightNumber:":flightNumber, "Origin: ": origin, "Destination: ":destination};
}
info.push(jsonObject);
}

@@ -45,0 +72,0 @@ fn(info);

2

package.json
{
"name": "google-flights-wrapper1",
"version": "1.0.7",
"version": "1.0.8",
"description": "A simple wrapper for the Google Flights API",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc