@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
17 lines (16 loc) • 384 B
JavaScript
const d = /^.*?(?=\.query|\.path|\.headers|\.cookies|\.body)/, i = (t) => {
if (t.startsWith("model"))
return "models";
if (t.includes(".")) {
const e = t.match(d);
if (e?.[0])
return e[0];
}
return t;
}, o = (t, e) => {
const n = i(t);
return e.findIndex((r) => r.type === "tag" ? n.startsWith(r.id) : n === r.id);
};
export {
o as getCurrentIndex
};