summaryrefslogtreecommitdiffstats
path: root/lib/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/default.nix')
-rw-r--r--lib/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 9399a0107..803a614a1 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -29,6 +29,10 @@ let
setAttr = name: value: set: set // { ${name} = value; };
+ test = re: x: isString x && testString re x;
+
+ testString = re: x: match re x != null;
+
toC = x: let
type = typeOf x;
reject = throw "cannot convert ${type}";