mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 06:28:33 +00:00
feat(#197): prettier formatting on all files in packages/bruno-app
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
let CodeMirror;
|
||||
const SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true;
|
||||
|
||||
@@ -7,29 +6,29 @@ if (!SERVER_RENDERED) {
|
||||
}
|
||||
|
||||
export const defineCodeMirrorBrunoVariablesMode = (variables, mode) => {
|
||||
CodeMirror.defineMode("brunovariables", function(config, parserConfig) {
|
||||
CodeMirror.defineMode('brunovariables', function (config, parserConfig) {
|
||||
let variablesOverlay = {
|
||||
token: function(stream, state) {
|
||||
if (stream.match("{{", true)) {
|
||||
token: function (stream, state) {
|
||||
if (stream.match('{{', true)) {
|
||||
let ch;
|
||||
let word = "";
|
||||
let word = '';
|
||||
while ((ch = stream.next()) != null) {
|
||||
if (ch == "}" && stream.next() == "}") {
|
||||
stream.eat("}");
|
||||
if (ch == '}' && stream.next() == '}') {
|
||||
stream.eat('}');
|
||||
if (word in variables) {
|
||||
return "variable-valid";
|
||||
return 'variable-valid';
|
||||
} else {
|
||||
return "variable-invalid";
|
||||
return 'variable-invalid';
|
||||
}
|
||||
}
|
||||
word += ch;
|
||||
}
|
||||
}
|
||||
while (stream.next() != null && !stream.match("{{", false)) {}
|
||||
while (stream.next() != null && !stream.match('{{', false)) {}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || mode), variablesOverlay);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user