Skip to content

Releases: CharlGottschalk/approvejs

v3.1.2

26 Jun 11:31
Compare
Choose a tag to compare

Improved ignoreNull config setting to check for falsy values instead of jus null

v3.1.1

05 Apr 13:21
Compare
Choose a tag to compare

Updated documentation links

v3.1.0

10 Mar 10:51
Compare
Choose a tag to compare

Added ignoreNull property for handling null values.

Usage:

Test will pass

var rules = {
    required: true,
    email: true,
    ignoreNull: true
};

var result = approve.value(null, rules);

Test will fail

var rules = {
    required: true,
    email: true
};

var result = approve.value(null, rules);

v3.0.2

18 Jan 13:20
Compare
Choose a tag to compare

Fix for issue #11

v3.0.1

08 Dec 09:41
Compare
Choose a tag to compare

Numeric test now accepts negative values.

v3.0.0

30 Nov 10:14
Compare
Choose a tag to compare
  • Added error filtering
  • Added test outcome properties

Please read upgrade guide for this release.

v2.1.0

25 Nov 10:14
Compare
Choose a tag to compare

Added test cancellation:

By default, ApproveJS will continue testing every rule and return all tests' error messages. For example:

var rules = {
   required: true,
   email: true
};

var result = approve.value('', rules);

The above code will check whether the value is present (required = true) and whether it is a valid email address (email = true). Should the value fail the required rule, ApproveJS will continue and also test the email rule, returning errors for both tests.

It makes sense though, that if the value fails the required test, that it will automatically fail the email test, so you might want to stop testing and return only the errors for the failed required test. For this we use the stop property which will stop all testing after the first failed rule, i.e.

var rules = {
   stop: true,
   required: true,
   email: true
};

var result = approve.value('', rules);

Now, should the required rule fail, ApproveJS will stop all testing and return only the error messages for the required rule.

Note that rules are tested in the order in which they appear in the rule object, i.e.

var rules = {
   stop: true,
   required: true,
   email: true
};

In the code above, required will be tested first, and email second whereas in the code below, email will be tested first, and required second.

var rules = {
   stop: true,
   email: true,
   required: true
};

v2.0.0

22 Nov 15:11
Compare
Choose a tag to compare
  • Implemented Rollup
  • Updated date test to include format when testing

v1.1.2

27 Oct 16:45
Compare
Choose a tag to compare

Converted DOS line endings (\r\n) to Unix line endings (\n).

v1.1.1

04 Oct 14:16
Compare
Choose a tag to compare

Added missing ignore case flags