UNPKG

@scalar/api-client

Version:

the open source API testing client

20 lines (19 loc) 559 B
import { isAuthOptional as r } from "../../../blocks/scalar-auth-selector-block/helpers/is-auth-optional.js"; const a = (e, t, s) => { const c = s[0]; if (e?.["x-scalar-set-operation-security"]) { if (t?.["x-scalar-selected-security"]) return t?.["x-scalar-selected-security"]; } else if (e?.["x-scalar-selected-security"]) return e?.["x-scalar-selected-security"]; return r(s) || !c ? { selectedIndex: -1, selectedSchemes: [] } : { selectedIndex: 0, selectedSchemes: [c] }; }; export { a as getSelectedSecurity };