function generateRandomString(length) {
  const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  let result = "";
  for (let i = 0; i < length; i++) {
    result += characters.charAt(Math.floor(Math.random() * characters.length));
  }
  return result;
}
function generateRandomNumber(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}
function generateRandomArray(length, min, max) {
  const result = [];
  for (let i = 0; i < length; i++) {
    result.push(generateRandomNumber(min, max));
  }
  return result;
}
function generateRandomData(dataType, options) {
  const { length = 10, min = 0, max = 100 } = {};
  switch (dataType) {
    case "text":
    case "textarea":
    case "select":
    case "radio":
      return generateRandomString(length);
    case "number":
      return generateRandomNumber(min, max);
    case "date":
      return new Date(generateRandomNumber(2e3, 2023), generateRandomNumber(0, 11), generateRandomNumber(1, 28));
    case "multipleSelection":
    case "checkbox":
      return generateRandomArray(length, min, max);
    case "switch":
      return Math.random() >= 0.5;
    default:
      return null;
  }
}
export {
  generateRandomData
};
