1.2.2 • Published 2 years ago

exframe-document-validator v1.2.2

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
2 years ago

exframe-document-validator

A wrapper around exframe-request-validator to validate quote and policy documents with flexible, CSP based coverage details.

Usage

const validate = require('exframe-document-validator');
try {
  validate(context, configuration, document);
  // Document is valid
} catch (e) {
  // For the case where coverageLimits.dwelling is required, but missing:
  console.log(e.validationErrors[0].dataPath);
  // ./coverageLimits
  console.log(e.validationErrors[0].params);
  // { missingProperty: 'dwelling' }
  // For validation schema used to validate document
  console.log(e.validationSchema);
}

Arguments:

  • context object The context object. If the context object contains a log, debug information will be logged there. If not, debug information will not be logged.
  • configuration object Contains coverage details and form fields
    • coverageDetails object A coverageDetails object containing coverageLimits, coverageOptions and deductibles
    • formFields array A collection of formFields objects
  • document object The document to be validated
1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.4

3 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago