MCPcopy
hub / github.com/buildbot/buildbot / socketPath

Function socketPath

www/data-module/src/data/DataUtils.ts:24–35  ·  view source on GitHub ↗
(arg: string | string[])

Source from the content-addressed store, hash-verified

22}
23
24export function socketPath(arg: string | string[]) {
25 const a = copyOrSplit(arg);
26 // if the argument count is even, the last argument is an id
27 // Format of properties endpoint is an exception
28 // and needs to be properties/*, not properties/*/*
29 const stars = ['*'];
30 // is it odd?
31 if (((a.length % 2) === 1) && (a.at(-1) !== "properties")) {
32 stars.push('*');
33 }
34 return a.concat(stars).join('/');
35}
36
37export function socketPathRE(socketPath: string) {
38 return new RegExp(`^${socketPath.replace(/\*/g, "[^/]+")}$`);

Callers 3

openMethod · 0.90
openMethod · 0.90
DataUtils.test.tsFile · 0.90

Calls 3

copyOrSplitFunction · 0.85
pushMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected