mqemitter-redis
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -66,2 +66,4 @@ 'use strict' | ||
MQEmitter.call(this, opts) | ||
this._opts.regexWildcardOne = new RegExp(this._opts.wildcardOne.replace(/([/,!\\^${}[\]().*+?|<>\-&])/g, '\\$&'), 'g') | ||
} | ||
@@ -95,3 +97,3 @@ | ||
MQEmitterRedis.prototype._subTopic = function (topic) { | ||
return topic.replace(this._opts.wildcardOne, '*') | ||
return topic.replace(this._opts.regexWildcardOne, '*') | ||
.replace(this._opts.wildcardSome, '*') | ||
@@ -98,0 +100,0 @@ } |
{ | ||
"name": "mqemitter-redis", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Redis-based MQEmitter", | ||
@@ -8,5 +8,5 @@ "main": "mqemitter-redis.js", | ||
"inherits": "^2.0.1", | ||
"ioredis": "^3.0.0", | ||
"ioredis": "^3.2.2", | ||
"lru-cache": "^4.1.1", | ||
"mqemitter": "^2.0.0", | ||
"mqemitter": "^2.2.0", | ||
"msgpack-lite": "^0.1.14", | ||
@@ -18,4 +18,5 @@ "shortid": "^2.2.2" | ||
"pre-commit": "^1.0.7", | ||
"standard": "^10.0.2", | ||
"tape": "^4.0.0" | ||
"safe-buffer": "^5.1.1", | ||
"standard": "^10.0.3", | ||
"tape": "^4.8.0" | ||
}, | ||
@@ -22,0 +23,0 @@ "scripts": { |
17
test.js
@@ -67,1 +67,18 @@ 'use strict' | ||
}) | ||
test('topic pattern adapter', function (t) { | ||
var e = redis() | ||
var mqttTopic = 'rooms/+/devices/+/status' | ||
var expectedRedisPattern = 'rooms/*/devices/*/status' | ||
var subTopic = e._subTopic(mqttTopic) | ||
t.plan(1) | ||
t.deepEqual(subTopic, expectedRedisPattern) | ||
e.close(function () { | ||
t.end() | ||
}) | ||
}) |
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
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
195
8851
5
6
Updatedioredis@^3.2.2
Updatedmqemitter@^2.2.0