feat(#197): prettier formatting on all files in packages/bruno-app

This commit is contained in:
Anoop M D
2023-09-18 13:37:00 +05:30
parent a103f41d85
commit 19a7f397bb
117 changed files with 1249 additions and 854 deletions

View File

@@ -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);
});
};
};