File tree 1 file changed +16
-5
lines changed
1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- function handleCircularDependancyWarning ( warning , rollupWarn ) {
3
+ /**
4
+ * @typedef {import('rollup') } rollup
5
+ * @typedef {import('rollup').WarningHandlerWithDefault } rollup.WarningHandlerWithDefault
6
+ */
7
+
8
+ /**
9
+ * @type {rollup.WarningHandlerWithDefault }
10
+ */
11
+ function handleCircularDependancyWarning ( warning , warningHandler ) {
4
12
const packagesWithCircularDependencies = [
5
13
'util/' ,
6
14
'assert/' ,
@@ -10,12 +18,15 @@ function handleCircularDependancyWarning(warning, rollupWarn) {
10
18
if (
11
19
! (
12
20
warning . code === 'CIRCULAR_DEPENDENCY' &&
13
- packagesWithCircularDependencies . some ( ( modulePath ) =>
14
- warning . importer . includes ( modulePath )
15
- )
21
+ packagesWithCircularDependencies . some ( ( modulePath ) => {
22
+ if ( typeof warning . importer !== 'string' ) {
23
+ return false ;
24
+ }
25
+ return warning . importer . includes ( modulePath ) ;
26
+ } )
16
27
)
17
28
) {
18
- rollupWarn ( warning ) ;
29
+ warningHandler ( warning ) ;
19
30
}
20
31
}
21
32
You can’t perform that action at this time.
0 commit comments