File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,12 @@ const element = new DOMParser().parseFromString(
1414 'application/xml' ,
1515) ! . documentElement ;
1616
17- const update : Update = { element, attributes : { } } ;
17+ const update : Update = {
18+ element,
19+ attributes : {
20+ attr1 : { namespaceURI : 'http://myns.com' , value : 'new value' } ,
21+ } ,
22+ } ;
1823const insert : Insert = { parent : element , node : element , reference : null } ;
1924const remove : Remove = { node : element } ;
2025const setAttributes : SetAttributes = {
Original file line number Diff line number Diff line change @@ -81,10 +81,11 @@ export function isRemove(edit: unknown): edit is Remove {
8181}
8282
8383export function isSetAttributes ( edit : unknown ) : edit is SetAttributes {
84+ const setAttrs = edit as SetAttributes ;
8485 return (
85- ( edit as SetAttributes ) . element instanceof Element &&
86- isAttributesV2 ( ( edit as SetAttributes ) . attributes ) &&
87- isAttributesNS ( ( edit as SetAttributes ) . attributesNS )
86+ setAttrs . element instanceof Element &&
87+ ( isAttributesV2 ( setAttrs . attributes ) ||
88+ isAttributesNS ( setAttrs . attributesNS ) )
8889 ) ;
8990}
9091
Original file line number Diff line number Diff line change 8282 },
8383 "lint-staged" : {
8484 "*.ts" : [
85- " eslint --fix --config package.json " ,
85+ " eslint --fix" ,
8686 " prettier --write" ,
87- " eslint --config package.json "
87+ " eslint"
8888 ]
8989 }
9090}
You can’t perform that action at this time.
0 commit comments