3.0.0 • Published 6 months ago

@tree-house/joi v3.0.0

Weekly downloads
477
License
ISC
Repository
github
Last release
6 months ago

Tree House Joi

Custom extended Joi for Typescript.

Installation

Install via npm

import '@tree-house/joi'

Usage

Typescript

The main goal of this package is to provide extensive Typescript types for Joi based on joi-extract-type. By installing the module you'll automatically gain access to these types and be able to use Joi.extractType.

export type MySchemaType = Joi.extractType<typeof anyJoiSchema>;

validateJoiSchema

Compare any value against a Joi schema. Function will throw an error if they do not match.

import { validateJoiSchema } from '@tree-house/joi';

// Schema
const schema = Joi.object({
  name: Joi.string()
    .required()
})

// Object to compare schema against
const myObject = {
  name: 'Hello',
}

// Will pass without issues
validateJoiSchema(myObject, schema)

Bugs

When you find issues, please report them:

Be sure to include all of the output from the npm command that didn't work as expected. The npm-debug.log file is also helpful to provide.

Authors

See the list of contributors who participated in this project.

License

This project is licensed under the ISC License - see the LICENSE.md file for details

3.0.0

6 months ago

2.3.0

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

3 years ago

2.0.0-rc.2

3 years ago

2.0.0-rc.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.0

4 years ago