Skip to content

Joi Extension to allow turning incoming string fields into arrays

License

Notifications You must be signed in to change notification settings

kylelaverty/joi-array-extension

Repository files navigation

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.

About

Joi Extension to allow turning incoming string fields into arrays

Resources

License

Stars

Watchers

Forks

Packages

No packages published