File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,20 +99,19 @@ export function getNodeMetadata(
9999 offset += textLength . utf16 ;
100100 }
101101
102- const leadingOffset = enclosePeripheralComments
103- ? 0
104- : getLeadingOffset ( children ) ;
105- const trailingOffset = enclosePeripheralComments
106- ? 0
107- : getLeadingOffset ( children . reverse ( ) ) ;
108- const loc = {
109- start : initialOffset + leadingOffset ,
110- end : offset - trailingOffset ,
111- leadingOffset,
112- trailingOffset
102+ const [ leadingOffset , trailingOffset ] = enclosePeripheralComments
103+ ? [ 0 , 0 ]
104+ : [ getLeadingOffset ( children ) , getLeadingOffset ( children . reverse ( ) ) ] ;
105+
106+ return {
107+ comments,
108+ loc : {
109+ start : initialOffset + leadingOffset ,
110+ end : offset - trailingOffset ,
111+ leadingOffset,
112+ trailingOffset
113+ }
113114 } ;
114-
115- return { comments, loc } ;
116115}
117116
118117function collectComments (
You can’t perform that action at this time.
0 commit comments