mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib/types: simplify eitherRecursive
by defining it only once
This commit is contained in:
parent
a5152c2f8e
commit
27a0dd435d
3 changed files with 10 additions and 5 deletions
|
@ -95,8 +95,15 @@ rec {
|
|||
strLua = strLikeType "lua code string";
|
||||
strLuaFn = strLikeType "lua function string";
|
||||
|
||||
# Overridden when building the documentation
|
||||
eitherRecursive = types.either;
|
||||
# When building the documentation `either` is extended to return the nestedType's sub-options
|
||||
# This type can be used to avoid infinite recursion when evaluating the docs
|
||||
# TODO: consider deprecating this in favor of using `config.isDocs` in option declarations
|
||||
eitherRecursive =
|
||||
t1: t2:
|
||||
types.either t1 t2
|
||||
// {
|
||||
getSubOptions = _: { };
|
||||
};
|
||||
|
||||
listOfLen =
|
||||
elemType: len:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue