proteum 2.4.3 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proteum",
|
|
3
3
|
"description": "LLM-first Opinionated Typescript Framework for web applications.",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.4",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/proteum.git",
|
|
7
7
|
"license": "MIT",
|
|
@@ -13,7 +13,7 @@ moduleAlias.addAliases({
|
|
|
13
13
|
'@server': path.join(coreRoot, 'server'),
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
const { getHttpClientErrorContext, normalizeBugReportError } = require('./index.ts');
|
|
16
|
+
const { default: Console, getHttpClientErrorContext, normalizeBugReportError } = require('./index.ts');
|
|
17
17
|
|
|
18
18
|
test('wraps got HTTP errors as anomalies with original error context', () => {
|
|
19
19
|
const error = new Error('Response code 422 (Unprocessable Entity)');
|
|
@@ -85,3 +85,12 @@ test('wraps got HTTP errors as anomalies with original error context', () => {
|
|
|
85
85
|
test('ignores normal application errors', () => {
|
|
86
86
|
assert.equal(getHttpClientErrorContext(new Error('Something else failed')), null);
|
|
87
87
|
});
|
|
88
|
+
|
|
89
|
+
test('renders circular JSON contexts in bug report HTML', () => {
|
|
90
|
+
const context = { name: 'request' };
|
|
91
|
+
context.self = context;
|
|
92
|
+
|
|
93
|
+
const html = Console.prototype.jsonToHTML.call({ printHtml: (value) => value }, context);
|
|
94
|
+
|
|
95
|
+
assert.match(html, /Circular/);
|
|
96
|
+
});
|
|
@@ -7,6 +7,7 @@ import { serialize } from 'v8';
|
|
|
7
7
|
import { formatWithOptions } from 'util';
|
|
8
8
|
import md5 from 'md5';
|
|
9
9
|
import dayjs from 'dayjs';
|
|
10
|
+
import stringify from 'fast-safe-stringify';
|
|
10
11
|
|
|
11
12
|
// Npm
|
|
12
13
|
import { Logger, IMeta, ILogObj, ISettings } from 'tslog';
|
|
@@ -538,7 +539,7 @@ Logs: ${
|
|
|
538
539
|
public jsonToHTML(json: unknown): string {
|
|
539
540
|
if (!json) return 'No data';
|
|
540
541
|
|
|
541
|
-
const coloredJson = highlight(
|
|
542
|
+
const coloredJson = highlight(stringify(json, null, 4), { language: 'json', ignoreIllegals: true });
|
|
542
543
|
|
|
543
544
|
const html = ansi2Html.toHtml(coloredJson);
|
|
544
545
|
|