( plugins: (Plugin | Plugin[])[] | undefined, )
| 2276 | } |
| 2277 | |
| 2278 | export function sortUserPlugins( |
| 2279 | plugins: (Plugin | Plugin[])[] | undefined, |
| 2280 | ): [Plugin[], Plugin[], Plugin[]] { |
| 2281 | const prePlugins: Plugin[] = [] |
| 2282 | const postPlugins: Plugin[] = [] |
| 2283 | const normalPlugins: Plugin[] = [] |
| 2284 | |
| 2285 | if (plugins) { |
| 2286 | plugins.flat().forEach((p) => { |
| 2287 | if (p.enforce === 'pre') prePlugins.push(p) |
| 2288 | else if (p.enforce === 'post') postPlugins.push(p) |
| 2289 | else normalPlugins.push(p) |
| 2290 | }) |
| 2291 | } |
| 2292 | |
| 2293 | return [prePlugins, normalPlugins, postPlugins] |
| 2294 | } |
| 2295 | |
| 2296 | export async function loadConfigFromFile( |
| 2297 | configEnv: ConfigEnv, |
no outgoing calls
no test coverage detected