MCPcopy
hub / github.com/di-sukharev/opencommit / safe

Function safe

out/cli.cjs:2297–2302  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

2295 return val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'");
2296 };
2297 var safe = (val) => {
2298 if (typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim()) {
2299 return JSON.stringify(val);
2300 }
2301 return val.split(";").join("\\;").split("#").join("\\#");
2302 };
2303 var unsafe = (val, doUnesc) => {
2304 val = (val || "").trim();
2305 if (isQuoted(val)) {

Callers 1

encode3Function · 0.85

Calls 3

isQuotedFunction · 0.85
trimMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…