tcomb
Advanced tools
Comparing version 3.2.2 to 3.2.3
@@ -15,2 +15,9 @@ # Changelog | ||
# v3.2.3 | ||
- **Polish** | ||
- add `isNil` check in interface constructor | ||
- **Experimental** | ||
- add support for [babel-plugin-tcomb](https://github.com/gcanti/babel-plugin-tcomb), fix #218 (@gcanti) | ||
# v3.2.2 | ||
@@ -17,0 +24,0 @@ |
@@ -24,2 +24,3 @@ /*! @preserve | ||
t.Integer = require('./lib/Integer'); | ||
t.IntegerT = t.Integer; | ||
t.Object = require('./lib/Object'); | ||
@@ -29,2 +30,3 @@ t.RegExp = require('./lib/RegExp'); | ||
t.Type = require('./lib/Type'); | ||
t.TypeT = t.Type; | ||
@@ -31,0 +33,0 @@ // short alias are deprecated |
@@ -55,2 +55,3 @@ var assert = require('./assert'); | ||
path = path || [displayName]; | ||
assert(!isNil(value), function () { return 'Invalid value ' + value + ' supplied to ' + path.join('/'); }); | ||
// strictness | ||
@@ -57,0 +58,0 @@ if (strict) { |
{ | ||
"name": "tcomb", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "Type checking and DDD for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -32,3 +32,3 @@ [![build status](https://img.shields.io/travis/gcanti/tcomb/master.svg?style=flat-square)](https://travis-ci.org/gcanti/tcomb) | ||
// using babel-plugin-tcomb | ||
function sum(a: t.Number, b: t.Number) { | ||
function sum(a: number, b: number) { | ||
return a + b; | ||
@@ -177,6 +177,6 @@ } | ||
With [babel-plugin-tcomb](https://github.com/gcanti/babel-plugin-tcomb) you can use type annotations: | ||
Using [babel-plugin-tcomb](https://github.com/gcanti/babel-plugin-tcomb) you can also write (Flow compatible) type annotations: | ||
```js | ||
function sum(a: t.Number, b: t.Number): t.Number { | ||
function sum(a: number, b: number): number { | ||
return a + b; | ||
@@ -215,3 +215,2 @@ } | ||
* [tcomb-json-schema](https://github.com/gcanti/tcomb-json-schema) Transforms a JSON Schema to a tcomb type | ||
* [tcomb-defaults](https://github.com/ahdinosaur/tcomb-defaults) default properties in tcomb structs | ||
* [reactuate](https://github.com/reactuate/reactuate) React/Redux stack (not a boilerplate kit) | ||
@@ -218,0 +217,0 @@ * [tcomb-react](https://github.com/gcanti/tcomb-react) Alternative syntax for PropTypes |
87138
1906
236