Skip to content

Commit bc27a22

Browse files
authored
Merge pull request #369 from backtrace-labs/bugfix/limit-depth-object
sdk-core: Limit object depth
2 parents cebd311 + f2177fa commit bc27a22

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/sdk-core/src/common/limitObjectDepth.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function limitObjectDepth<T>(val: T, depth: number): Limited<T> {
1919

2020
try {
2121
if ('toJSON' in val && typeof val.toJSON === 'function') {
22-
return limitObjectDepth(val.toJSON(), depth);
22+
return limitObjectDepth(val.toJSON(), depth - 1);
2323
}
2424
} catch (err) {
2525
if (err instanceof TypeError) {

0 commit comments

Comments
 (0)