Comparing version 0.9.0-dev.20171113 to 0.9.0-dev.20171117
@@ -35,4 +35,4 @@ import { Either } from 'fp-ts/lib/Either'; | ||
readonly serialize: Serialize<S, A>; | ||
readonly _A: A; | ||
readonly _S: S; | ||
readonly '_A': A; | ||
readonly '_S': S; | ||
constructor(name: string, is: Is<A>, validate: Validate<S, A>, serialize: Serialize<S, A>); | ||
@@ -107,3 +107,3 @@ pipe<B>(ab: Type<A, B>, name?: string): Type<S, B>; | ||
} | ||
declare const functionType: FunctionType; | ||
export declare const Function: FunctionType; | ||
export declare class RefinementType<RT extends Any> extends Type<InputOf<RT>, TypeOf<RT>> { | ||
@@ -133,8 +133,8 @@ readonly type: RT; | ||
}>(keys: D, name?: string) => KeyofType<D>; | ||
export declare class RecursiveType<T> extends Type<any, T> { | ||
export declare class RecursiveType<A> extends Type<any, A> { | ||
readonly _tag: 'RecursiveType'; | ||
readonly type: Any; | ||
constructor(name: string, is: Is<T>, validate: Validate<any, T>, serialize: Serialize<any, T>); | ||
constructor(name: string, is: Is<A>, validate: Validate<any, A>, serialize: Serialize<any, A>); | ||
} | ||
export declare const recursion: <T>(name: string, definition: (self: Type<any, any>) => Type<any, any>) => RecursiveType<T>; | ||
export declare const recursion: <A>(name: string, definition: (self: Type<any, any>) => Type<any, any>) => RecursiveType<A>; | ||
export declare class ArrayType<RT extends Any> extends Type<any, Array<TypeOf<RT>>> { | ||
@@ -162,5 +162,2 @@ readonly type: RT; | ||
}; | ||
export declare type PartialPropsOf<P extends Props> = { | ||
[K in keyof P]: UnionType<[P[K], UndefinedType]>; | ||
}; | ||
export declare class PartialType<P extends Props> extends Type<any, PartialOf<P>> { | ||
@@ -175,5 +172,6 @@ readonly props: P; | ||
}> { | ||
readonly domain: D; | ||
readonly codomain: C; | ||
readonly _tag: 'DictionaryType'; | ||
constructor(name: string, is: DictionaryType<D, C>['is'], validate: DictionaryType<D, C>['validate'], serialize: DictionaryType<D, C>['serialize'], codomain: C); | ||
constructor(name: string, is: DictionaryType<D, C>['is'], validate: DictionaryType<D, C>['validate'], serialize: DictionaryType<D, C>['serialize'], domain: D, codomain: C); | ||
} | ||
@@ -225,3 +223,3 @@ export declare const dictionary: <D extends Type<any, any>, C extends Type<any, any>>(domain: D, codomain: C, name?: string) => DictionaryType<D, C>; | ||
/** Specifies that only the given interface properties are allowed */ | ||
export declare function strict<P extends Props>(props: P, name?: string): StrictType<P>; | ||
export { nullType as null, undefinedType as undefined, arrayType as Array, functionType as Function, type as interface }; | ||
export declare const strict: <P extends Props>(props: P, name?: string) => StrictType<P>; | ||
export { nullType as null, undefinedType as undefined, arrayType as Array, type as interface }; |
@@ -184,4 +184,3 @@ "use strict"; | ||
exports.FunctionType = FunctionType; | ||
var functionType = new FunctionType(); | ||
exports.Function = functionType; | ||
exports.Function = new FunctionType(); | ||
// | ||
@@ -400,4 +399,5 @@ // refinements | ||
__extends(DictionaryType, _super); | ||
function DictionaryType(name, is, validate, serialize, codomain) { | ||
function DictionaryType(name, is, validate, serialize, domain, codomain) { | ||
var _this = _super.call(this, name, is, validate, serialize) || this; | ||
_this.domain = domain; | ||
_this.codomain = codomain; | ||
@@ -445,3 +445,3 @@ _this._tag = 'DictionaryType'; | ||
return s; | ||
}, codomain); | ||
}, domain, codomain); | ||
}; | ||
@@ -575,3 +575,3 @@ // | ||
// | ||
// readonly | ||
// readonly objects | ||
// | ||
@@ -601,3 +601,3 @@ var ReadonlyType = /** @class */ (function (_super) { | ||
// | ||
// readonlyArray | ||
// readonly arrays | ||
// | ||
@@ -629,2 +629,5 @@ var ReadonlyArrayType = /** @class */ (function (_super) { | ||
}; | ||
// | ||
// strict interfaces | ||
// | ||
var StrictType = /** @class */ (function (_super) { | ||
@@ -642,3 +645,3 @@ __extends(StrictType, _super); | ||
/** Specifies that only the given interface properties are allowed */ | ||
function strict(props, name) { | ||
exports.strict = function (props, name) { | ||
if (name === void 0) { name = "StrictType<" + getNameFromProps(props) + ">"; } | ||
@@ -665,4 +668,3 @@ var loose = exports.type(props); | ||
}, loose.serialize, props); | ||
} | ||
exports.strict = strict; | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "io-ts", | ||
"version": "0.9.0-dev.20171113", | ||
"version": "0.9.0-dev.20171117", | ||
"description": "TypeScript compatible runtime type system for IO validation", | ||
@@ -13,5 +13,7 @@ "files": ["lib"], | ||
"prettier": "prettier --no-semi --single-quote --print-width 120 --parser typescript --list-different \"{src,test}/**/*.ts\"", | ||
"flow-copy-definition-files": "cp src/*.js.flow lib", | ||
"flow-test": "flow status", | ||
"test": "npm run prettier && npm run lint && npm run typings-checker && npm run mocha", | ||
"clean": "rm -rf lib/*", | ||
"build": "npm run clean && tsc" | ||
"build": "npm run clean && tsc && npm run flow-copy-definition-files" | ||
}, | ||
@@ -18,0 +20,0 @@ "repository": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
96422
20
0