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

sphere-knn

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sphere-knn - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

40

lib/spherekd.js

@@ -13,7 +13,37 @@ var kd = require("./kd"),

function Position(object) {
this.object = object
this.position = spherical2cartesian(
object.lat || object.latitude,
object.lon || object.longitude || object.lng || object.long
)
var lat, lon;
/* Find latitude. */
if(object.hasOwnProperty("lat"))
lat = object.lat;
else if(object.hasOwnProperty("latitude"))
lat = object.latitude;
else if(object.hasOwnProperty("location") &&
Array.isArray(object.location) &&
object.location.length === 2)
lat = object.location[0];
/* Find longitude. */
if(object.hasOwnProperty("lon"))
lon = object.lon;
else if(object.hasOwnProperty("longitude"))
lon = object.longitude;
else if(object.hasOwnProperty("lng"))
lon = object.lng;
else if(object.hasOwnProperty("long"))
lon = object.long;
else if(object.hasOwnProperty("location") &&
Array.isArray(object.location) &&
object.location.length === 2)
lon = object.location[1];
/* Finally, set this object's properties. */
this.object = object;
this.position = spherical2cartesian(lat, lon);
}

@@ -20,0 +50,0 @@

2

package.json
{
"name": "sphere-knn",
"version": "1.2.0",
"version": "1.2.1",
"description": "search for k nearest neighbors on a sphere",

@@ -5,0 +5,0 @@ "keywords": [

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