const o = (t) => {
  var s;
  if ((t == null ? void 0 : t.const) !== void 0)
    return "const";
  if (Array.isArray(t == null ? void 0 : t.type)) {
    if (t.type.includes("array") && t.items) {
      const r = o(t.items), i = r != null && r.includes(" | ") ? `(${r})` : r, n = r ? `array ${i}[]` : "array", y = t.type.filter((c) => c !== "array");
      return y.length > 0 ? `${n} | ${y.join(" | ")}` : n;
    }
    return t.type.join(" | ");
  }
  if ((t == null ? void 0 : t.type) === "array" && t.items) {
    const r = o(t.items), i = r != null && r.includes(" | ") ? `(${r})` : r, n = r ? `array ${i}[]` : "array";
    return t.nullable ? `${n} | null` : n;
  }
  return t != null && t.title ? t.title : t != null && t.name ? t.name : (s = t == null ? void 0 : t.xml) != null && s.name ? t.xml.name : t != null && t.type && t.contentEncoding ? `${t.type} • ${t.contentEncoding}` : (t == null ? void 0 : t.type) ?? "";
};
export {
  o as getSchemaType
};
