configure

Indicative exposes couple of options to configure it’s behavior, which can be overridden if desired.

The options set via configure method are applied globally.
Key Default Value Description

EXISTY_STRICT

false

When setting this option to true, only undefined values will be skipped for non required validations. Otherwise validations like email will skip all falsy values.

FORMATTER

null

The formatter to be used for formatting errors. If a custom formatter is passed to validate method, then it will be given priority over the default one.

Imports

The full build exports the configure method from the top level object.

const { configure } = require('indicative')

When using customized build, you can fetch the method from the builds directory.

import configure from 'indicative/builds/configure'

Usage

import { JsonApi } from 'indicative/builds/formatters'

configure({
  EXISTY_STRICT: true,
  FORMATTER: JsonApi
})