Skip to content

anhthang/joi-array-extensions

Folders and files

NameName
Last commit message
Last commit date
May 24, 2019
May 24, 2019
Sep 23, 2017
Sep 28, 2017
May 24, 2019
Sep 28, 2017
Sep 22, 2017
Jun 24, 2019
May 24, 2019
May 24, 2019
Feb 11, 2022
Sep 14, 2019
Feb 11, 2022

Repository files navigation

joi-array-extensions

Joi extensions for extra array rules.

npm download dependents travis appveyor

API

See the API Reference.

Usage

Usage is a two steps process. First, a schema is constructed using the provided types and constraints:

const BaseJoi = require('@hapi/joi')
const Extension = require('joi-array-extensions')
const Joi = BaseJoi.extend(Extension)

const schema = Joi.array().items({
    idx: Joi.number().integer()
}).continuous('idx', 1)

Coverage

7 tests complete
Test duration: 51 ms
Assertions count: 40 (verbosity: 5.71)
Leaks: No issues
Coverage: 100.00%
Lint: No issues