Skip to content

Commit 85a9409

Browse files
committed
chore: format
1 parent 8fe1b90 commit 85a9409

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

packages/browser-logs/src/deserialize.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ function createReviver(promises: Promise<unknown>[], options?: DeserializeOption
6464
const safeName = isValidIdentifier(rawName) ? rawName : 'anonymous';
6565

6666
// Create a fake function with the same name. We don't log the function implementation.
67-
return new Function(
68-
`return function ${safeName}() { /* implementation hidden */ }`,
69-
)();
67+
return new Function(`return function ${safeName}() { /* implementation hidden */ }`)();
7068
}
7169
case 'RegExp':
7270
// Create a new RegExp using the same parameters
@@ -127,7 +125,7 @@ function createReviver(promises: Promise<unknown>[], options?: DeserializeOption
127125

128126
const { hasOwnProperty } = Object.prototype;
129127

130-
interface DeserializeOptions extends ParseStackTraceOptions { }
128+
interface DeserializeOptions extends ParseStackTraceOptions {}
131129

132130
export async function deserialize(value: string, options?: DeserializeOptions) {
133131
try {
@@ -147,4 +145,4 @@ export async function deserialize(value: string, options?: DeserializeOptions) {
147145
console.error(error);
148146
return null;
149147
}
150-
}
148+
}

packages/browser-logs/test/serialize-deserialize.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,7 @@ describe('deserialize security', function () {
539539
it('sanitizes constructor names with code injection payloads', async () => {
540540
// This payload would execute arbitrary code if interpolated directly into new Function(...)
541541
const maliciousPayload = JSON.stringify({
542-
__WTR_CONSTRUCTOR_NAME__:
543-
'x(){},(globalThis.PWNED=true),function y',
542+
__WTR_CONSTRUCTOR_NAME__: 'x(){},(globalThis.PWNED=true),function y',
544543
data: 'test',
545544
});
546545

@@ -773,4 +772,4 @@ describe('deserialize security', function () {
773772
assert.equal(deserialized[0].name, 'anonymous');
774773
});
775774
});
776-
});
775+
});

0 commit comments

Comments
 (0)