Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentripplanner/core-utils

Package Overview
Dependencies
Maintainers
3
Versions
211
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentripplanner/core-utils - npm Package Compare versions

Comparing version 0.0.16 to 0.0.17

13

lib/map.js

@@ -17,2 +17,3 @@ "use strict";

exports.isEScooterStation = isEScooterStation;
exports.isCarWalkTransition = isCarWalkTransition;
exports.isValidLat = isValidLat;

@@ -123,3 +124,3 @@ exports.isValidLng = isValidLng;

});
itin.legs.forEach(leg => {
itin.legs.forEach((leg, idx) => {
if (leg.mode === "WALK" || leg.mode === "BICYCLE" || leg.mode === "CAR" || leg.mode === "MICROMOBILITY") {

@@ -132,2 +133,5 @@ let fromPlaceId;

fromPlaceId = `escooter_rent_station_${leg.from.name}`;
} else if (leg.mode === "CAR" && idx > 0 && itin.legs[idx - 1].mode === "WALK") {
// create a special place ID for car legs preceeded by walking legs
fromPlaceId = `itin_car_${streetEdgeId}_from`;
} else {

@@ -143,2 +147,5 @@ fromPlaceId = `itin_street_${streetEdgeId}_from`;

toPlaceId = `escooter_rent_station_${leg.to.name}`;
} else if (leg.mode === "CAR" && idx < itin.legs.length - 1 && itin.legs[idx + 1].mode === "WALK") {
// create a special place ID for car legs followed by walking legs
toPlaceId = `itin_car_${streetEdgeId}_to`;
} else {

@@ -275,2 +282,6 @@ toPlaceId = `itin_street_${streetEdgeId}_to`;

function isCarWalkTransition(place) {
return place.place_id.lastIndexOf("itin_car_") !== -1;
}
function isValidLat(lat) {

@@ -277,0 +288,0 @@ return Number.isFinite(lat) && lat >= -90 && lat <= 90;

4

package.json
{
"name": "@opentripplanner/core-utils",
"version": "0.0.16",
"version": "0.0.17",
"description": "Core functionality that is shared among numerous UI components",

@@ -20,3 +20,3 @@ "main": "lib/index.js",

},
"gitHead": "182b15d86d0576cb8ae8de035dea887258baaf03"
"gitHead": "3a8343a9af0468f457bff111a66bb0c98098b6c5"
}

@@ -105,3 +105,3 @@ import moment from "moment";

itin.legs.forEach(leg => {
itin.legs.forEach((leg, idx) => {
if (

@@ -118,2 +118,9 @@ leg.mode === "WALK" ||

fromPlaceId = `escooter_rent_station_${leg.from.name}`;
} else if (
leg.mode === "CAR" &&
idx > 0 &&
itin.legs[idx - 1].mode === "WALK"
) {
// create a special place ID for car legs preceeded by walking legs
fromPlaceId = `itin_car_${streetEdgeId}_from`;
} else {

@@ -128,2 +135,9 @@ fromPlaceId = `itin_street_${streetEdgeId}_from`;

toPlaceId = `escooter_rent_station_${leg.to.name}`;
} else if (
leg.mode === "CAR" &&
idx < itin.legs.length - 1 &&
itin.legs[idx + 1].mode === "WALK"
) {
// create a special place ID for car legs followed by walking legs
toPlaceId = `itin_car_${streetEdgeId}_to`;
} else {

@@ -274,2 +288,6 @@ toPlaceId = `itin_street_${streetEdgeId}_to`;

export function isCarWalkTransition(place) {
return place.place_id.lastIndexOf("itin_car_") !== -1;
}
export function isValidLat(lat) {

@@ -276,0 +294,0 @@ return Number.isFinite(lat) && lat >= -90 && lat <= 90;

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc