File tree 2 files changed +14
-8
lines changed
2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 6
6
* @typedef {import('unist').Position } Position
7
7
* @typedef {import('unist').Point } Point
8
8
* @typedef {Node & {children: never, value: never} } _Void
9
+ *
10
+ * @typedef SeenErrorFields
11
+ * @property {true } [__unist__]
12
+ *
13
+ * @typedef {Error & SeenErrorFields } SeenError
9
14
*/
10
15
11
16
import nodeAssert from 'node:assert'
@@ -85,10 +90,11 @@ export function wrap(fn) {
85
90
try {
86
91
fn ( node , parent )
87
92
} catch ( error ) {
88
- if ( ! own . call ( error , ID ) ) {
89
- error [ ID ] = true
90
- error . message += ': `' + view ( node ) + '`'
91
- if ( parent ) error . message += ' in `' + view ( parent ) + '`'
93
+ const exception = /** @type {SeenError } */ ( error )
94
+ if ( ! own . call ( exception , ID ) ) {
95
+ exception [ ID ] = true
96
+ exception . message += ': `' + view ( node ) + '`'
97
+ if ( parent ) exception . message += ' in `' + view ( parent ) + '`'
92
98
}
93
99
94
100
throw error
Original file line number Diff line number Diff line change 47
47
"@types/tape" : " ^4.0.0" ,
48
48
"c8" : " ^7.0.0" ,
49
49
"prettier" : " ^2.0.0" ,
50
- "remark-cli" : " ^9 .0.0" ,
51
- "remark-preset-wooorm" : " ^8 .0.0" ,
50
+ "remark-cli" : " ^10 .0.0" ,
51
+ "remark-preset-wooorm" : " ^9 .0.0" ,
52
52
"rimraf" : " ^3.0.0" ,
53
53
"tape" : " ^5.0.0" ,
54
- "tsd" : " ^0.17 .0" ,
54
+ "tsd" : " ^0.20 .0" ,
55
55
"type-coverage" : " ^2.0.0" ,
56
56
"typescript" : " ^4.0.0" ,
57
- "xo" : " ^0.40 .0"
57
+ "xo" : " ^0.49 .0"
58
58
},
59
59
"scripts" : {
60
60
"prepack" : " npm run build && npm run format" ,
You can’t perform that action at this time.
0 commit comments