XpmPolicies.(constructor)
Constructs policy flags based on a minimum xpm version.
Signature
constructor({ log, minVersion }: {
log: Logger;
minVersion: string;
});
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
{ log, minVersion } |
{ log: Logger; minVersion: string; } |
Remarks
The constructor evaluates each policy flag by comparing the provided minimum version against threshold versions where behavior changed.
Evaluation process:
- Validate that
minVersionis a valid semver string. - If invalid, retain default values (all flags false = modern behavior).
- For each policy, use
semver.lt()to check ifminVersionis less than the threshold version. - If
minVersion< threshold, enable legacy behavior (flag =true). - If
minVersion>= threshold, use modern behavior (flag =false).
This ensures that packages explicitly declaring their minimum version get the behavior that was current at that version, while packages without a valid minimum version default to the most modern behavior.
Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.