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

Feature string validators #25

Merged
merged 8 commits into from
Aug 25, 2015
Merged

Feature string validators #25

merged 8 commits into from
Aug 25, 2015

Conversation

flootr
Copy link

@flootr flootr commented Jul 13, 2015

closes #23

@meaku could you please review the code?

Markus Dobmann added 3 commits July 13, 2015 09:23
@flootr
Copy link
Author

flootr commented Jul 22, 2015

Or @jhnns ?

}
});

expect(schema.validators.name).to.be.an("array");
Copy link
Member

Choose a reason for hiding this comment

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

Just a small thing, but I think it should be: expect(schema.validators.name).to.be("array");, because name should not be an array, but it should be the string "array". The test is ok though, it's just for the developer.

Copy link
Member

Choose a reason for hiding this comment

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

Oops, sorry. You're right :)

@jhnns
Copy link
Member

jhnns commented Jul 27, 2015

That's a nice feature, but it should not be restricted to strings. Everything with a length attribute should be validatable.
And could you also add a documentation to the README?

@flootr
Copy link
Author

flootr commented Aug 13, 2015

Actually the minLength | maxLength | hasLength validators can be applied to Arrays as well, but we should change the internal naming then. I will update the docs soon, too.

Markus Dobmann added 5 commits August 25, 2015 11:15
Naming should be general if appropriate
Apply proper operation
Make sure there is an lengthable which could be evaluated
@meaku
Copy link
Member

meaku commented Aug 25, 2015

Nice! That's pretty close to mongoose! Thanks!

meaku added a commit that referenced this pull request Aug 25, 2015
@meaku meaku merged commit 7d43fa8 into master Aug 25, 2015
@meaku
Copy link
Member

meaku commented Aug 25, 2015

Looks good! Thanks!

@jhnns jhnns deleted the feature-string-validators branch May 25, 2016 14:27
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.

min validator string?
3 participants