bin/one-of.js
function TypedOneOf (config) {
    const oneOf = this;

    // validate oneOf
    if (!config.hasOwnProperty('oneOf')) {
        throw Error('Invalid configuration. Missing required one-of property: oneOf. Must be an array of schema configurations.');
    }
    if (!Array.isArray(config.oneOf) || config.oneOf.filter(v => !v || typeof v !== 'object').length) {
        throw Error('Invalid configuration value for property: oneOf. Must be an array of schema configurations.');
    }

    // create each unique schema
    const hashes = {};
    const schemas = config.oneOf
        .map(item => FullyTyped(item))
        .filter(schema => {
            const hash = schema.hash();
            if (hashes[hash]) return false;
            hashes[hash] = true;
            return true;
        });

    // define properties
    Object.defineProperties(oneOf, {

        oneOf: {
            /**
             * @property
             * @name TypedOneOf#oneOf
             * @type {object}
             */
            value: schemas,
            writable: false
        }

    });

    return oneOf;
}
function TypedOneOf (config) {
    const oneOf = this;

    // validate oneOf
    if (!config.hasOwnProperty('oneOf')) {
        throw Error('Invalid configuration. Missing required one-of property: oneOf. Must be an array of schema configurations.');
    }
    if (!Array.isArray(config.oneOf) || config.oneOf.filter(v => !v || typeof v !== 'object').length) {
        throw Error('Invalid configuration value for property: oneOf. Must be an array of schema configurations.');
    }

    // create each unique schema
    const hashes = {};
    const schemas = config.oneOf
        .map(item => FullyTyped(item))
        .filter(schema => {
            const hash = schema.hash();
            if (hashes[hash]) return false;
            hashes[hash] = true;
            return true;
        });

    // define properties
    Object.defineProperties(oneOf, {

        oneOf: {
            /**
             * @property
             * @name TypedOneOf#oneOf
             * @type {object}
             */
            value: schemas,
            writable: false
        }

    });

    return oneOf;
}
function TypedOneOf ( config ) { const oneOf = this ; // validate oneOf if ( ! config . hasOwnProperty ( 'oneOf' ) ) { throw Error ( 'Invalid configuration. Missing required one-of property: oneOf. Must be an array of schema configurations.' ) ; } if ( ! Array . isArray ( config . oneOf ) || config . oneOf . filter ( v => ! v || typeof v !== 'object' ) . length ) { throw Error ( 'Invalid configuration value for property: oneOf. Must be an array of schema configurations.' ) ; } // create each unique schema const hashes = { } ; const schemas = config . oneOf . map ( item => FullyTyped ( item ) ) . filter ( schema => { const hash = schema . hash ( ) ; if ( hashes [ hash ] ) return false ; hashes [ hash ] = true ; return true ; } ) ; // define properties Object . defineProperties ( oneOf , { oneOf : { /**
             * @property
             * @name TypedOneOf#oneOf
             * @type {object}
             */ value : schemas , writable : false } } ) ; return oneOf ; }
Create a TypedOneOf instance.
@param {object} config
@returns {TypedOneOf}
@augments Typed
@constructor
Create a TypedOneOf instance .