Comparing version 1.1.5 to 1.2.0
@@ -16,2 +16,7 @@ # Changelog | ||
# 1.2.0 | ||
- **New Feature** | ||
- add `void` runtime type (@gcanti) | ||
# 1.1.5 | ||
@@ -18,0 +23,0 @@ |
@@ -10,3 +10,3 @@ import { Either } from 'fp-ts/lib/Either'; | ||
[key: string]: any; | ||
} | object | number | string | boolean | symbol | undefined | null; | ||
} | object | number | string | boolean | symbol | undefined | null | void; | ||
export interface ContextEntry { | ||
@@ -87,2 +87,8 @@ readonly key: string; | ||
declare const undefinedType: UndefinedType; | ||
export declare class VoidType extends Type<void> { | ||
readonly _tag: 'VoidType'; | ||
constructor(); | ||
} | ||
/** @alias `void` */ | ||
export declare const voidType: VoidType; | ||
export declare class AnyType extends Type<any> { | ||
@@ -311,2 +317,2 @@ readonly _tag: 'AnyType'; | ||
export declare function alias<A, O, P, I>(type: InterfaceType<P, A, O, I>): <AA extends Exact<A, AA>, OO extends Exact<O, OO> = O, PP extends Exact<P, PP> = P, II extends I = I>() => InterfaceType<PP, AA, OO, II>; | ||
export { nullType as null, undefinedType as undefined, arrayType as Array, type as interface }; | ||
export { nullType as null, undefinedType as undefined, arrayType as Array, type as interface, voidType as void }; |
@@ -117,2 +117,15 @@ "use strict"; | ||
exports.undefined = undefinedType; | ||
var VoidType = /** @class */ (function (_super) { | ||
__extends(VoidType, _super); | ||
function VoidType() { | ||
var _this = _super.call(this, 'void', undefinedType.is, undefinedType.validate, exports.identity) || this; | ||
_this._tag = 'VoidType'; | ||
return _this; | ||
} | ||
return VoidType; | ||
}(Type)); | ||
exports.VoidType = VoidType; | ||
/** @alias `void` */ | ||
exports.voidType = new VoidType(); | ||
exports.void = exports.voidType; | ||
var AnyType = /** @class */ (function (_super) { | ||
@@ -119,0 +132,0 @@ __extends(AnyType, _super); |
{ | ||
"name": "io-ts", | ||
"version": "1.1.5", | ||
"version": "1.2.0", | ||
"description": "TypeScript compatible runtime type system for IO validation", | ||
@@ -46,3 +46,3 @@ "files": [ | ||
"tslint-config-standard": "7.0.0", | ||
"typescript": "2.9.1" | ||
"typescript": "^2.9.2" | ||
}, | ||
@@ -49,0 +49,0 @@ "tags": [ |
@@ -49,2 +49,3 @@ [![build status](https://img.shields.io/travis/gcanti/io-ts/master.svg?style=flat-square)](https://travis-ci.org/gcanti/io-ts) | ||
// runtime type definition | ||
export class StringType extends t.Type<string> { | ||
@@ -62,2 +63,5 @@ // equivalent to Type<string, string, mixed> as per type parameter defaults | ||
} | ||
// runtime type instance: use this when building other runtime types instances | ||
export const string = new StringType() | ||
``` | ||
@@ -82,3 +86,3 @@ | ||
The stable version is tested against TypeScript 2.7.x+ | ||
The stable version is tested against TypeScript 2.9.x+ | ||
@@ -160,2 +164,3 @@ # Error reporters | ||
| undefined | `undefined` | `t.undefined` | | ||
| void | `void` | `t.void` or `t.voidType` | | ||
| string | `string` | `t.string` | | ||
@@ -162,0 +167,0 @@ | number | `number` | `t.number` | |
Sorry, the diff of this file is not supported yet
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
114585
1317
470