MCPcopy Index your code
hub / github.com/xpipe-io/xpipe / escape

Method escape

core/src/main/java/io/xpipe/core/KeyValue.java:19–30  ·  view source on GitHub ↗
(String key, Object value)

Source from the content-addressed store, hash-verified

17 }
18
19 public static KeyValue escape(String key, Object value) {
20 var string = value.toString();
21
22 string = string.replaceAll("\\\\", "\\\\\\\\");
23
24 var isQuoted = string.startsWith("\"") && string.endsWith("\"");
25 if (!isQuoted && string.contains(" ")) {
26 string = "\"" + string + "\"";
27 }
28
29 return new KeyValue(key, string);
30 }
31
32 String key;
33 String value;

Callers 8

configOptionsMethod · 0.95
configOptionsMethod · 0.95
configOptionsMethod · 0.95
configOptionsMethod · 0.95
configOptionsMethod · 0.95
configOptionsMethod · 0.95
configOptionsMethod · 0.95
configOptionsMethod · 0.95

Calls 3

startsWithMethod · 0.80
containsMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected