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

Add public method to Predicate class for customize validate message #156

Closed
wants to merge 4 commits into from
Closed

Add public method to Predicate class for customize validate message #156

wants to merge 4 commits into from

Conversation

Rastopyr
Copy link

@Rastopyr Rastopyr commented Aug 23, 2019

Hi guys,

this PR just add validateMessage method to Predicate class and should fix #122 , so it could be used in all cases of predicates:

// Chain from any predicate instance
ow.unicorn.validateMessage('We wait all unicorns')

// Chain from any predicate rule(because it the same predicate instance)
ow.unicorn.withRainbow.validateMessage('We wait all unicorns')

this method not affect any current features and not fail any test. It just extend predicate class.

P.S.:
I'm not sure that validateMessage is good name for this method, but message method already defined in some Predicate classes(error for example).


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


IssueHunt has been backed by the following sponsors. Become a sponsor

@Rastopyr
Copy link
Author

@sindresorhus linter is failing, but i'm pull it from last master. should i fix linter?

Jblew added a commit to Jblew/ow that referenced this pull request Aug 24, 2019
@Rastopyr
Copy link
Author

But this PR still have a problem, predicates heritable from BasePredicate class not support this feature

@sindresorhus
Copy link
Owner

@Rastopyr Did you have a chance to look more into the problem?

@sindresorhus
Copy link
Owner

@Rastopyr Bump :)

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.

Custom error message
2 participants