MCPcopy
hub / github.com/tinymce/tinymce / matcher

Function matcher

modules/polaris/src/main/ts/ephox/polaris/api/PathPattern.ts:49–66  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

47 const { regex, paramNames } = compilePathPattern(pattern);
48
49 const matcher = (path: string): Optional<Record<string, string>> => {
50 const match = regex.exec(path);
51
52 if (Type.isNullable(match)) {
53 return Optional.none();
54 }
55
56 const result: Record<string, string> = {};
57 if (Type.isObject(match.groups)) {
58 for (const name of paramNames) {
59 if (Type.isString(match.groups[name])) {
60 result[name] = match.groups[name];
61 }
62 }
63 }
64
65 return Optional.some(result);
66 };
67
68 return matcher;
69};

Callers 4

testPathMatcherFunction · 0.85
assertHelperMatchesOnlyFunction · 0.85
makeRequestFilterFunction · 0.85

Calls 2

noneMethod · 0.80
someMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…