Comparing version 0.1.5 to 1.0.0
@@ -84,2 +84,4 @@ /** | ||
const Sym = define('function', function(x) { return typeof x === 'symbol'; }); | ||
function validate(x/*: any*/, type/*: any*/, ctx/*?: ?ValidationContext*/, failOnFirstError/*?: boolean*/) { | ||
@@ -314,2 +316,3 @@ if(type.validate) { | ||
'function': Func, | ||
symbol: Sym, | ||
list, | ||
@@ -316,0 +319,0 @@ optional, |
@@ -49,2 +49,3 @@ "use strong"; | ||
T.function = assert.function; | ||
T.symbol = assert.symbol; | ||
T.list = assert.list; | ||
@@ -51,0 +52,0 @@ T.optional = assert.optional; |
{ | ||
"name": "notmytype", | ||
"version": "0.1.5", | ||
"version": "1.0.0", | ||
"description": "Type-check your function inputs with syntax like T(s, T.string, buf, Buffer, strings, T.list(T.string))", | ||
@@ -21,3 +21,3 @@ "homepage": "https://github.com/ludios/notmytype", | ||
"devDependencies": { | ||
"eslint": "^0.21.2", | ||
"eslint": "^0.23.0", | ||
"mocha": "^2.2.5" | ||
@@ -24,0 +24,0 @@ }, |
@@ -53,2 +53,3 @@ notmytype | ||
T({"hello": 3, "extra": "s"}, T.shape({"hello": T.number})); | ||
T(Symbol('a'), T.symbol); | ||
``` | ||
@@ -55,0 +56,0 @@ |
@@ -65,2 +65,18 @@ /** | ||
describe('symbol', function() { | ||
it('is() should return false if x is not a symbol', function() { | ||
assert.strictEqual( | ||
f.symbol.is('Symbol(a)'), | ||
false | ||
); | ||
}); | ||
it('is() should return true if x is a symbol', function() { | ||
assert.strictEqual( | ||
f.symbol.is(Symbol('a')), | ||
true | ||
); | ||
}); | ||
}); | ||
describe('number', function() { | ||
@@ -67,0 +83,0 @@ it('is() should return false if x is not a number', function() { |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
28290
8
783
0
70