Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 994 Bytes

README.md

File metadata and controls

27 lines (17 loc) · 994 Bytes

joi-array-extension

Joi extensions for extra string rules.

npm version Build Status

Lead Maintainer: Kyle Laverty

Overview

This extention is focused on adding the ability to split strings into arrays so that they can be used with the rest of the joi ecosystem as if they were arrays.

Usage

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

const BaseJoi = require('joi');
const Extension = require('joi-array-extension');
const Joi = BaseJoi.extend(Extension);

const schema = Joi.array().separator(',').items(...);

API

See the API Reference.