File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,21 @@ export const visitLiteralMap = (
1919 type : 'ObjectExpression' ,
2020 properties : keys . map ( ( keyNode , index ) => {
2121 const valueNode = values [ index ] ;
22+ const range : [ number , number ] = [
23+ keyNode . sourceSpan . start ,
24+ valueNode . sourceSpan . end ,
25+ ] ;
26+
27+ if ( keyNode . kind === 'spread' ) {
28+ return createChild < babel . SpreadElement > (
29+ {
30+ type : 'SpreadElement' ,
31+ argument : transformer . transformChild < babel . Expression > ( valueNode ) ,
32+ } ,
33+ range ,
34+ ) ;
35+ }
36+
2237 const shorthand = Boolean ( keyNode . isShorthandInitialized ) ;
2338 const key = createChild < babel . Identifier | babel . StringLiteral > (
2439 keyNode . quoted
@@ -37,7 +52,7 @@ export const visitLiteralMap = (
3752 // @ts -expect-error -- Missed in types
3853 method : false ,
3954 } ,
40- [ keyNode . sourceSpan . start , valueNode . sourceSpan . end ] ,
55+ range ,
4156 ) ;
4257 } ) ,
4358 } ;
You can’t perform that action at this time.
0 commit comments