-
Notifications
You must be signed in to change notification settings - Fork 14
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
Validate Function #27
Conversation
Employer needed a function for verification of "pretty". This commit includes a bug fix I did, so 2.1.1 instead of just 2.1.0.
2 similar comments
Hi @djayard If you want to try it (not for production): |
1 similar comment
The previous example in the readme didn't work since nothing was reading the stream. For for 'error' and 'end' events to be fired, something must attempt to read the reporter's stream.
3 similar comments
@biasso |
.pipe(prettify.validate()) | ||
.pipe(prettify.reporter()) | ||
.on('error', function(error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example doesn't work since nothing attempts to read from reporter. Without read attempts, 'error' and 'end' aren't emitted.
Thank you! It seems all right. |
A work requirement led me to write a validate function. We required that checked in code be pretty, and the validate function helps us enforce that policy.
I'm opening the PR since it might be useful to other people.