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

mqtt-pattern

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mqtt-pattern - npm Package Compare versions

Comparing version 1.1.1 to 1.1.3

9

index.js

@@ -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 @@

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