MCPcopy Create free account
hub / github.com/codemix/graph / classEscape

Method classEscape

packages/graph/src/grammar.js:73–85  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

71 }
72
73 function classEscape(s) {
74 return unicodeEscape(s
75 .replace(/\\/g, "\\\\")
76 .replace(/\]/g, "\\]")
77 .replace(/\^/g, "\\^")
78 .replace(/-/g, "\\-")
79 .replace(/\0/g, "\\0")
80 .replace(/\t/g, "\\t")
81 .replace(/\n/g, "\\n")
82 .replace(/\r/g, "\\r")
83 .replace(/[\x00-\x0F]/g, ch => "\\x0" + hex(ch))
84 .replace(/[\x10-\x1F\x7F-\x9F]/g, ch => "\\x" + hex(ch)));
85 }
86
87 const DESCRIBE_EXPECTATION_FNS = {
88 literal(expectation) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected