Skip to content

Commit

Permalink
Merge pull request #126 from nobrainr/fix/expose-validator-error
Browse files Browse the repository at this point in the history
fix: expose ValidatorError instead of ValidationError
  • Loading branch information
emyann authored Sep 1, 2019
2 parents 8dd3889 + 9c92b5e commit ef1ceca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
5 changes: 2 additions & 3 deletions src/morphism.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import Morphism, {
SchemaOptions,
SCHEMA_OPTIONS_SYMBOL,
reporter,
Validation,
ValidationError
Validation
} from './morphism';
import { User, MockData } from './utils-test';
import { ActionSelector, ActionAggregator } from './types';
import { defaultFormatter } from './validation/reporter';
import { defaultFormatter, ValidationError } from './validation/reporter';

describe('Morphism', () => {
const dataToCrunch: MockData[] = [
Expand Down
12 changes: 3 additions & 9 deletions src/morphism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@ import { Schema, StrictSchema, Constructable, SourceFromSchema, Mapper, Destinat
import { MorphismSchemaTree, createSchema, SchemaOptions } from './MorphismTree';
import { MorphismRegistry, IMorphismRegistry } from './MorphismRegistry';
import { decorator } from './MorphismDecorator';
import {
Reporter,
reporter as defaultReporter,
Formatter,
targetHasErrors,
ValidationErrors,
ValidationError
} from './validation/reporter';
import { Reporter, reporter as defaultReporter, Formatter, targetHasErrors, ValidationErrors } from './validation/reporter';
import { BaseValidator, Rule, Validation } from './validation/Validation';
import { ValidatorError } from './validation/validators/ValidatorError';

/**
* Low Level transformer function.
Expand Down Expand Up @@ -258,6 +252,6 @@ export {
Validation,
BaseValidator,
Rule,
ValidationError
ValidatorError
};
export default Morphism;
3 changes: 1 addition & 2 deletions src/validation/Validation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { BaseValidator, Rule, Validation } from './Validation';
import { createSchema } from '../MorphismTree';
import { morphism, reporter } from '../morphism';
import { morphism, reporter, ValidatorError } from '../morphism';
import { ValidationError, defaultFormatter } from './reporter';
import { ValidatorError } from './validators/ValidatorError';

declare module './Validation' {
interface IValidation {
Expand Down

0 comments on commit ef1ceca

Please sign in to comment.