1
- import _pEvery from 'p-every'
2
1
import pLocate from 'p-locate'
3
2
import { type PackageJson } from 'read-package-up'
4
3
import semver from 'semver'
@@ -9,9 +8,6 @@ import { SystemLogger } from '../plugins_core/types.js'
9
8
import { PluginVersion } from './list.js'
10
9
import { CONDITIONS } from './plugin_conditions.js'
11
10
12
- // the types of that package seem to be not correct and demand a `pEvery.default()` usage which is wrong
13
- const pEvery = _pEvery as unknown as typeof import ( 'p-every' ) . default
14
-
15
11
/**
16
12
* Retrieve the `expectedVersion` of a plugin:
17
13
* - This is the version which should be run
@@ -128,9 +124,13 @@ const getCompatibleEntry = async function ({
128
124
return false
129
125
}
130
126
131
- return await pEvery ( conditions , async ( { type, condition } ) =>
132
- CONDITIONS [ type ] . test ( condition as any , { nodeVersion, packageJson, packagePath, buildDir } ) ,
133
- )
127
+ return (
128
+ await Promise . all (
129
+ conditions . map ( async ( { type, condition } ) =>
130
+ CONDITIONS [ type ] . test ( condition as any , { nodeVersion, packageJson, packagePath, buildDir } ) ,
131
+ ) ,
132
+ )
133
+ ) . every ( Boolean )
134
134
} )
135
135
136
136
if ( compatibleEntry ) {
@@ -192,9 +192,13 @@ const getFirstCompatibleEntry = async function ({
192
192
return true
193
193
}
194
194
195
- return await pEvery ( conditions , async ( { type, condition } ) =>
196
- CONDITIONS [ type ] . test ( condition as any , { nodeVersion, packageJson, packagePath, buildDir } ) ,
197
- )
195
+ return (
196
+ await Promise . all (
197
+ conditions . map ( async ( { type, condition } ) =>
198
+ CONDITIONS [ type ] . test ( condition as any , { nodeVersion, packageJson, packagePath, buildDir } ) ,
199
+ ) ,
200
+ )
201
+ ) . every ( Boolean )
198
202
} )
199
203
200
204
if ( compatibleEntry ) {
0 commit comments