UNPKG

@scalar/api-client

Version:

the open source API testing client

28 lines (27 loc) 734 B
import { AVAILABLE_CLIENTS as o, snippetz as a } from "@scalar/snippetz"; import { capitalize as c } from "vue"; const y = (n) => `custom/${n.lang}`, $ = (n = o) => { const s = new Set(n); return a().clients().flatMap((t) => { const l = t.clients.flatMap((e) => { const i = `${t.key}/${e.client}`; return s.has(i) ? { id: i, lang: e.client === "curl" ? "curl" : t.key, title: `${c(t.title)} ${e.title}`, label: e.title, targetKey: t.key, targetTitle: t.title, clientKey: e.client } : []; }); return l.length === 0 ? [] : { label: t.title, options: l }; }); }; export { $ as generateClientOptions, y as generateCustomId };