@@ -21,7 +21,7 @@ Transaction.start = (data) => {
21
21
const cloned = Transaction . start ( data ) ;
22
22
Object . assign ( cloned . delta , delta ) ;
23
23
return cloned ;
24
- }
24
+ } ,
25
25
} ;
26
26
27
27
return new Proxy ( data , {
@@ -31,11 +31,11 @@ Transaction.start = (data) => {
31
31
if ( delta . hasOwnProperty ( key ) ) return delta [ key ] ;
32
32
return target [ key ] ;
33
33
} ,
34
- getOwnPropertyDescriptor : ( target , key ) => (
34
+ getOwnPropertyDescriptor : ( target , key ) =>
35
35
Object . getOwnPropertyDescriptor (
36
- delta . hasOwnProperty ( key ) ? delta : target , key
37
- )
38
- ) ,
36
+ delta . hasOwnProperty ( key ) ? delta : target ,
37
+ key ,
38
+ ) ,
39
39
ownKeys ( ) {
40
40
const changes = Object . keys ( delta ) ;
41
41
const keys = Object . keys ( data ) . concat ( changes ) ;
@@ -46,7 +46,7 @@ Transaction.start = (data) => {
46
46
if ( target [ key ] === val ) delete delta [ key ] ;
47
47
else delta [ key ] = val ;
48
48
return true ;
49
- }
49
+ } ,
50
50
} ) ;
51
51
} ;
52
52
@@ -60,10 +60,9 @@ console.dir({ data });
60
60
transaction . name = 'Mao Zedong' ;
61
61
transaction . born = 1893 ;
62
62
transaction . city = 'Shaoshan' ;
63
- transaction . age = (
63
+ transaction . age =
64
64
new Date ( ) . getFullYear ( ) -
65
- new Date ( transaction . born . toString ( ) ) . getFullYear ( )
66
- ) ;
65
+ new Date ( transaction . born . toString ( ) ) . getFullYear ( ) ;
67
66
68
67
console . dir ( { transaction } ) ;
69
68
console . dir ( { delta : transaction . delta } ) ;
0 commit comments