File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const update: Update = {
2626 attributes : {
2727 name : 'A2' ,
2828 desc : null ,
29+ [ '__proto__' ] : 'a string' ,
2930 'myns:attr' : {
3031 value : 'value1' ,
3132 namespaceURI : 'http://example.org/myns' ,
@@ -54,6 +55,7 @@ const setAttributes: SetAttributes = {
5455 attributes : {
5556 name : 'A2' ,
5657 desc : null ,
58+ [ '__proto__' ] : 'a string' ,
5759 } ,
5860 attributesNS : {
5961 'http://example.org/myns' : {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import {
1515} from './editv2.js' ;
1616
1717function convertUpdate ( edit : Update ) : EditV2 {
18- const attributes : AttributesV2 = { } ;
18+ let attributes : AttributesV2 = { } ;
1919 const attributesNS : AttributesNS = { } ;
2020
2121 Object . entries ( edit . attributes ) . forEach ( ( [ key , value ] ) => {
@@ -28,9 +28,9 @@ function convertUpdate(edit: Update): EditV2 {
2828 if ( ! attributesNS [ ns ] ) {
2929 attributesNS [ ns ] = { } ;
3030 }
31- attributesNS [ ns ] [ key ] = value . value ;
31+ attributesNS [ ns ] = { ... attributesNS [ ns ] , [ key ] : value . value } ;
3232 } else {
33- attributes [ key ] = value ;
33+ attributes = { ... attributes , [ key ] : value } ;
3434 }
3535 } ) ;
3636
You can’t perform that action at this time.
0 commit comments