mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
languages: coerce server type to list for compat
This commit is contained in:
parent
76c031bbda
commit
9407a3e1c6
34 changed files with 98 additions and 103 deletions
|
@ -1,7 +1,8 @@
|
|||
{lib}: let
|
||||
inherit (lib.options) mergeEqualOption;
|
||||
inherit (lib.lists) singleton;
|
||||
inherit (lib.strings) isString stringLength match;
|
||||
inherit (lib.types) listOf mkOptionType;
|
||||
inherit (lib.types) listOf mkOptionType coercedTo;
|
||||
in {
|
||||
mergelessListOf = elemType: let
|
||||
super = listOf elemType;
|
||||
|
@ -27,4 +28,6 @@ in {
|
|||
description = "RGB color in hex format";
|
||||
check = v: isString v && (match "#?[0-9a-fA-F]{6}" v) != null;
|
||||
};
|
||||
|
||||
singleOrListOf = t: coercedTo t singleton (listOf t);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue