Comparing version 2.0.2 to 2.0.3
@@ -17,2 +17,7 @@ # Changelog | ||
# 2.0.3 | ||
- **Bug Fix** | ||
- rewrite es6 imports (@gcanti) | ||
# 2.0.2 | ||
@@ -19,0 +24,0 @@ |
/** | ||
* @since 1.0.0 | ||
*/ | ||
import { Either } from 'fp-ts/lib/Either'; | ||
import { Predicate, Refinement } from 'fp-ts/lib/function'; | ||
import { Either } from 'fp-ts/es6/Either'; | ||
import { Predicate, Refinement } from 'fp-ts/es6/function'; | ||
/** | ||
@@ -7,0 +7,0 @@ * @since 1.0.0 |
@@ -28,3 +28,3 @@ var __extends = (this && this.__extends) || (function () { | ||
*/ | ||
import { either, isLeft, left, right } from 'fp-ts/lib/Either'; | ||
import { either, isLeft, left, right } from 'fp-ts/es6/Either'; | ||
var map = either.map; | ||
@@ -31,0 +31,0 @@ var chain = either.chain; |
import { getFunctionName } from '.'; | ||
import { fold } from 'fp-ts/lib/Either'; | ||
import { fold } from 'fp-ts/es6/Either'; | ||
function stringify(v) { | ||
@@ -4,0 +4,0 @@ if (typeof v === 'function') { |
import { PathReporter } from './PathReporter'; | ||
import { isLeft } from 'fp-ts/lib/Either'; | ||
import { isLeft } from 'fp-ts/es6/Either'; | ||
/** | ||
@@ -4,0 +4,0 @@ * @since 1.0.0 |
{ | ||
"name": "io-ts", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "TypeScript compatible runtime type system for IO validation", | ||
@@ -20,3 +20,3 @@ "files": [ | ||
"clean": "rimraf lib/* es6/*", | ||
"build": "npm run clean && tsc && tsc -p tsconfig.es6.json", | ||
"build": "npm run clean && tsc && tsc -p tsconfig.es6.json && npm run import-path-rewrite", | ||
"prepublish": "npm run build", | ||
@@ -28,3 +28,4 @@ "perf": "ts-node perf/index", | ||
"doctoc": "doctoc README.md", | ||
"docs": "docs-ts" | ||
"docs": "docs-ts", | ||
"import-path-rewrite": "import-path-rewrite" | ||
}, | ||
@@ -53,2 +54,3 @@ "repository": { | ||
"fp-ts": "^2.0.0", | ||
"import-path-rewrite": "github:gcanti/import-path-rewrite", | ||
"jest": "^24.8.0", | ||
@@ -55,0 +57,0 @@ "mocha": "^5.2.0", |
@@ -130,12 +130,6 @@ [![build status](https://img.shields.io/travis/gcanti/io-ts/master.svg?style=flat-square)](https://travis-ci.org/gcanti/io-ts) | ||
pipe( | ||
t.string.decode('a string'), | ||
fold(onLeft, onRight) | ||
) | ||
pipe(t.string.decode('a string'), fold(onLeft, onRight)) | ||
// => "No errors: a string" | ||
pipe( | ||
t.string.decode(null), | ||
fold(onLeft, onRight) | ||
) | ||
pipe(t.string.decode(null), fold(onLeft, onRight)) | ||
// => "1 error(s) found" | ||
@@ -258,3 +252,6 @@ ``` | ||
v, | ||
fold(errors => errors.map(error => error.context.map(({ key }) => key).join('.')), () => ['no errors']) | ||
fold( | ||
errors => errors.map(error => error.context.map(({ key }) => key).join('.')), | ||
() => ['no errors'] | ||
) | ||
) | ||
@@ -355,3 +352,3 @@ } | ||
const Foo: t.Type<Foo> = t.recursion('Foo', () => | ||
t.interface({ | ||
t.type({ | ||
type: t.literal('Foo'), | ||
@@ -363,3 +360,3 @@ b: t.union([Bar, t.undefined]) | ||
const Bar: t.Type<Bar> = t.recursion('Bar', () => | ||
t.interface({ | ||
t.type({ | ||
type: t.literal('Bar'), | ||
@@ -497,2 +494,3 @@ a: t.union([Foo, t.undefined]) | ||
} | ||
interface Links { | ||
@@ -507,5 +505,5 @@ previous: string | ||
```ts | ||
// t.Mixed = t.Type<any, any, unknown> | ||
const ResponseBody = <C extends t.Mixed>(codec: C) => | ||
t.interface({ | ||
// where `t.Mixed = t.Type<any, any, unknown>` | ||
const responseBody = <C extends t.Mixed>(codec: C) => | ||
t.type({ | ||
result: codec, | ||
@@ -515,3 +513,3 @@ _links: Links | ||
const Links = t.interface({ | ||
const Links = t.type({ | ||
previous: t.string, | ||
@@ -529,3 +527,3 @@ next: t.string | ||
functionThatRequiresRuntimeType(ResponseBody(t.array(UserModel)), ...params) | ||
functionThatRequiresRuntimeType(responseBody(t.array(UserModel)), ...params) | ||
``` | ||
@@ -548,6 +546,3 @@ | ||
const NumberFromString = t.string.pipe( | ||
NumberCodec, | ||
'NumberFromString' | ||
) | ||
const NumberFromString = t.string.pipe(NumberCodec, 'NumberFromString') | ||
``` | ||
@@ -554,0 +549,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
182569
18
590