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 2.0.1 to 2.0.2

5

CHANGELOG.md

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

# 2.0.2
- **Bug Fix**
- fix #397 (@gcanti)
# 2.0.1

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

7

es6/index.d.ts

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

/**
* @since 1.0.0
*/
import { Either } from 'fp-ts/lib/Either';

@@ -413,3 +416,3 @@ import { Predicate, Refinement } from 'fp-ts/lib/function';

constructor(name: string, is: RecursiveType<C, A, O, I>['is'], validate: RecursiveType<C, A, O, I>['validate'], encode: RecursiveType<C, A, O, I>['encode'], runDefinition: () => C);
readonly type: C;
get type(): C;
}

@@ -764,2 +767,4 @@ /**

/**
* Use `type` instead
* @deprecated
* @since 1.0.0

@@ -766,0 +771,0 @@ */

45

es6/index.js

@@ -25,2 +25,5 @@ var __extends = (this && this.__extends) || (function () {

};
/**
* @since 1.0.0
*/
import { either, isLeft, left, right } from 'fp-ts/lib/Either';

@@ -813,16 +816,26 @@ var map = either.map;

var mergeAll = function (base, us) {
var r = base;
for (var i = 0; i < us.length; i++) {
var u = us[i];
var equal = true;
var primitive = true;
for (var _i = 0, us_1 = us; _i < us_1.length; _i++) {
var u = us_1[_i];
if (u !== base) {
// `u` contains a prismatic value or is the result of a stripping combinator
if (r === base) {
r = Object.assign({}, u);
continue;
equal = false;
}
if (isObject(u)) {
primitive = false;
}
}
if (equal) {
return base;
}
else if (primitive) {
return us[us.length - 1];
}
var r = {};
for (var _a = 0, us_2 = us; _a < us_2.length; _a++) {
var u = us_2[_a];
for (var k in u) {
if (u[k] !== base[k] || !r.hasOwnProperty(k)) {
r[k] = u[k];
}
for (var k in u) {
if (u[k] !== base[k] || !r.hasOwnProperty(k)) {
r[k] = u[k];
}
}
}

@@ -851,3 +864,7 @@ }

return errors.length > 0 ? failures(errors) : success(mergeAll(u, us));
}, codecs.length === 0 ? identity : function (a) { return mergeAll(a, codecs.map(function (codec) { return codec.encode(a); })); }, codecs);
}, codecs.length === 0
? identity
: function (a) {
return mergeAll(a, codecs.map(function (codec) { return codec.encode(a); }));
}, codecs);
}

@@ -1082,2 +1099,4 @@ /**

/**
* Use `type` instead
* @deprecated
* @since 1.0.0

@@ -1084,0 +1103,0 @@ */

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

/**
* @since 1.0.0
*/
import { Reporter } from './Reporter';

@@ -2,0 +5,0 @@ import { ValidationError } from '.';

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

/**
* @since 1.0.0
*/
import { Validation } from './index';

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

/**
* @deprecated
* @since 1.0.0
*/

@@ -4,0 +5,0 @@ import { Reporter } from './Reporter';

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

/**
* @since 1.0.0
*/
import { Either } from 'fp-ts/lib/Either';

@@ -413,3 +416,3 @@ import { Predicate, Refinement } from 'fp-ts/lib/function';

constructor(name: string, is: RecursiveType<C, A, O, I>['is'], validate: RecursiveType<C, A, O, I>['validate'], encode: RecursiveType<C, A, O, I>['encode'], runDefinition: () => C);
readonly type: C;
get type(): C;
}

@@ -764,2 +767,4 @@ /**

/**
* Use `type` instead
* @deprecated
* @since 1.0.0

@@ -766,0 +771,0 @@ */

@@ -27,2 +27,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/**
* @since 1.0.0
*/
var Either_1 = require("fp-ts/lib/Either");

@@ -820,16 +823,26 @@ var map = Either_1.either.map;

var mergeAll = function (base, us) {
var r = base;
for (var i = 0; i < us.length; i++) {
var u = us[i];
var equal = true;
var primitive = true;
for (var _i = 0, us_1 = us; _i < us_1.length; _i++) {
var u = us_1[_i];
if (u !== base) {
// `u` contains a prismatic value or is the result of a stripping combinator
if (r === base) {
r = Object.assign({}, u);
continue;
equal = false;
}
if (isObject(u)) {
primitive = false;
}
}
if (equal) {
return base;
}
else if (primitive) {
return us[us.length - 1];
}
var r = {};
for (var _a = 0, us_2 = us; _a < us_2.length; _a++) {
var u = us_2[_a];
for (var k in u) {
if (u[k] !== base[k] || !r.hasOwnProperty(k)) {
r[k] = u[k];
}
for (var k in u) {
if (u[k] !== base[k] || !r.hasOwnProperty(k)) {
r[k] = u[k];
}
}
}

@@ -858,3 +871,7 @@ }

return errors.length > 0 ? exports.failures(errors) : exports.success(mergeAll(u, us));
}, codecs.length === 0 ? exports.identity : function (a) { return mergeAll(a, codecs.map(function (codec) { return codec.encode(a); })); }, codecs);
}, codecs.length === 0
? exports.identity
: function (a) {
return mergeAll(a, codecs.map(function (codec) { return codec.encode(a); }));
}, codecs);
}

@@ -861,0 +878,0 @@ exports.intersection = intersection;

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

/**
* @since 1.0.0
*/
import { Reporter } from './Reporter';

@@ -2,0 +5,0 @@ import { ValidationError } from '.';

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

/**
* @since 1.0.0
*/
import { Validation } from './index';

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

/**
* @deprecated
* @since 1.0.0
*/

@@ -4,0 +5,0 @@ import { Reporter } from './Reporter';

{
"name": "io-ts",
"version": "2.0.1",
"version": "2.0.2",
"description": "TypeScript compatible runtime type system for IO validation",

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

"benchmark": "2.1.4",
"docs-ts": "^0.2.1",
"docs-ts": "^0.3.0",
"doctoc": "^1.4.0",

@@ -54,3 +54,3 @@ "dtslint": "github:gcanti/dtslint",

"mocha": "^5.2.0",
"prettier": "^1.15.3",
"prettier": "^1.19.1",
"rimraf": "2.6.2",

@@ -61,3 +61,3 @@ "ts-jest": "^24.0.2",

"tslint-config-standard": "^8.0.1",
"typescript": "^3.5.2"
"typescript": "^3.7.2"
},

@@ -64,0 +64,0 @@ "tags": [

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

io-ts
- [graphql-to-io-ts](https://github.com/micimize/graphql-to-io-ts) - Generate typescript and cooresponding io-ts types from a graphql
- [graphql-to-io-ts](https://github.com/micimize/graphql-to-io-ts) - Generate typescript and corresponding io-ts types from a graphql
schema

@@ -557,0 +557,0 @@ - [io-ts-promise](https://github.com/aeirola/io-ts-promise) - Convenience library for using io-ts with promise-based APIs

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