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

sparc-commons

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparc-commons - npm Package Compare versions

Comparing version 0.1.12 to 0.1.13

48

libs/geoservice.js

@@ -6,50 +6,2 @@ /*jshint multistr: true */

var asCategoryFeatures = es.asCategoryFeatures = function(route, categories){
function createFeature(mode){
return {
type: "Feature",
geometry: {
type: "LineString",
coordinates: []
},
properties: {
category: _.findKey(categories, {mode: mode}),
mode: mode,
routepoints: []
}
}
}
return _.reduce(route.events, function(repr, event){
var feature;
if(_.isEmpty(repr.features)){
feature = createFeature(event.properties.mode)
} else {
feature = repr.features.pop()
}
//We populate features
var mode = event.properties.mode
if(mode !== feature.properties.mode){
//The point has a different category than the previous points. We create a new feature
// TODO why?
if(feature.geometry.coordinates.length <= 1){
feature.geometry.type = "Point"
feature.geometry.coordinates = _.flatten(feature.geometry.coordinates)
}
repr.features.push(feature)
feature = createFeature(event.properties.mode)
}
feature.geometry.coordinates.push(event.geometry.coordinates)
feature.properties.routepoints.push(event.properties)
repr.features.push(feature)
return repr
}, {
type: "FeatureCollection",
features: [],
properties: _.omit(route.getFields(), ['events'])
})
}
var degToRad = es.degToRad = function degToRad(x) {

@@ -56,0 +8,0 @@ return x * Math.PI / 180.0;

2

package.json
{
"name": "sparc-commons",
"version": "0.1.12",
"version": "0.1.13",
"description": "Library with all small time common stuff used across the SPARC echosystem",

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

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