mqtt-pattern
Advanced tools
Comparing version 1.1.1 to 1.1.3
@@ -21,8 +21,2 @@ "use strict"; | ||
if (!patternSegments[0]) | ||
patternSegments = patternSegments.slice(1); | ||
if (!topicSegments[0]) | ||
topicSegments = topicSegments.slice(1); | ||
var patternLength = patternSegments.length; | ||
@@ -37,2 +31,5 @@ var topicLength = topicSegments.length; | ||
if(!currentTopic && !currentPattern) | ||
continue; | ||
if(!currentTopic && currentPattern !== ALL) return false; | ||
@@ -39,0 +36,0 @@ |
{ | ||
"name": "mqtt-pattern", | ||
"version": "1.1.1", | ||
"version": "1.1.3", | ||
"description": "Fast library for matching MQTT patterns with named wildcards", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -62,6 +62,6 @@ "use strict"; | ||
test("matches() ignores leading '/' characters in topics and wildcards", function (t) { | ||
test("matches() supports leading slashes", function (t){ | ||
t.plan(2); | ||
t.ok(MQTTPattern.matches("/foo/bar", "foo/bar"), "Matched pattern with leading slash"); | ||
t.ok(MQTTPattern.matches("foo/bar", "/foo/bar"), "Matched topic with leading slash"); | ||
t.ok(MQTTPattern.matches("/foo/bar", "/foo/bar"), "Matched topic"); | ||
t.notok(MQTTPattern.matches("/foo/bar", "/bar/foo"), "Didn't match invalid topic"); | ||
}); | ||
@@ -68,0 +68,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
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
12547
205