Validates Roqueform fields with Doubter shapes.
npm install --save-prod @roqueform/doubter-plugin Copy
npm install --save-prod @roqueform/doubter-plugin
Create a field validated by a Doubter shape:
import * as d from 'doubter';import { createField } from 'roqueform';import errorsPlugin from 'roqueform/plugin/errors';import doubterPlugin, { concatDoubterIssues } from '@roqueform/doubter';const fieldShape = d.object({ hello: d.string()});const field = createField({ hello: 'world' }, [ errorsPlugin(concatDoubterIssues), doubterPlugin(fieldShape)]);field.at('hello').validate() // ⮕ true Copy
import * as d from 'doubter';import { createField } from 'roqueform';import errorsPlugin from 'roqueform/plugin/errors';import doubterPlugin, { concatDoubterIssues } from '@roqueform/doubter';const fieldShape = d.object({ hello: d.string()});const field = createField({ hello: 'world' }, [ errorsPlugin(concatDoubterIssues), doubterPlugin(fieldShape)]);field.at('hello').validate() // ⮕ true
Validates Roqueform fields with Doubter shapes.
Create a field validated by a Doubter shape: