Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: split(...).every is not a function #166

Merged
merged 2 commits into from Feb 2, 2020

Conversation

havelaer
Copy link
Contributor

Description

If you validate invalid data with a schema like v8n().every.schema(...), you get a validation error which is actually triggered by a type error (split(...).every is not a function). This results in a malformed validation error.

The issue is fixed by type checking the value before splitting it. Not sure if this is the correct solution, because I don't really understand what's happening here at Rule.js#L29, the source of the issue.

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)
  • Other (please, feel free to specify what kind of change it is)

Checklist:

  • I have created my branch from a recent version of master
  • The code is clean and easy to understand
  • I have written tests to guarantee that everything is working properly
  • I have made corresponding changes to the documentation
  • I have added changes to the Unreleased section of the CHANGELOG

@imbrn
Copy link
Owner

imbrn commented Nov 2, 2019

Oh, great work, man! Could you update the CHANGELOG file with this change?

@imbrn imbrn merged commit 9552870 into imbrn:master Feb 2, 2020
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.

None yet

2 participants