There was an error while loading. Please reload this page.
1 parent ede1f39 commit d19ceceCopy full SHA for d19cece
packages/vitest/src/utils/serialization.ts
@@ -3,11 +3,11 @@
3
function cloneByOwnProperties(value: any) {
4
// Clones the value's properties into a new Object. The simpler approach of
5
// Object.assign() won't work in the case that properties are not enumerable.
6
- return Object.getOwnPropertyNames(value).reduce(
7
- (clone, prop) => ({
8
- ...clone,
9
- [prop]: value[prop],
10
- }),
+ return Object.getOwnPropertyNames(value).reduce<Record<string, any>>(
+ (clone, prop) => {
+ clone[prop] = value[prop]
+ return clone
+ },
11
{},
12
)
13
}
0 commit comments