src/error-handling.js
// If a file holds an array of schema, each array element must be an object-type
If a file holds an array of schema, each array element must be an object-type
If a file holds an array of schema each array element must be an object - type
function validateArrayOfSchema (jsonArray, file) {
  jsonArray.forEach(function (schema, index) {
    if (!(schema instanceof Object) || Array.isArray(schema)) {
      const err = new Error('Each entry in the JSON array must be an object type');
      err.subMessage = `Check element with index ${index} in file ${file}`;
      throw err;
    }
  });
}
function validateArrayOfSchema ( jsonArray , file ) { jsonArray . forEach ( function ( schema , index ) { if ( ! ( schema instanceof Object ) || Array . isArray ( schema ) ) { const err = new Error ( 'Each entry in the JSON array must be an object type' ) ; err . subMessage = ` ${ index } ${ file } ` ; throw err ; } } ) ; }
If a file holds an array of schema, each array element must be an object-type
If a file holds an array of schema each array element must be an object - type