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

Suggestions #29

Closed
oussamahamdaoui opened this issue Dec 5, 2018 · 3 comments
Closed

Suggestions #29

oussamahamdaoui opened this issue Dec 5, 2018 · 3 comments

Comments

@oussamahamdaoui
Copy link
Owner

oussamahamdaoui commented Dec 5, 2018

Hey every one, If you have suggestions or ideas to improuve the code please feel free to let a comment here.
Rulles:

1 Please use this template wich will help developers to test and better understend your request:

const someRule= new Rule({
    type: 'yourType',
    prop1: val1,
    prop2: val2, ...
  }, null);

  someRule.test(validValue) // returns true
  someRule.test(invalidValue) // returns false

2 Please if you think a comment is a good feature to be added like the coment insted of creating a new one.

3 Before submitting a new comment check if the same comment is not allready present

4 If you submit a PR (pull request) and you only change the Readme plese add [ci skip] to your commit message

5 If you have any questions ask them in the FAQ

6 Please have fun, and if you feel like not following the rulles then don't follow them

code with love ❤️

@oussamahamdaoui oussamahamdaoui changed the title FAQ & Suggestions Suggestions Dec 5, 2018
@kwkau
Copy link

kwkau commented Dec 12, 2018

Hi, i have taken a look at forgjs and so far everything looks pretty good, but i have one request. Can we have another method from test which can check the rules specified against multiple values. Example

`const someRule= new Rule({
type: 'yourType',
prop1: val1,
prop2: val2, ...
}, null);

someRule.testMultiple([values to test]) // returns true`

This will make validation of multiple values at once a breeze. If all the values are valid testMultiple returns true otherwise it will return the indices or the values which have failed the validation.

@oussamahamdaoui
Copy link
Owner Author

oussamahamdaoui commented Dec 12, 2018

Hey,
thank you I added this function now you have acces to testAll(array) that performs tests over all the element of a array and returns the index of the element or -1 if no error is found
This feature is not on npm yet ill try to make a new release tonight
Released ✅

@kwkau
Copy link

kwkau commented Dec 12, 2018

Awesome, you are the man!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants