Simplify lib.typeOf
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ with import ./trivial.nix;
|
|||||||
rec {
|
rec {
|
||||||
|
|
||||||
hasType = x: isAttrs x && x ? _type;
|
hasType = x: isAttrs x && x ? _type;
|
||||||
typeOf = x: if hasType x then x._type else "";
|
typeOf = x: x._type or "";
|
||||||
|
|
||||||
setType = typeName: value: value // {
|
setType = typeName: value: value // {
|
||||||
_type = typeName;
|
_type = typeName;
|
||||||
|
|||||||
Reference in New Issue
Block a user