Socket
Socket
Sign inDemoInstall

google-distance

Package Overview
Dependencies
29
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

12

index.js

@@ -16,6 +16,6 @@ 'use strict';

var self = this;
var options = this.formatOptions(args);
this.fetchData(options, function(err, data) {
var options = formatOptions.call(this, args);
fetchData(options, function(err, data) {
if (err) return callback(err);
self.formatResults(data, options, function(err, results) {
formatResults(data, options, function(err, results) {
if (err) return callback(err);

@@ -27,3 +27,3 @@ return callback(null, results);

GoogleDistance.prototype.formatOptions = function(args) {
var formatOptions = function(args) {
var options = {

@@ -64,3 +64,3 @@ index: args.index || null,

GoogleDistance.prototype.formatResults = function(data, options, callback) {
var formatResults = function(data, options, callback) {
var formatData = function (element) {

@@ -109,3 +109,3 @@ return {

GoogleDistance.prototype.fetchData = function(options, callback) {
var fetchData = function(options, callback) {
request(DISTANCE_API_URL + qs.stringify(options), function (err, res, body) {

@@ -112,0 +112,0 @@ if (!err && res.statusCode == 200) {

{
"name": "google-distance",
"version": "1.0.0",
"version": "1.0.1",
"main": "index",

@@ -5,0 +5,0 @@ "description": "A simple node.js wrapper for Google's Distance Matrix API",

@@ -6,22 +6,2 @@ var assert = require('chai').assert,

describe('#fetchData()', function() {
it('should GET without error', function(done) {
var options = {
origin: 'San Francisco, CA',
destination: 'San Diego, CA'
};
distance.fetchData(options, done);
});
it('should GET without error when passed multiple origins/destinations', function(done) {
var options = {
origins: ['San Francisco, CA','San Diego, CA'],
destinations: ['San Diego, CA','Seattle, WA, USA']
};
distance.fetchData(options, done);
});
});
describe('#get()', function() {

@@ -28,0 +8,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc