New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

furkot-directions

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

furkot-directions - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

5

History.md
1.2.2 / 2019-06-03
==================
* check validity of result returned by Valhalla
1.2.1 / 2019-04-20

@@ -3,0 +8,0 @@ ==================

15

lib/service/valhalla/index.js
// https://github.com/valhalla/valhalla-docs
const LatLon = require('geodesy/latlon-spherical');
const { pathType } = require("../../model");

@@ -69,2 +70,11 @@ const status = require('../status');

function toLatLon(p) {
return new LatLon(p.lat, p.lon);
}
function minDistance(locations, units) {
units = units === 'miles' ? util.metersInMile : util.metersInKm;
return 0.9 * toLatLon(locations[0]).distanceTo(toLatLon(util.last(locations))) / units;
}
function getStatus(err, response) {

@@ -86,5 +96,8 @@ let st = response && response.status_code;

if (st === 0) {
if (response.trip.legs && response.trip.legs.length) {
if (response.trip.legs && response.trip.legs.length &&
// make sure points are not too far from roads
response.trip.summary.length > minDistance(response.trip.locations, response.trip.units)) {
return status.success;
}
delete response.trip.legs;
return status.empty;

@@ -91,0 +104,0 @@ }

2

package.json
{
"name": "furkot-directions",
"version": "1.2.1",
"version": "1.2.2",
"description": "Directions service for Furkot",

@@ -5,0 +5,0 @@ "author": {

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