Skip to content

Commit b7d26d5

Browse files
committed
fix: solve readonly assingment problems with copy
1 parent e80d23a commit b7d26d5

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"@babel/traverse": "^7.23.2",
6161
"@babel/types": "^7.23.0",
6262
"c12": "^1.4.1",
63+
"copy-anything": "^3.0.5",
6364
"fast-equals": "^5.0.1",
6465
"human-logs": "^0.3.0",
6566
"lilconfig": "^2.1.0",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/storage.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { getUserId } from '../index'
1111
import { removeCircularsAndNonPojos, removeUnserializableValues, safeStringify } from './stringify'
1212
import { decryptCapture, encryptCapture } from './encryption'
1313
import { request } from './requestUtils'
14+
import { copy } from 'copy-anything'
1415

1516
function findWithLatestErrorInvocation<T extends CapturedCall | CapturedFunction>(
1617
capturedFunctions: T[]
@@ -93,6 +94,10 @@ export async function saveCapture(
9394
)
9495
}
9596

97+
// Copy calls & functions
98+
calls = copy(calls)
99+
functions = copy(functions)
100+
96101
// Remove unserializable values
97102
calls = removeUnserializableValues(calls)
98103
functions = removeUnserializableValues(functions)

0 commit comments

Comments
 (0)