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

Function matchesEventPattern

src/ext/eventsource.js:81–86  ·  view source on GitHub ↗
(pattern, eventName)

Source from the content-addressed store, hash-verified

79// ========================================
80
81function matchesEventPattern(pattern, eventName) {
82 if (pattern === eventName) return true;
83 if (!pattern.includes('*')) return false;
84 var regex = new RegExp('^' + pattern.replace(/[.+^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*') + '$');
85 return regex.test(eventName);
86}
87
88// ========================================
89// FEATURE

Callers 1

dispatchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected