File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -55,9 +55,9 @@ class MqttMonitorType extends MonitorType {
55
55
* @returns {RegExp } RegExp if the actual topic matches the subscribed topic
56
56
*/
57
57
static mqttTopicRegex ( subscribedTopic ) {
58
- /* eslint no-useless-escape: ["error", { "allowRegexCharacters": ["[", "]"] }]*/
58
+ // eslint-disable-next-line
59
59
subscribedTopic = subscribedTopic . replace ( "/([$.|?*{}()\[\]\\])/g" , "\\$1" ) ; // Escape special regex chars except + and #
60
- /* eslint no-useless-escape: ["error", { "allowRegexCharacters": ["+"] }]*/
60
+ // eslint-disable-next-line
61
61
subscribedTopic = subscribedTopic . replace ( "/+/g" , "[^/]+" ) ; // Replace + with regex for one or more characters except slash
62
62
subscribedTopic = subscribedTopic . replace ( "/#/g" , ".*" ) ; // Replace # with regex for zero or more levels (including slashes)
63
63
return new RegExp ( `^${ subscribedTopic } $` ) ;
You can’t perform that action at this time.
0 commit comments