Comparing version
22
index.js
@@ -29,2 +29,4 @@ var t = require('tcomb'); | ||
kind: 'and', | ||
f: f, | ||
g: g, | ||
doc: doc | ||
@@ -43,2 +45,4 @@ }; | ||
kind: 'or', | ||
f: f, | ||
g: g, | ||
doc: doc | ||
@@ -57,2 +61,3 @@ }; | ||
kind: 'not', | ||
f: f, | ||
doc: doc | ||
@@ -148,2 +153,16 @@ }; | ||
function regexp(re, doc) { | ||
doc = doc || format('pattern %s', re.toString()); | ||
function regexp(x) { | ||
return re.test(x); | ||
} | ||
regexp.meta = { | ||
kind: 'regexp', | ||
re: re, | ||
doc: doc | ||
}; | ||
regexp.__doc__ = doc; | ||
return regexp; | ||
} | ||
module.exports = { | ||
@@ -162,3 +181,4 @@ util: { | ||
maxLength: maxLength, | ||
minLength: minLength | ||
minLength: minLength, | ||
regexp: regexp | ||
}; |
{ | ||
"name": "fcomb", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Function combinators", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
4567
7.26%164
13.1%