@mintlify/validation
Version:
Validates mint.json files
14 lines (13 loc) • 614 B
JavaScript
import { v4 as uuidv4 } from 'uuid';
import { mapHeader } from './mapHeader.js';
export const mapHeaderComponents = ({ spec, refUuidMap, uuidObjectHashMap, hashedNodeMap, }) => {
var _a;
const headerComponents = (_a = spec.components) === null || _a === void 0 ? void 0 : _a.headers;
if (!headerComponents)
return;
Object.entries(headerComponents).forEach(([headerName, header]) => {
const refId = `#/components/headers/${headerName}`;
const uuid = refUuidMap[refId] || uuidv4();
mapHeader({ header, refUuidMap, uuidObjectHashMap, hashedNodeMap, uuid });
});
};