Skip to content

Commit

Permalink
fix: typescript declarations (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Nov 28, 2019
1 parent 6c6973b commit 89d55a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion declarations/validate.d.ts
Expand Up @@ -36,6 +36,8 @@ declare function validate(
configuration?: ValidationErrorConfiguration | undefined
): void;
declare namespace validate {
export { _default as ValidationError, _default as ValidateError };
export { ValidationError };
export { ValidationError as ValidateError };
}
import Ajv from 'ajv';
import ValidationError from './ValidationError';
5 changes: 0 additions & 5 deletions src/index.js
@@ -1,8 +1,3 @@
const validate = require('./validate');
const ValidationError = require('./ValidationError');

module.exports = validate.default;
module.exports.ValidationError = ValidationError.default;

// Todo remove this in next major release
module.exports.ValidateError = ValidationError.default;
4 changes: 4 additions & 0 deletions src/validate.js
Expand Up @@ -140,4 +140,8 @@ function filterErrors(errors) {
return newErrors;
}

// TODO change after resolve https://github.com/microsoft/TypeScript/issues/34994
validate.ValidationError = ValidationError;
validate.ValidateError = ValidationError;

export default validate;

0 comments on commit 89d55a9

Please sign in to comment.