@mintlify/common
Version:
Commonly shared code within Mintlify
14 lines (13 loc) • 470 B
JavaScript
/**
* Resolves the display name for a tag. Prioritizes x-group extension, falls back to tag name.
*/
export const getTagDisplayName = (tagName, schema) => {
var _a;
if (!tagName)
return undefined;
const tags = schema.tags;
if (!tags)
return tagName;
const tagDef = tags.find((t) => t.name === tagName);
return (_a = tagDef === null || tagDef === void 0 ? void 0 : tagDef['x-group']) !== null && _a !== void 0 ? _a : tagName;
};