Comparing version 0.1.4 to 0.1.5
{ | ||
"name": "notmytype", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Type-check your function inputs with syntax like T(s, T.string, buf, Buffer, strings, T.list(T.string))", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/ludios/notmytype", |
@@ -48,5 +48,7 @@ notmytype | ||
T(new Buffer("hi"), Buffer); | ||
T([3, "hi"], T.tuple([T.number, T.string])) | ||
T({"hello": 3}, T.dict(T.string, T.number)) | ||
T(undefined, T.void) | ||
T([3, "hi"], T.tuple([T.number, T.string])); | ||
T({"hello": 3}, T.dict(T.string, T.number)); | ||
T(undefined, T.void); | ||
T({"hello": 3}, T.shape({"hello": T.number})); | ||
T({"hello": 3, "extra": "s"}, T.shape({"hello": T.number})); | ||
``` | ||
@@ -58,3 +60,3 @@ | ||
> T([3, "s"], T.list(T.number)) | ||
TypeError: First variable: Expected an instance of number; got "s", context: Array<number> / 1 | ||
TypeError: First object: Expected an instance of number; got "s", context: Array<number> / 1 | ||
``` | ||
@@ -61,0 +63,0 @@ |
26523
69