File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
src/Microsoft.ComponentDetection.Orchestrator/Experiments/Configs Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 22
33using Microsoft . ComponentDetection . Contracts ;
44using Microsoft . ComponentDetection . Detectors . Npm ;
5+ using Microsoft . ComponentDetection . Detectors . Pnpm ;
6+ using Microsoft . ComponentDetection . Detectors . Poetry ;
7+ using Microsoft . ComponentDetection . Detectors . Yarn ;
58
69/// <summary>
710/// Validating the <see cref="NpmLockfile3Detector"/>.
@@ -18,6 +21,20 @@ public class NpmLockfile3Experiment : IExperimentConfiguration
1821 public bool IsInExperimentGroup ( IComponentDetector componentDetector ) => componentDetector is NpmLockfile3Detector ;
1922
2023 /// <inheritdoc />
21- public bool ShouldRecord ( IComponentDetector componentDetector , int numComponents ) =>
22- componentDetector is not NpmComponentDetectorWithRoots || numComponents == 0 ;
24+ public bool ShouldRecord ( IComponentDetector componentDetector , int numComponents )
25+ {
26+ if ( numComponents == 0 )
27+ {
28+ return true ;
29+ }
30+
31+ return componentDetector switch
32+ {
33+ NpmComponentDetectorWithRoots
34+ or PnpmComponentDetector
35+ or PoetryComponentDetector
36+ or YarnLockComponentDetector => false ,
37+ _ => true ,
38+ } ;
39+ }
2340}
You can’t perform that action at this time.
0 commit comments