How to use the felicity.entityFor function in felicity

To help you get started, we’ve selected a few felicity examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xogroup / joi2gql / test / mocks / document.js View on Github external
const Joi = require('joi');
const Felicity = require('felicity');

const schema = Joi.object().keys({
    name      : Joi.string(),
    age       : Joi.number().integer(),
    cyborgMods: Joi.number(),
    occupation: Joi.object().keys({
        title: Joi.string(),
        level: Joi.string()
    }),
    active      : Joi.boolean(),
    affiliations: Joi.array().items(Joi.string())
});

module.exports = Felicity.entityFor(schema);

felicity

Javascript object instantiation from Joi schema

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis

Popular felicity functions