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

mixpanel

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mixpanel - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

17

lib/mixpanel-node.js

@@ -22,6 +22,8 @@ /*

// Default config
metrics.config = {
test: false,
debug: false,
verbose: false
verbose: false,
host: 'api.mixpanel.com'
};

@@ -58,3 +60,4 @@

var request_options = {
host: 'api.mixpanel.com',
host: metrics.config.host,
port: metrics.config.port,
headers: {}

@@ -691,3 +694,11 @@ };

if (config.hasOwnProperty(c)) {
metrics.config[c] = config[c];
if (c == "host") { // Split host, into host and port.
metrics.config.host = config[c].split(':')[0];
var port = config[c].split(':')[1];
if (port) {
metrics.config.port = Number(port);
}
} else {
metrics.config[c] = config[c];
}
}

@@ -694,0 +705,0 @@ }

2

package.json

@@ -10,3 +10,3 @@ {

],
"version": "0.3.0",
"version": "0.3.1",
"homepage": "https://github.com/mixpanel/mixpanel-node",

@@ -13,0 +13,0 @@ "author": "Carl Sverre",

@@ -148,2 +148,3 @@ Mixpanel-node

- [Nick Chang](https://github.com/maeldur)
- [Michael G](https://github.com/gmichael225)

@@ -150,0 +151,0 @@ License

@@ -11,3 +11,3 @@ var Mixpanel = require('../lib/mixpanel-node');

test.deepEqual(this.mixpanel.config,
{ test: false, debug: false, verbose: false },
{ test: false, debug: false, verbose: false, host: 'api.mixpanel.com' },
"default config is incorrect");

@@ -14,0 +14,0 @@ test.done();

@@ -70,3 +70,32 @@ var Mixpanel = require('../lib/mixpanel-node'),

this.http_emitter.emit('error', 'error');
},
"uses correct hostname": function(test) {
var host = 'testhost.fakedomain';
var customHostnameMixpanel = Mixpanel.init('token', { host: host })
var expected_http_get = {
host: host
};
customHostnameMixpanel.send_request('', {});
test.ok(http.get.calledWithMatch(expected_http_get), "send_request didn't call http.get with correct hostname");
test.done();
},
"uses correct port": function(test) {
var host = 'testhost.fakedomain:1337';
var customHostnameMixpanel = Mixpanel.init('token', { host: host })
var expected_http_get = {
host: 'testhost.fakedomain',
port: 1337
};
customHostnameMixpanel.send_request('', {});
test.ok(http.get.calledWithMatch(expected_http_get), "send_request didn't call http.get with correct hostname and port");
test.done();
}
};

Sorry, the diff of this file is not supported yet

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