Skip to content

Conversation

@richardgarnier
Copy link

📝 Description

When looking at BaseValidator, the constructor accepts the name of the param to use for validation.
This was not reflected in the .d.ts

🎯 Relevant issues

I did not open any issue for this.

💎 Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

🚦 How Has This Been Tested?

In the current version, this has a TS error.
With the fix, the TS error is gone

class MyValidator extends Validators.Base {
  constructor() {
    super({ paramName: 'schema' });
  }
  
  [...]
}

🏁 Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have commented my code, particularly in hard-to-understand areas

@richardgarnier
Copy link
Author

I'd like to add that the return of compile being simply Function is also not very helpful.
I'll make another PR to fix it, if it is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant