@deloittesolutions/joi-color-extensions

1.0.0 • Public • Published

joi-color-extensions

JOI extension to validate colors

Install

Install the profile with npm:

npm i -S joi @deloittesolutions/joi-color-extensions

Usage

HEX Code

Validate hex codes:

const joi = require('joi');
const color = require('@deloittesolutions/joi-color-extensions');

const schema = joi.object().keys({
    code: color.hexCode().valid(),
});

const data = {code: '#ffffff'};

const result = joi.validate(data, schema);

// result.value = {code: '#ffffff'}

Readme

Keywords

none

Package Sidebar

Install

npm i @deloittesolutions/joi-color-extensions

Weekly Downloads

2

Version

1.0.0

License

UNLICENSED

Last publish

Collaborators

  • samibenbdelaziz
  • amaurycannesson
  • pauldeblicker