MCPcopy Index your code
hub / github.com/PaulTaykalo/objc-dependency-visualizer / createEscaper

Function createEscaper

Scripts/ace/worker-javascript.js:2315–2326  ·  view source on GitHub ↗
(map)

Source from the content-addressed store, hash-verified

2313 };
2314 var unescapeMap = _.invert(escapeMap);
2315 var createEscaper = function(map) {
2316 var escaper = function(match) {
2317 return map[match];
2318 };
2319 var source = '(?:' + _.keys(map).join('|') + ')';
2320 var testRegexp = RegExp(source);
2321 var replaceRegexp = RegExp(source, 'g');
2322 return function(string) {
2323 string = string == null ? '' : '' + string;
2324 return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
2325 };
2326 };
2327 _.escape = createEscaper(escapeMap);
2328 _.unescape = createEscaper(unescapeMap);
2329 _.result = function(object, property, fallback) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected