-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
From #4084 (comment)
We could enhance and unify Ranges. Currently Min and Max values are allowed but user can want to exclude them. Ex., "Positive" exclude zero. So the "Positive" range looks:
ValidateRange(0, int.MaxValue, RangeOption.ExcludeMin)"Negative":
ValidateRange( -int.MaxValue, 0, RangeOption.ExcludeMax)Exclude both (allow 0.5):
ValidateRange( 0, 1, RangeOption.ExcludeMin+RangeOption.ExcludeMax)And we can move switch (rangeKind) to a constructor (with assigning a specific error message) and implement general ValidateElement method.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime