1
0
Fork 1
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:
Shea Levy 2012-12-31 13:59:30 -05:00
parent b5a3ae7b22
commit c1598d167e

View file

@ -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;