@@ -23,7 +23,7 @@ function beforeNode(comments, previousNode, node, currentInitialIndex) {
2323 previousNode . position = node . position ;
2424 previousNode . initialIndex = initialIndex - 0.0001 ;
2525
26- const newComments = [ previousNode ] . concat ( comments ) ;
26+ const newComments = [ previousNode , ... comments ] ;
2727
2828 return beforeNode ( newComments , previousNode . prev ( ) , node , previousNode . initialIndex ) ;
2929}
@@ -43,7 +43,7 @@ function afterNode(comments, nextNode, node, currentInitialIndex) {
4343 nextNode . position = node . position ;
4444 nextNode . initialIndex = initialIndex + 0.0001 ;
4545
46- return afterNode ( comments . concat ( nextNode ) , nextNode . next ( ) , node , nextNode . initialIndex ) ;
46+ return afterNode ( [ ... comments , nextNode ] , nextNode . next ( ) , node , nextNode . initialIndex ) ;
4747}
4848
4949// eslint-disable-next-line max-params
@@ -70,7 +70,7 @@ function beforeDeclaration(comments, previousNode, nodeData, currentInitialIndex
7070 // add a marker
7171 previousNode . sortProperty = true ;
7272
73- const newComments = [ commentData ] . concat ( comments ) ;
73+ const newComments = [ commentData , ... comments ] ;
7474
7575 return beforeDeclaration ( newComments , previousNode . prev ( ) , nodeData , commentData . initialIndex ) ;
7676}
@@ -100,7 +100,7 @@ function afterDeclaration(comments, nextNode, nodeData, currentInitialIndex) {
100100 nextNode . sortProperty = true ;
101101
102102 return afterDeclaration (
103- comments . concat ( commentData ) ,
103+ [ ... comments , commentData ] ,
104104 nextNode . next ( ) ,
105105 nodeData ,
106106 commentData . initialIndex
0 commit comments