Skip to content

1.2.0 Release Notes

Latest
Compare
Choose a tag to compare
@WesTyler WesTyler released this 03 Mar 18:47
· 108 commits to master since this release

Summary

Adds support for Joi.object().pattern() schema.
Also includes non-breaking code optimizations and documentation updates.

Changes

Joi.object().pattern()

Felicity now supports the Joi .pattern syntax.

const schema = Joi.object().pattern(/^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/, Joi.object().keys({
            id  : Joi.string().guid().required(),
            tags: Joi.array().items(Joi.string()).required()
        })).min(2);

Felicity.example(schema);
/*
{
    'fa7bfcB5-f5be-A5bd-F480-a5B59cF77FCC': {
        id: '8075405c-5098-417d-b6e6-867ea005ed64',
        tags: [ 'zsbwo642nakh907beam50zfr' ]
    },
    '{1F4A8f2b-9cae-de77-b0E7-1e7FE6547aEB}': {
        id: '3d78f59f-ee8b-4925-a92c-679b2c24b20b',
        tags: [ 'lanzexj98o7gxuj91i8loko6r' ]
     }
}
*/

Steps to upgrade

No breaking changes were included in this version. Upgrades should not require changes to your code.