Comparing version 0.3.1 to 0.4.0
@@ -11,4 +11,5 @@ import * as t from 'io-ts'; | ||
export { enumeration, LoiFactoryEnum } from './types/Enum'; | ||
export { date, LoiFactoryDate } from './types/Date'; | ||
export declare function validate<S, A>(value: S, type: t.Decoder<S, A>): t.Validation<A>; | ||
export declare function ensureSameType<X, Y extends X>(): [X, Y]; | ||
export declare function ensureTypeSame<Y extends X, X>(): [X, Y]; | ||
export declare function ensureTypeSame<X extends Y, Y>(): [X, Y]; |
@@ -29,2 +29,5 @@ "use strict"; | ||
exports.LoiFactoryEnum = Enum_1.LoiFactoryEnum; | ||
var Date_1 = require("./types/Date"); | ||
exports.date = Date_1.date; | ||
exports.LoiFactoryDate = Date_1.LoiFactoryDate; | ||
function validate(value, type) { | ||
@@ -31,0 +34,0 @@ return type.decode(value); |
@@ -10,5 +10,8 @@ "use strict"; | ||
constructor() { | ||
// HACK: [ts] Constructors for derived classes must contain a 'super' call. | ||
super(undefined, undefined, undefined, undefined); | ||
throw new Error('The Loi factory class cannot be constructored.'); | ||
// [ts] Constructors for derived classes must contain a 'super' call. | ||
// [ts] Unreachable code detected. | ||
// @ts-ignore | ||
/* istanbul ignore next */ const pitfall = undefined; | ||
/* istanbul ignore next */ super(pitfall, pitfall, pitfall, pitfall); | ||
} | ||
@@ -15,0 +18,0 @@ } |
@@ -33,2 +33,3 @@ "use strict"; | ||
const nativeObjectToString = objectProto.toString; | ||
/* istanbul ignore next */ | ||
const symToStringTag = Symbol ? Symbol.toStringTag : undefined; | ||
@@ -39,2 +40,3 @@ const nullTag = '[object Null]'; | ||
const stringTag = '[object String]'; | ||
const dateTag = '[object Date]'; | ||
/* istanbul ignore next */ | ||
@@ -94,2 +96,8 @@ function getRawTag(value) { | ||
exports.isString = isString; | ||
/* istanbul ignore next */ | ||
/** @internal */ | ||
function isDate(value) { | ||
return isObjectLike(value) && baseGetTag(value) == dateTag; | ||
} | ||
exports.isDate = isDate; | ||
//# sourceMappingURL=lodash.js.map |
{ | ||
"name": "loi", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "lib" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
98057
53
1330