File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ function hashify(obj) {
6464 return md5hash ( JSON . stringify ( obj ) ) ;
6565}
6666
67+ function isFulfilled < T > ( result : PromiseSettledResult < T > ) : result is PromiseFulfilledResult < T > {
68+ return result . status === 'fulfilled' ;
69+ }
70+
6771function notifyWatcherIssue ( limit ) {
6872 afLogger . info ( 'Ran out of file handles after watching %s files.' , limit ) ;
6973 afLogger . info ( 'Falling back to polling which uses more CPU.' ) ;
@@ -95,7 +99,7 @@ class CodeInjector implements ICodeInjector {
9599 await Promise . allSettled ( iconPackageNames . map ( async ( pkg ) => ( { pkg : await import ( this . spaTmpPath ( ) + '/node_modules/' + pkg ) , name : pkg } ) ) )
96100 ) ;
97101
98- const loadedIconPackages = iconPackages . filter ( ( res ) => res . status === 'fulfilled' ) . map ( ( res ) => res . value ) . reduce ( ( acc , { pkg, name } ) => {
102+ const loadedIconPackages = iconPackages . filter ( isFulfilled ) . map ( ( res ) => res . value ) . reduce ( ( acc , { pkg, name } ) => {
99103 acc [ name . slice ( `@iconify-prerendered/vue-` . length ) ] = pkg ;
100104 return acc ;
101105 } , { } ) ;
You can’t perform that action at this time.
0 commit comments