From d5c539162c2d589d36fe4acc3bdebbf486e21526 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Fri, 4 Dec 2020 09:14:52 -0500 Subject: [PATCH] fix: cyclical import fixes #1138 --- src/schema.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/schema.ts b/src/schema.ts index ed1fa16a7..69f50caca 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -24,7 +24,7 @@ import { AnyObject, } from './types'; -import { ValidationError } from '.'; +import ValidationError from './ValidationError'; import type { Asserts } from './util/types'; import ReferenceSet from './util/ReferenceSet'; import Reference from './Reference'; @@ -106,7 +106,7 @@ export default abstract class BaseSchema< readonly deps: readonly string[] = []; tests: Test[]; - transforms: TransformFunction[]; + transforms: TransformFunction[]; private conditions: Condition[] = []; @@ -332,7 +332,7 @@ export default abstract class BaseSchema< return result; } - protected _cast(rawValue: any, _options: CastOptions) { + protected _cast(rawValue: any, _options: CastOptions): any { let value = rawValue === undefined ? rawValue @@ -553,7 +553,7 @@ export default abstract class BaseSchema< transform(fn: TransformFunction) { var next = this.clone(); - next.transforms.push(fn); + next.transforms.push(fn as TransformFunction); return next; } @@ -645,7 +645,7 @@ export default abstract class BaseSchema< if (dep.isSibling) next.deps.push(dep.key); }); - next.conditions.push(new Condition(deps, options!)); + next.conditions.push(new Condition(deps, options!) as Condition); return next; }