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 number validator #10

Merged
merged 6 commits into from
Oct 18, 2017
Merged

Add number validator #10

merged 6 commits into from
Oct 18, 2017

Conversation

SamVerschueren
Copy link
Collaborator

Feel free to suggest other wording for the inline documentation or error messages.

@SamVerschueren
Copy link
Collaborator Author

Just realised I maybe should've used is for some validates. Will have a look later today.

@SamVerschueren SamVerschueren mentioned this pull request Oct 17, 2017
87 tasks
@SamVerschueren
Copy link
Collaborator Author

SamVerschueren commented Oct 17, 2017

Updated is and used the already available validators. The next version will bring even more built-ins.

Should we also add a infinite validator?

@sindresorhus
Copy link
Owner

sindresorhus commented Oct 18, 2017

Should we also add a infinite validator?

Yeah. It's not useful now, but could be useful when we add the .not modifier: ow.number.not.infinite.equal(10)

@SamVerschueren
Copy link
Collaborator Author

👌

source/ow.ts Outdated
// TODO: Modify the stack output to show the original `ow()` call instead of this `throw` statement
throw new ArgumentError(message(value), ow);
}
const m = (value: any, predicate: Predicate) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the name m here. Can't use ow because it is used at the bottom.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main?

@SamVerschueren
Copy link
Collaborator Author

Made some changes apart from the number validators. Should I extract them to a different commit to keep the focus of this PR on the number validators?

@sindresorhus
Copy link
Owner

Should I extract them to a different commit to keep the focus of this PR on the number validators?

Yeah, you can just commit those tweaks directly to master.

@SamVerschueren
Copy link
Collaborator Author

Pushed the generic changes to master and rebased. Also used main instead of m. Thanks for the suggestion :).

@sindresorhus sindresorhus merged commit b330b58 into master Oct 18, 2017
@sindresorhus sindresorhus deleted the number-validator branch October 18, 2017 16:57
@sindresorhus
Copy link
Owner

Super good :)

@SamVerschueren
Copy link
Collaborator Author

Sweet :)! 🍻

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.

2 participants