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

@mediocre/bloodhound

Package Overview
Dependencies
Maintainers
2
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mediocre/bloodhound - npm Package Compare versions

Comparing version 0.3.2 to 0.4.0

8

index.js

@@ -0,1 +1,2 @@

const NodeGeocoder = require('node-geocoder');
const PitneyBowes = require('./carriers/pitneyBowes');

@@ -5,3 +6,10 @@ const FedEx = require('./carriers/fedEx');

const geography = require('./util/geography');
function Bloodhound(options) {
// Optionally specify geocoder options
if (options && options.geocoder) {
geography.geocoder = NodeGeocoder(options.geocoder);
}
// Allow PitneyBowes to cache geocode results in Redis (via petty-cache)

@@ -8,0 +16,0 @@ if (options && options.pettyCache && options.pitneyBowes) {

2

package.json

@@ -39,3 +39,3 @@ {

},
"version": "0.3.2"
"version": "0.4.0"
}

@@ -7,3 +7,2 @@ const async = require('async');

const geocoder = NodeGeocoder({ provider: 'openstreetmap' });
var pettyCache;

@@ -16,3 +15,3 @@

async.retry(function(callback) {
geocoder.geocode(location, callback);
exports.geocoder.geocode(location, callback);
}, function(err, results) {

@@ -27,4 +26,9 @@ if (err) {

const firstResult = results[0];
var firstResult = results[0];
// Handle Google results
if (!firstResult.state && firstResult.administrativeLevels && firstResult.administrativeLevels.level1short) {
firstResult.state = firstResult.administrativeLevels.level1short;
}
// Check to see if the first result has the data we need

@@ -37,3 +41,3 @@ if (firstResult.city && firstResult.state && firstResult.zipcode) {

async.retry(function(callback) {
geocoder.reverse({ lat: firstResult.latitude, lon: firstResult.longitude }, callback);
exports.geocoder.reverse({ lat: firstResult.latitude, lon: firstResult.longitude }, callback);
}, function(err, results) {

@@ -44,2 +48,9 @@ if (err) {

var firstResult = results[0];
// Handle Google results
if (!firstResult.state && firstResult.administrativeLevels && firstResult.administrativeLevels.level1short) {
firstResult.state = firstResult.administrativeLevels.level1short;
}
callback(null, results[0]);

@@ -116,2 +127,4 @@ });

geocode(location, callback);
});
});
exports.geocoder = NodeGeocoder({ provider: 'openstreetmap' });
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