Comparing version 3.3.2 to 3.4.0
@@ -74,2 +74,5 @@ export declare type BoundCoercionFn = () => BoundCoercionFn; | ||
}) => StrictValidator<unknown, ToOptional<{ [P_1 in keyof T]: InferType<T[P_1]>; } & DeriveIndexUnlessNull<UnknownValidator>>>; | ||
export declare const isPartial: <T extends { [P in keyof T]: StrictValidator<any, any>; }>(props: T) => StrictValidator<unknown, ToOptional<{ [P_1 in keyof T]: InferType<T[P_1]>; } & { | ||
[k: string]: unknown; | ||
}>>; | ||
export declare const isInstanceOf: <T extends new (...args: any) => InstanceType<T>>(constructor: T) => StrictValidator<unknown, InstanceType<T>>; | ||
@@ -76,0 +79,0 @@ export declare const isOneOf: <T extends StrictValidator<any, any>>(specs: readonly T[], { exclusive, }?: { |
@@ -69,3 +69,3 @@ 'use strict'; | ||
if (value !== expected) | ||
return pushError(state, `Expected a literal (got ${getPrintable(expected)})`); | ||
return pushError(state, `Expected a literal (got ${getPrintable(value)})`); | ||
return true; | ||
@@ -318,2 +318,5 @@ }, | ||
}; | ||
const isPartial = (props) => { | ||
return isObject(props, { extra: isDict(isUnknown()) }); | ||
}; | ||
const isInstanceOf = (constructor) => makeValidator({ | ||
@@ -534,3 +537,3 @@ test: (value, state) => { | ||
return pushError(state, `Expected to be a valid ISO 8601 date string (got ${getPrintable(value)})`); | ||
return false; | ||
return true; | ||
}, | ||
@@ -683,2 +686,3 @@ }); | ||
exports.isOptional = isOptional; | ||
exports.isPartial = isPartial; | ||
exports.isPositive = isPositive; | ||
@@ -685,0 +689,0 @@ exports.isString = isString; |
{ | ||
"name": "typanion", | ||
"version": "3.3.2", | ||
"version": "3.4.0", | ||
"main": "lib/index", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
68754
1483