uranusjr commented on code in PR #41516:
URL: https://github.com/apache/airflow/pull/41516#discussion_r1719636364
##########
airflow/www/static/js/components/RenderedJsonField.tsx:
##########
@@ -47,7 +47,7 @@ const JsonParse = (content: string | object) => {
contentJson = content;
}
contentFormatted = JSON.stringify(contentJson, null, 4);
- isJson = true;
+ isJson = Number.isNaN(contentJson); // ensure numbers/bool are not treated
as JSON
Review Comment:
I think this actually returns `false` for everything that’s actually JSON…
```js
var c = JSON.stringify({a: 1})
console.log(Number.isNaN(c)) // false
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]