Fix mutate regression

This commit is contained in:
Steve Ruiz 2021-09-01 13:05:14 +01:00
parent c3ef2b8855
commit dd5836f75b
2 changed files with 4 additions and 2 deletions

View file

@ -17,7 +17,7 @@
],
"scripts": {
"test": "jest",
"test:watch": "test --watchAll",
"test:watch": "jest --watchAll",
"lerna": "lerna",
"start": "lerna run start:pre && lerna run start --stream --parallel",
"start:www": "yarn build:packages && lerna run start --parallel & cd packages/www && yarn dev",

View file

@ -422,7 +422,7 @@ export class TLDR {
const shape = this.getShape<T>(data, id, pageId)
const change = fn(shape, i)
beforeShapes[id] = Object.fromEntries(
Object.keys(change).map((key) => [key, { ...shape[key as keyof T] }])
Object.keys(change).map((key) => [key, shape[key as keyof T]])
) as Partial<T>
afterShapes[id] = change
})
@ -449,6 +449,8 @@ export class TLDR {
return this.updateBindings(cData, id, beforeShapes, afterShapes, pageId)
}, dataWithParentChanges)
console.log(beforeShapes)
return {
before: beforeShapes,
after: afterShapes,