'use strict';

"use strict";
const getRandomCode = (length) => {
  const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  let result = "";
  const finalLength = typeof length === "number" ? Math.max(0, Math.floor(length)) : Math.floor(Math.random() * 5) + 6;
  for (let i = 0; i < finalLength; i++) {
    const randomIndex = Math.floor(Math.random() * characters.length);
    result += characters[randomIndex];
  }
  return result;
};

exports.getRandomCode = getRandomCode;
//# sourceMappingURL=random-code.js.map
