code: function validateSchema(schema) {
    let errors = [];
  
    schema.forEach((page, index) => {
      if (!['Page', 'Result'].includes(page.type)) {
        errors = [
          ...errors,
          {
            path: ['schema', index],
            error: 'Top-level element is of invalid type. Must be Page or Result',
          },
        ];
      }
  
      errors = [
        ...errors,
        ...validatePage(page, ['schema', index]),
      ];
    });
  
    return errors;
  }
docs: Validates that the schema is ok. Checking that the top level is pages
  and recursing down from there, ending up with an array of everything that
  isn't up to standards 👮