Skip to content

Releases: dpoindexter/immutable-validation

Return results as ValidationRecords

14 Jun 19:47
Compare
Choose a tag to compare
Pre-release

This release alters the data structure returned by [[Validator]].validate. validate now returns an immutable record type.

type ValidationRecord = {
    isValid: boolean,
    messages: Set<string>,
    rules: Map<string, ValidationRecord>
}

ValidationRecord is recursive, which makes it easier to traverse.

The rules field makes deep traversals a little unwieldy. [[ValidationRecord]].refine(path: Array<string>) provides a convenient method for getting arbitrarily-nested results while excluding verbose parts of the key path. (See #3 for an example)

v0.6.0

04 Mar 20:43
Compare
Choose a tag to compare
v0.6.0 Pre-release
Pre-release

This release reconfigures the build process to support distribution via npm. UMD scripts are still committed to the /dist folder.

v0.5.0

03 Mar 19:37
Compare
Choose a tag to compare
v0.5.0 Pre-release
Pre-release

When using the fluent interface to describe rulesets, each call to validator.ruleFor or validator.ruleForEach will return a new Validator instance. Validator rulesets are now immutable if you use the method interface.

v0.4.1

16 Oct 18:25
Compare
Choose a tag to compare
v0.4.1 Pre-release
Pre-release

Fixes the naive implementation of the required predicate:

  • Whitespace fails validation
  • NaN fails validation
  • Reference types, null and undefined fail validation

v0.4.0

16 Sep 15:00
Compare
Choose a tag to compare
v0.4.0 Pre-release
Pre-release
  • Renames facts export to predicates
  • Adds ruleForEach method to instances of Validator, to support validating collections of items
  • Adds Validator.which static constructor to support dynamically picking a validator each time validate() is called

v0.0.2

19 Aug 21:29
Compare
Choose a tag to compare
v0.0.2 Pre-release
Pre-release

Update compiled files in the dist directory

v0.0.1

19 Aug 20:05
Compare
Choose a tag to compare
v0.0.1 Pre-release
Pre-release

Initial version of codebase