import { isReferenceObject } from "../../3.1/guards/isReferenceObject";
import { resolveReference } from "./resolveReference";
export function resolveSecurityScheme(securitySchemeId, document) {
    const securityScheme = document.components?.securitySchemes?.[securitySchemeId];
    if (securityScheme == null) {
        return undefined;
    }
    if (isReferenceObject(securityScheme)) {
        return resolveReference(securityScheme, document, undefined);
    }
    return securityScheme;
}
