joi-starts-with-ref

1.0.0 • Public • Published

joi-starts-with-ref

Joi custom validator to allow validating a field by checking it starts with the value of another field.

Install

npm i joi-starts-with-ref -S

Usage

See the tests for more examples

const Joi = require("joi");
const joiStartsWith = require("joi-starts-with-ref");

module.exports = Joi.object().keys({
  "firstName": Joi.string(),
  "fullName": joiStartsWith.string().startsWithRef("firstName").required()
});

/joi-starts-with-ref/

    Package Sidebar

    Install

    npm i joi-starts-with-ref

    Weekly Downloads

    1

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    1.96 kB

    Total Files

    3

    Last publish

    Collaborators

    • jmac105