code: function construct(schema, value, options) {
    const state = {
      errors: [],
      warnings: [],
    };
    const opt = _.merge({
      strict: false,
      fillDefaults: false,
    }, options);
  
    const rv = _constructRecursive(schema, value, opt, [], state);
    if (state.errors.length) {
      const firstError = _.first(state.errors);
      firstError.allErrors = state.errors;
      firstError.allWarnings = state.warnings;
      throw firstError;
    }
  
    return rv;
  }
docs: Checks a value against a type schema, and returns a parsed object
  with the following properties:
  
  - Only fields listed in the schema are included.
  - Missing values in the argument are filled in from the schema
  if possible, and if the flag is set.
  - The constructed object satisfies the provided schema.
  
  `options` can contain any of the following properties:
  
  * **fillDefaults**: fill in missing values from schema defaults (default: **false**)
  * **strict**: throw errors on extra attributes not in schema (default: **false**)
  
  An error message identifying the exact locus of the error is thrown otherwise.
  
  @param {string|object} schema Type definition (schema) or type name in library.
  @param {*} value Any JSON-serializable value.
  @param {?object} options Options for construct.
  @throws {RuntypeError} An extended error object containing all validation errors.
  @return {*} A successfully parsed, validated, and filled-in object.