MCPcopy Create free account
hub / github.com/TruthHun/BookStack / fixWith

Function fixWith

static/editor.md/lib/codemirror/addon/lint/javascript-lint.js:42–60  ·  view source on GitHub ↗
(error, fixes, severity, force)

Source from the content-addressed store, hash-verified

40 }
41
42 function fixWith(error, fixes, severity, force) {
43 var description, fix, find, replace, found;
44
45 description = error.description;
46
47 for ( var i = 0; i < fixes.length; i++) {
48 fix = fixes[i];
49 find = (typeof fix === "string" ? fix : fix[0]);
50 replace = (typeof fix === "string" ? null : fix[1]);
51 found = description.indexOf(find) !== -1;
52
53 if (force || found) {
54 error.severity = severity;
55 }
56 if (found && replace) {
57 error.description = replace;
58 }
59 }
60 }
61
62 function isBogus(error) {
63 var description = error.description;

Callers 1

cleanupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected