lib/types: add intBetween
An int type that checks the value range.
This commit is contained in:
@@ -114,6 +114,12 @@ rec {
|
||||
merge = mergeOneOption;
|
||||
};
|
||||
|
||||
intBetween = min: max:
|
||||
addCheck types.int (x: x >= min && x <= max) // {
|
||||
name = "intBetween";
|
||||
description = "integer between ${toString min} and ${toString max} (both inclusively)";
|
||||
};
|
||||
|
||||
str = mkOptionType {
|
||||
name = "str";
|
||||
description = "string";
|
||||
|
||||
Reference in New Issue
Block a user