Socket
Socket
Sign inDemoInstall

io-ts

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io-ts - npm Package Compare versions

Comparing version 1.8.3 to 1.8.4

5

CHANGELOG.md

@@ -17,2 +17,7 @@ # Changelog

# 1.8.4
- **Polish**
- autobind `decode` method (@gcanti)
# 1.8.3

@@ -19,0 +24,0 @@

1

lib/index.js

@@ -45,2 +45,3 @@ "use strict";

this.encode = encode;
this.decode = this.decode.bind(this);
}

@@ -47,0 +48,0 @@ Type.prototype.pipe = function (ab, name) {

@@ -0,1 +1,4 @@

/**
* @deprecated
*/
import { Reporter } from './Reporter';

@@ -2,0 +5,0 @@ /**

4

package.json
{
"name": "io-ts",
"version": "1.8.3",
"version": "1.8.4",
"description": "TypeScript compatible runtime type system for IO validation",

@@ -44,3 +44,3 @@ "files": [

"benchmark": "2.1.4",
"docs-ts": "github:gcanti/docs-ts",
"docs-ts": "0.0.1",
"doctoc": "^1.4.0",

@@ -47,0 +47,0 @@ "dtslint": "github:gcanti/dtslint",

@@ -11,3 +11,2 @@ [![build status](https://img.shields.io/travis/gcanti/io-ts/master.svg?style=flat-square)](https://travis-ci.org/gcanti/io-ts)

- [The idea](#the-idea)

@@ -204,3 +203,2 @@ - [TypeScript compatibility](#typescript-compatibility)

# TypeScript integration

@@ -257,3 +255,3 @@

| intersection | `A & B` | `t.intersection([ A, B ])` |
| keyof | `keyof M` | `t.keyof(M)` |
| keyof | `keyof M` | `t.keyof(M)` (**only supports string keys**) |
| recursive types | ✘ | `t.recursion(name, definition)` |

@@ -275,3 +273,3 @@ | branded types / refinements | ✘ | `t.brand(A, predicate, brand)` |

const Category: t.RecursiveType<t.Type<Category>> = t.recursion('Category', () =>
const Category: t.Type<Category> = t.recursion('Category', () =>
t.type({

@@ -297,3 +295,3 @@ name: t.string,

const Foo: t.RecursiveType<t.Type<Foo>> = t.recursion('Foo', () =>
const Foo: t.Type<Foo> = t.recursion('Foo', () =>
t.interface({

@@ -305,3 +303,3 @@ type: t.literal('Foo'),

const Bar: t.RecursiveType<t.Type<Bar>> = t.recursion('Bar', () =>
const Bar: t.Type<Bar> = t.recursion('Bar', () =>
t.interface({

@@ -312,4 +310,2 @@ type: t.literal('Bar'),

)
const FooBar = t.taggedUnion('type', [Foo, Bar])
```

@@ -575,1 +571,12 @@

- better performance, `O(log(n))` vs `O(n)`
Beware that `keyof` is designed to work with objects containing string keys. If you intend to define a numbers enumeration, you have to use an `union` of number literals :
```ts
const HttpCode = t.union([
t.literal(200),
t.literal(201),
t.literal(202)
// etc...
])
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc