Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/bruno-app/src/globalStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,12 @@ const GlobalStyle = createGlobalStyle`
font-size: ${(props) => props.theme.font.size.base};
font-family: Inter, sans-serif;
font-weight: 400;
word-break: break-word;
overflow-wrap: break-word;
white-space: pre-wrap;
line-height: 1.25rem;
color: ${(props) => props.theme.codemirror.variable.info.color};
min-height: 1.75rem;
max-width: 13.1875rem;
max-width: 17.1875rem;
}

/* Value Editor (CodeMirror) */
Expand Down
2 changes: 1 addition & 1 deletion packages/bruno-app/src/utils/codemirror/brunoVarInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const updateValueDisplay = (valueDisplay, value, isSecret, isMasked, isRevealed)
if ((isSecret || isMasked) && !isRevealed) {
valueDisplay.textContent = getMaskedDisplay(value);
} else {
valueDisplay.textContent = value || '';
valueDisplay.textContent = !value && value !== 0 ? '' : typeof value === 'object' ? JSON.stringify(value, null, 2) : value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
valueDisplay.textContent = !value && value !== 0 ? '' : typeof value === 'object' ? JSON.stringify(value, null, 2) : value;
switch (typeof value) {
case 'undefined':
case 'function':
valueDisplay.textContent = typeof value;
case 'object':
valueDisplay.textContent = value === null ? 'null' : JSON.stringify(value, null, 2);
default:
valueDisplay.textContent = String(value);
}

I feel like using a switch to cover all possible values/edge-cases would be better for values like null, undefined etc.

}
};

Expand Down