Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Alias 'presence' validator as 'required' #147

Closed
wants to merge 1 commit into from
Closed

Alias 'presence' validator as 'required' #147

wants to merge 1 commit into from

Conversation

vdh
Copy link
Contributor

@vdh vdh commented Jul 29, 2016

Now personally, I don't mind that the original validator is named presence, but my co-workers are a tad antsy about their validation rules not matching what they're used to in other frameworks.

So I thought it would be handy to have an alias named required, for those who are more accustomed to writing validation that way, or prefer something a little harder to mis-type ("presense"/"precense").

@coveralls
Copy link

coveralls commented Jul 29, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 7f712b8 on vdh:alias-presence-validator into 49891ac on ansman:master.

@loyd
Copy link

loyd commented Aug 14, 2016

I use custom required validator to describe != null properties:

  validate({items: []}, {
    items: {
      required: true,
      array: {number: true}  // custom forEach checker
    }
  });

@vdh vdh closed this Dec 12, 2016
@vdh vdh deleted the alias-presence-validator branch December 12, 2016 04:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants