limitd-client
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -12,7 +12,7 @@ const url = require('url'); | ||
const disyuntor = require('disyuntor'); | ||
const lps = require('length-prefixed-stream'); | ||
const lpm = require('length-prefixed-message'); | ||
var defaults = { | ||
const defaults = { | ||
port: 9231, | ||
@@ -23,2 +23,6 @@ host: 'localhost' | ||
function LimitdClient (options, done) { | ||
if (options && options.shard) { | ||
const ShardClient = require('./shard_client'); | ||
return new ShardClient(options, done); | ||
} | ||
@@ -84,2 +88,3 @@ EventEmitter.call(this); | ||
} else { | ||
this.host = options.hosts[0]; | ||
this._connectUsingReconnect(done); | ||
@@ -265,2 +270,3 @@ } | ||
} | ||
const reset_all = count === 'all'; | ||
@@ -272,4 +278,4 @@ const request = { | ||
'method': 'PUT', | ||
'all': count === 'all' ? true : null, | ||
'count': count !== 'all' ? count : null | ||
'all': reset_all ? true : null, | ||
'count': !reset_all ? count : null | ||
}; | ||
@@ -276,0 +282,0 @@ |
{ | ||
"name": "limitd-client", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "limitd client for node.js", | ||
@@ -17,2 +17,3 @@ "main": "index.js", | ||
"lodash": "~3.7.0", | ||
"murmurhash3js": "^3.0.1", | ||
"reconnect-net": "0.0.0", | ||
@@ -24,4 +25,5 @@ "tcp-client-failover": "^1.0.2", | ||
"async": "~2.1.2", | ||
"chai": "~2.2.0", | ||
"mocha": "~2.2.4" | ||
"chai": "^3.5.0", | ||
"mocha": "~2.2.4", | ||
"mockuire": "^1.1.0" | ||
}, | ||
@@ -28,0 +30,0 @@ "homepage": "https://github.com/limitd/node-client", |
const LimitdClient = require('../'); | ||
const MockServer = require('./MockServer'); | ||
const assert = require('chai').assert; | ||
const ShardClient = require('../shard_client'); | ||
@@ -25,2 +26,7 @@ const _ = require('lodash'); | ||
it('should return an instance of ShardClient when initializing with shard', function() { | ||
const client = new LimitdClient({ shard: {hosts: ['limitd://localhost:9231'] }}); | ||
assert.instanceOf(client, ShardClient); | ||
}); | ||
['take', 'wait'].forEach(function (method) { | ||
@@ -27,0 +33,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33070
16
829
9
4
3
+ Addedmurmurhash3js@^3.0.1
+ Addedmurmurhash3js@3.0.1(transitive)