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.2.4 to 2.2.5

7

CHANGELOG.md

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

# 2.2.5
- **Experimental**
- fix type information lost from nested decoder types, #479 (@gcanti)
- `JsonEncoder`
- change `id` signature (@gcanti)
# 2.2.4

@@ -19,0 +26,0 @@

2

es6/Codec.js

@@ -90,2 +90,4 @@ import * as D from './Decoder';

export function partial(properties) {
// these tow `any`s are required to make typescript@3.5 compile
// vvvvvv vvvvvv
return make(D.partial(properties), E.partial(properties));

@@ -92,0 +94,0 @@ }

8

es6/Decoder.d.ts

@@ -99,3 +99,5 @@ /**

[K in keyof A]: Decoder<A[K]>;
}): Decoder<A>;
}): Decoder<{
[K in keyof A]: A[K];
}>;
/**

@@ -106,3 +108,5 @@ * @since 2.2.0

[K in keyof A]: Decoder<A[K]>;
}): Decoder<Partial<A>>;
}): Decoder<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -109,0 +113,0 @@ * @since 2.2.0

@@ -41,3 +41,5 @@ import * as E from 'fp-ts/es6/Eq';

[K in keyof A]: Eq<A[K]>;
}) => Eq<A>;
}) => Eq<{
[K in keyof A]: A[K];
}>;
/**

@@ -48,3 +50,5 @@ * @since 2.2.2

[K in keyof A]: Eq<A[K]>;
}): Eq<Partial<A>>;
}): Eq<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -51,0 +55,0 @@ * @since 2.2.2

@@ -56,3 +56,5 @@ /**

[K in keyof A]: Guard<A[K]>;
}): Guard<A>;
}): Guard<{
[K in keyof A]: A[K];
}>;
/**

@@ -63,3 +65,5 @@ * @since 2.2.0

[K in keyof A]: Guard<A[K]>;
}): Guard<Partial<A>>;
}): Guard<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -66,0 +70,0 @@ * @since 2.2.0

@@ -60,3 +60,5 @@ /**

[K in keyof A]: JsonCodec<A[K]>;
}) => JsonCodec<A>;
}) => JsonCodec<{
[K in keyof A]: A[K];
}>;
/**

@@ -67,3 +69,5 @@ * @since 2.2.3

[K in keyof A]: JsonCodec<A[K]>;
}) => JsonCodec<Partial<A>>;
}) => JsonCodec<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -70,0 +74,0 @@ * @since 2.2.3

@@ -33,5 +33,5 @@ /**

/**
* @since 2.2.3
* @since 2.2.5
*/
export declare const id: JsonEncoder<Json>;
export declare function id<A extends Json>(): JsonEncoder<A>;
/**

@@ -46,3 +46,5 @@ * @since 2.2.3

[K in keyof A]: JsonEncoder<A[K]>;
}) => JsonEncoder<A>;
}) => JsonEncoder<{
[K in keyof A]: A[K];
}>;
/**

@@ -53,3 +55,5 @@ * @since 2.2.3

[K in keyof A]: JsonEncoder<A[K]>;
}) => JsonEncoder<Partial<A>>;
}) => JsonEncoder<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -56,0 +60,0 @@ * @since 2.2.3

@@ -7,7 +7,9 @@ import { identity } from 'fp-ts/es6/function';

/**
* @since 2.2.3
* @since 2.2.5
*/
export var id = {
encode: identity
};
export function id() {
return {
encode: identity
};
}
// -------------------------------------------------------------------------------------

@@ -78,6 +80,6 @@ // combinators

URI: URI,
literal: function () { return id; },
string: id,
number: id,
boolean: id,
literal: function () { return id(); },
string: id(),
number: id(),
boolean: id(),
nullable: nullable,

@@ -84,0 +86,0 @@ type: type,

@@ -21,6 +21,10 @@ /**

[K in keyof A]: HKT<S, A[K]>;
}) => HKT<S, A>;
}) => HKT<S, {
[K in keyof A]: A[K];
}>;
readonly partial: <A>(properties: {
[K in keyof A]: HKT<S, A[K]>;
}) => HKT<S, Partial<A>>;
}) => HKT<S, Partial<{
[K in keyof A]: A[K];
}>>;
readonly record: <A>(codomain: HKT<S, A>) => HKT<S, Record<string, A>>;

@@ -49,6 +53,10 @@ readonly array: <A>(items: HKT<S, A>) => HKT<S, Array<A>>;

[K in keyof A]: Kind<S, A[K]>;
}) => Kind<S, A>;
}) => Kind<S, {
[K in keyof A]: A[K];
}>;
readonly partial: <A>(properties: {
[K in keyof A]: Kind<S, A[K]>;
}) => Kind<S, Partial<A>>;
}) => Kind<S, Partial<{
[K in keyof A]: A[K];
}>>;
readonly record: <A>(codomain: Kind<S, A>) => Kind<S, Record<string, A>>;

@@ -55,0 +63,0 @@ readonly array: <A>(items: Kind<S, A>) => Kind<S, Array<A>>;

@@ -48,3 +48,5 @@ /**

[K in keyof A]: Type<A[K]>;
}): Type<A>;
}): Type<{
[K in keyof A]: A[K];
}>;
/**

@@ -55,3 +57,5 @@ * @since 2.2.3

[K in keyof A]: Type<A[K]>;
}): Type<Partial<A>>;
}): Type<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -58,0 +62,0 @@ * @since 2.2.3

@@ -100,2 +100,4 @@ "use strict";

function partial(properties) {
// these tow `any`s are required to make typescript@3.5 compile
// vvvvvv vvvvvv
return make(D.partial(properties), E.partial(properties));

@@ -102,0 +104,0 @@ }

@@ -99,3 +99,5 @@ /**

[K in keyof A]: Decoder<A[K]>;
}): Decoder<A>;
}): Decoder<{
[K in keyof A]: A[K];
}>;
/**

@@ -106,3 +108,5 @@ * @since 2.2.0

[K in keyof A]: Decoder<A[K]>;
}): Decoder<Partial<A>>;
}): Decoder<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -109,0 +113,0 @@ * @since 2.2.0

@@ -41,3 +41,5 @@ import * as E from 'fp-ts/lib/Eq';

[K in keyof A]: Eq<A[K]>;
}) => Eq<A>;
}) => Eq<{
[K in keyof A]: A[K];
}>;
/**

@@ -48,3 +50,5 @@ * @since 2.2.2

[K in keyof A]: Eq<A[K]>;
}): Eq<Partial<A>>;
}): Eq<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -51,0 +55,0 @@ * @since 2.2.2

@@ -56,3 +56,5 @@ /**

[K in keyof A]: Guard<A[K]>;
}): Guard<A>;
}): Guard<{
[K in keyof A]: A[K];
}>;
/**

@@ -63,3 +65,5 @@ * @since 2.2.0

[K in keyof A]: Guard<A[K]>;
}): Guard<Partial<A>>;
}): Guard<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -66,0 +70,0 @@ * @since 2.2.0

@@ -60,3 +60,5 @@ /**

[K in keyof A]: JsonCodec<A[K]>;
}) => JsonCodec<A>;
}) => JsonCodec<{
[K in keyof A]: A[K];
}>;
/**

@@ -67,3 +69,5 @@ * @since 2.2.3

[K in keyof A]: JsonCodec<A[K]>;
}) => JsonCodec<Partial<A>>;
}) => JsonCodec<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -70,0 +74,0 @@ * @since 2.2.3

@@ -33,5 +33,5 @@ /**

/**
* @since 2.2.3
* @since 2.2.5
*/
export declare const id: JsonEncoder<Json>;
export declare function id<A extends Json>(): JsonEncoder<A>;
/**

@@ -46,3 +46,5 @@ * @since 2.2.3

[K in keyof A]: JsonEncoder<A[K]>;
}) => JsonEncoder<A>;
}) => JsonEncoder<{
[K in keyof A]: A[K];
}>;
/**

@@ -53,3 +55,5 @@ * @since 2.2.3

[K in keyof A]: JsonEncoder<A[K]>;
}) => JsonEncoder<Partial<A>>;
}) => JsonEncoder<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -56,0 +60,0 @@ * @since 2.2.3

@@ -10,7 +10,10 @@ "use strict";

/**
* @since 2.2.3
* @since 2.2.5
*/
exports.id = {
encode: function_1.identity
};
function id() {
return {
encode: function_1.identity
};
}
exports.id = id;
// -------------------------------------------------------------------------------------

@@ -81,6 +84,6 @@ // combinators

URI: exports.URI,
literal: function () { return exports.id; },
string: exports.id,
number: exports.id,
boolean: exports.id,
literal: function () { return id(); },
string: id(),
number: id(),
boolean: id(),
nullable: exports.nullable,

@@ -87,0 +90,0 @@ type: exports.type,

@@ -21,6 +21,10 @@ /**

[K in keyof A]: HKT<S, A[K]>;
}) => HKT<S, A>;
}) => HKT<S, {
[K in keyof A]: A[K];
}>;
readonly partial: <A>(properties: {
[K in keyof A]: HKT<S, A[K]>;
}) => HKT<S, Partial<A>>;
}) => HKT<S, Partial<{
[K in keyof A]: A[K];
}>>;
readonly record: <A>(codomain: HKT<S, A>) => HKT<S, Record<string, A>>;

@@ -49,6 +53,10 @@ readonly array: <A>(items: HKT<S, A>) => HKT<S, Array<A>>;

[K in keyof A]: Kind<S, A[K]>;
}) => Kind<S, A>;
}) => Kind<S, {
[K in keyof A]: A[K];
}>;
readonly partial: <A>(properties: {
[K in keyof A]: Kind<S, A[K]>;
}) => Kind<S, Partial<A>>;
}) => Kind<S, Partial<{
[K in keyof A]: A[K];
}>>;
readonly record: <A>(codomain: Kind<S, A>) => Kind<S, Record<string, A>>;

@@ -55,0 +63,0 @@ readonly array: <A>(items: Kind<S, A>) => Kind<S, Array<A>>;

@@ -48,3 +48,5 @@ /**

[K in keyof A]: Type<A[K]>;
}): Type<A>;
}): Type<{
[K in keyof A]: A[K];
}>;
/**

@@ -55,3 +57,5 @@ * @since 2.2.3

[K in keyof A]: Type<A[K]>;
}): Type<Partial<A>>;
}): Type<Partial<{
[K in keyof A]: A[K];
}>>;
/**

@@ -58,0 +62,0 @@ * @since 2.2.3

{
"name": "io-ts",
"version": "2.2.4",
"version": "2.2.5",
"description": "TypeScript runtime type system for IO decoding/encoding",

@@ -5,0 +5,0 @@ "files": [

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