mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
treewide: warn deprecation in singleOrListOf
This commit is contained in:
parent
6697e547b4
commit
154d8be4dc
40 changed files with 106 additions and 96 deletions
|
@ -1,4 +1,5 @@
|
|||
{lib}: let
|
||||
inherit (builtins) warn toJSON;
|
||||
inherit (lib.options) mergeEqualOption;
|
||||
inherit (lib.lists) singleton;
|
||||
inherit (lib.strings) isString stringLength match;
|
||||
|
@ -29,5 +30,14 @@ in {
|
|||
check = v: isString v && (match "#?[0-9a-fA-F]{6}" v) != null;
|
||||
};
|
||||
|
||||
singleOrListOf = t: coercedTo t singleton (listOf t);
|
||||
# no compound types please
|
||||
deprecatedSingleOrListOf = option: t:
|
||||
coercedTo
|
||||
t
|
||||
(x:
|
||||
warn ''
|
||||
${option} no longer accepts non-list values, use [${toJSON x}] instead
|
||||
''
|
||||
(singleton x))
|
||||
(listOf t);
|
||||
}
|
||||
|
|
|
@ -10,5 +10,5 @@ in {
|
|||
inherit (typesDag) dagOf;
|
||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption luaInline pluginType borderType;
|
||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||
inherit (customTypes) char hexColor mergelessListOf singleOrListOf;
|
||||
inherit (customTypes) char hexColor mergelessListOf deprecatedSingleOrListOf;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue