mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
Simplify lib.typeOf
This commit is contained in:
parent
b5a3ae7b22
commit
c1598d167e
|
@ -11,7 +11,7 @@ with import ./trivial.nix;
|
|||
rec {
|
||||
|
||||
hasType = x: isAttrs x && x ? _type;
|
||||
typeOf = x: if hasType x then x._type else "";
|
||||
typeOf = x: x._type or "";
|
||||
|
||||
setType = typeName: value: value // {
|
||||
_type = typeName;
|
||||
|
|
Loading…
Reference in a new issue