"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.validateMessages = void 0;
const validateMessages = messages => {
  const requiredAttributes = ['id', 'user', 'date', 'body'];
  let isValid = true;
  messages.forEach((message, index) => {
    const missingAttributes = requiredAttributes.filter(attr => !(attr in message));
    if (missingAttributes.length > 0) {
      console.error(`Message at index ${index} is missing attributes: ${missingAttributes.join(', ')}`);
      isValid = false;
    }
  });
  return isValid;
};
exports.validateMessages = validateMessages;
//# sourceMappingURL=validator.js.map