Socket
Socket
Sign inDemoInstall

connection-parse

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.6 to 0.0.7

6

index.js

@@ -91,4 +91,4 @@ 'use strict';

server.weight = +server.weight || typeof value === 'object'
? +value.weight || 0
: 0;
? +value.weight || 1
: 1;

@@ -104,3 +104,3 @@ return server;

, string: server
, weight: (typeof value === 'object' ? +value.weight : +value) || 0
, weight: (typeof value === 'object' ? +value.weight : +value) || 1
};

@@ -107,0 +107,0 @@

{
"name": "connection-parse",
"version": "0.0.6",
"version": "0.0.7",
"description": "Simple TCP connection string parser",

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

@@ -15,2 +15,4 @@ 'use strict';

describe('connection-parse()', function () {
var weight = 1;
it('accepts multiple arguments', function () {

@@ -24,3 +26,3 @@ var res = parse('1.1.1.1:1111', '11.11.11:1111');

Object.keys(res.weights).forEach(function (server) {
expect(res.weights[server]).to.equal(0);
expect(res.weights[server]).to.equal(weight);
});

@@ -32,3 +34,3 @@

expect(server.string).to.be.a('string');
expect(server.weight).to.equal(0);
expect(server.weight).to.equal(weight);
});

@@ -49,3 +51,3 @@

Object.keys(res.weights).forEach(function (server) {
expect(res.weights[server]).to.equal(0);
expect(res.weights[server]).to.equal(weight);
});

@@ -57,3 +59,3 @@

expect(server.string).to.be.a('string');
expect(server.weight).to.equal(0);
expect(server.weight).to.equal(weight);
});

@@ -117,3 +119,3 @@

res.servers.forEach(function (server) {
expect(server.weight).to.equal(0);
expect(server.weight).to.equal(weight);
});

@@ -130,3 +132,3 @@ });

Object.keys(res.weights).forEach(function (server) {
expect(res.weights[server]).to.equal(0);
expect(res.weights[server]).to.equal(weight);
});

@@ -138,3 +140,3 @@

expect(server.host).to.equal('1.1.1.1');
expect(server.weight).to.equal(0);
expect(server.weight).to.equal(weight);
});

@@ -162,3 +164,3 @@

expect(server.host).to.equal('1.1.1.1');
expect(server.weight).to.equal(0);
expect(server.weight).to.equal(weight);
expect(server.vnode).to.equal(11);

@@ -165,0 +167,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