MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / matchesEventPattern

Function matchesEventPattern

www/js/ext/eventsource.js:123–128  ·  view source on GitHub ↗
(pattern, eventName)

Source from the content-addressed store, hash-verified

121 }
122 }
123 function matchesEventPattern(pattern, eventName) {
124 if (pattern === eventName) return true;
125 if (!pattern.includes("*")) return false;
126 var regex = new RegExp("^" + pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*") + "$");
127 return regex.test(eventName);
128 }
129 var EventSourceFeature = class _EventSourceFeature extends Feature {
130 static keyword = "eventsource";
131 constructor(eventSourceName, nameSpace, stub) {

Callers 1

dispatchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected