MCPcopy Create free account
hub / github.com/ByBrawe/opencode-loop / safeID

Function safeID

src/index.js:62–67  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

60 return input.slice(1, -1);
61 }
62 return input;
63}
64function escapeRegExp(value) {
65 return String(value).replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
66}
67function takeFlag(rest, flag) {
68 const pattern = new RegExp(`(^|\\s)${escapeRegExp(flag)}(?=\\s|$)`, "i");
69 const found = pattern.test(rest);
70 return [found, rest.replace(pattern, " ").replace(/\s+/g, " ").trim()];

Callers 4

statePathFunction · 0.85
ensureBranchFunction · 0.85
createCheckpointFunction · 0.85
goalReportPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected