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.3.4 to 1.4.0

5

CHANGELOG.md

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

# 1.4.0
- **New Feature**
- use `unknown` as `mixed` (@gcanti)
# 1.3.4

@@ -18,0 +23,0 @@

32

lib/index.d.ts

@@ -8,5 +8,3 @@ import { Either } from 'fp-ts/lib/Either';

}
export declare type mixed = {
[key: string]: any;
} | object | number | string | boolean | symbol | undefined | null | void;
export declare type mixed = unknown;
export interface ContextEntry {

@@ -74,7 +72,7 @@ readonly key: string;

export declare const getContextEntry: (key: string, type: Decoder<any, any>) => ContextEntry;
export declare const getValidationError: (value: mixed, context: Context) => ValidationError;
export declare const getValidationError: (value: unknown, context: Context) => ValidationError;
export declare const getDefaultContext: (type: Decoder<any, any>) => Context;
export declare const appendContext: (c: Context, key: string, type: Decoder<any, any>) => Context;
export declare const failures: <T>(errors: Errors) => Either<Errors, T>;
export declare const failure: <T>(value: mixed, context: Context) => Either<Errors, T>;
export declare const failure: <T>(value: unknown, context: Context) => Either<Errors, T>;
export declare const success: <T>(value: T) => Either<Errors, T>;

@@ -152,3 +150,3 @@ export declare class NullType extends Type<null> {

export declare const refinement: <RT extends Any>(type: RT, predicate: Predicate<RT["_A"]>, name?: string) => RefinementType<RT, RT["_A"], RT["_O"], RT["_I"]>;
export declare const Integer: RefinementType<NumberType, number, number, mixed>;
export declare const Integer: RefinementType<NumberType, number, number, unknown>;
export declare class LiteralType<V extends string | number | boolean> extends Type<V> {

@@ -168,3 +166,3 @@ readonly value: V;

export declare const keyof: <D extends {
[key: string]: mixed;
[key: string]: unknown;
}>(keys: D, name?: string) => KeyofType<D>;

@@ -177,3 +175,3 @@ export declare class RecursiveType<RT extends Any, A = any, O = A, I = mixed> extends Type<A, O, I> {

}
export declare const recursion: <A, O = A, I = mixed, RT extends Type<A, O, I> = Type<A, O, I>>(name: string, definition: (self: RT) => RT) => RecursiveType<RT, A, O, I>;
export declare const recursion: <A, O = A, I = unknown, RT extends Type<A, O, I> = Type<A, O, I>>(name: string, definition: (self: RT) => RT) => RecursiveType<RT, A, O, I>;
export declare class ArrayType<RT extends Any, A = any, O = A, I = mixed> extends Type<A, O, I> {

@@ -184,3 +182,3 @@ readonly type: RT;

}
export declare const array: <RT extends Mixed>(type: RT, name?: string) => ArrayType<RT, RT["_A"][], RT["_O"][], mixed>;
export declare const array: <RT extends Mixed>(type: RT, name?: string) => ArrayType<RT, RT["_A"][], RT["_O"][], unknown>;
export declare class InterfaceType<P, A = any, O = A, I = mixed> extends Type<A, O, I> {

@@ -204,3 +202,3 @@ readonly props: P;

/** @alias `interface` */
export declare const type: <P extends Props>(props: P, name?: string) => InterfaceType<P, TypeOfProps<P>, OutputOfProps<P>, mixed>;
export declare const type: <P extends Props>(props: P, name?: string) => InterfaceType<P, TypeOfProps<P>, OutputOfProps<P>, unknown>;
export declare class PartialType<P, A = any, O = A, I = mixed> extends Type<A, O, I> {

@@ -217,3 +215,3 @@ readonly props: P;

};
export declare const partial: <P extends Props>(props: P, name?: string) => PartialType<P, TypeOfPartialProps<P>, OutputOfPartialProps<P>, mixed>;
export declare const partial: <P extends Props>(props: P, name?: string) => PartialType<P, TypeOfPartialProps<P>, OutputOfPartialProps<P>, unknown>;
export declare class DictionaryType<D extends Any, C extends Any, A = any, O = A, I = mixed> extends Type<A, O, I> {

@@ -231,3 +229,3 @@ readonly domain: D;

};
export declare const dictionary: <D extends Mixed, C extends Mixed>(domain: D, codomain: C, name?: string) => DictionaryType<D, C, TypeOfDictionary<D, C>, OutputOfDictionary<D, C>, mixed>;
export declare const dictionary: <D extends Mixed, C extends Mixed>(domain: D, codomain: C, name?: string) => DictionaryType<D, C, TypeOfDictionary<D, C>, OutputOfDictionary<D, C>, unknown>;
export declare class UnionType<RTS extends Array<Any>, A = any, O = A, I = mixed> extends Type<A, O, I> {

@@ -238,3 +236,3 @@ readonly types: RTS;

}
export declare const union: <RTS extends Mixed[]>(types: RTS, name?: string) => UnionType<RTS, RTS["_A"]["_A"], RTS["_A"]["_O"], mixed>;
export declare const union: <RTS extends Mixed[]>(types: RTS, name?: string) => UnionType<RTS, RTS["_A"]["_A"], RTS["_A"]["_O"], unknown>;
export declare class IntersectionType<RTS extends Array<Any>, A = any, O = A, I = mixed> extends Type<A, O, I> {

@@ -265,3 +263,3 @@ readonly types: RTS;

}
export declare const readonly: <RT extends Mixed>(type: RT, name?: string) => ReadonlyType<RT, Readonly<RT["_A"]>, Readonly<RT["_O"]>, mixed>;
export declare const readonly: <RT extends Mixed>(type: RT, name?: string) => ReadonlyType<RT, Readonly<RT["_A"]>, Readonly<RT["_O"]>, unknown>;
export declare class ReadonlyArrayType<RT extends Any, A = any, O = A, I = mixed> extends Type<A, O, I> {

@@ -272,3 +270,3 @@ readonly type: RT;

}
export declare const readonlyArray: <RT extends Mixed>(type: RT, name?: string) => ReadonlyArrayType<RT, ReadonlyArray<RT["_A"]>, ReadonlyArray<RT["_O"]>, mixed>;
export declare const readonlyArray: <RT extends Mixed>(type: RT, name?: string) => ReadonlyArrayType<RT, ReadonlyArray<RT["_A"]>, ReadonlyArray<RT["_O"]>, unknown>;
export declare class StrictType<P, A = any, O = A, I = mixed> extends Type<A, O, I> {

@@ -283,3 +281,3 @@ readonly props: P;

*/
export declare const strict: <P extends Props>(props: P, name?: string) => StrictType<P, TypeOfProps<P>, OutputOfProps<P>, mixed>;
export declare const strict: <P extends Props>(props: P, name?: string) => StrictType<P, TypeOfProps<P>, OutputOfProps<P>, unknown>;
export declare type TaggedProps<Tag extends string> = {

@@ -304,3 +302,3 @@ [K in Tag]: LiteralType<any>;

}
export declare const taggedUnion: <Tag extends string, RTS extends Tagged<Tag, any, any>[]>(tag: Tag, types: RTS, name?: string) => TaggedUnionType<Tag, RTS, RTS["_A"]["_A"], RTS["_A"]["_O"], mixed>;
export declare const taggedUnion: <Tag extends string, RTS extends Tagged<Tag, any, any>[]>(tag: Tag, types: RTS, name?: string) => TaggedUnionType<Tag, RTS, RTS["_A"]["_A"], RTS["_A"]["_O"], unknown>;
export declare class ExactType<RT extends Any, A = any, O = A, I = mixed> extends Type<A, O, I> {

@@ -307,0 +305,0 @@ readonly type: RT;

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

@@ -37,13 +37,13 @@ "files": [

"@types/benchmark": "1.0.31",
"@types/jest": "22.2.2",
"@types/jest": "^23.3.8",
"@types/node": "7.0.4",
"benchmark": "2.1.4",
"dtslint": "0.3.0",
"jest": "22.4.3",
"jest": "^23.6.0",
"prettier": "1.13.4",
"rimraf": "2.6.2",
"ts-jest": "22.4.2",
"tslint": "5.9.1",
"tslint-config-standard": "7.0.0",
"typescript": "^3.1.3"
"ts-jest": "^23.10.4",
"tslint": "^5.11.0",
"tslint-config-standard": "^8.0.1",
"typescript": "^3.1.4"
},

@@ -65,7 +65,2 @@ "tags": [

"jest": {
"globals": {
"ts-jest": {
"skipBabel": true
}
},
"collectCoverage": true,

@@ -72,0 +67,0 @@ "transform": {

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

The stable version is tested against TypeScript 3.1.1, but should run with TypeScript 2.7.2+ too
The stable version is tested against TypeScript 3.1.4, but should run with TypeScript 2.7.2+ too

@@ -87,0 +87,0 @@ # Error reporters

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