File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 33
33
" index.js"
34
34
],
35
35
"devDependencies" : {
36
- "@types/acorn" : " ^4.0.5 " ,
36
+ "@types/acorn" : " ^4.0.0 " ,
37
37
"@types/tape" : " ^4.0.0" ,
38
38
"acorn" : " ^8.0.0" ,
39
39
"c8" : " ^7.0.0" ,
40
- "estree-walker " : " ^3 .0.0" ,
40
+ "estree-util-visit " : " ^1 .0.0" ,
41
41
"prettier" : " ^2.0.0" ,
42
42
"recast" : " ^0.20.0" ,
43
43
"remark-cli" : " ^9.0.0" ,
Original file line number Diff line number Diff line change 1
1
import test from 'tape'
2
2
import { parse as acornParse } from 'acorn'
3
3
import recast from 'recast'
4
- import { walk } from 'estree-walker '
4
+ import { visit } from 'estree-util-visit '
5
5
import { attachComments } from './index.js'
6
6
7
7
/**
@@ -178,17 +178,21 @@ function parse(doc) {
178
178
}
179
179
180
180
/**
181
- * @param {EstreeNode|EstreeComment| EstreeNode[]|EstreeComment [] } value
181
+ * @param {EstreeNode|EstreeNode[] } value
182
182
* @returns {void }
183
183
*/
184
184
function removePositions ( value ) {
185
185
// @ts -ignore
186
- walk ( value , {
187
- enter ( node ) {
186
+ visit (
187
+ value ,
188
+ /**
189
+ * @param {EstreeNode } node
190
+ */
191
+ function ( node ) {
188
192
// @ts -ignore they most certainly exist.
189
193
delete node . start
190
194
// @ts -ignore they most certainly exist.
191
195
delete node . end
192
196
}
193
- } )
197
+ )
194
198
}
You can’t perform that action at this time.
0 commit comments