export type HeadApiConceptschemesSchemeIdCCIdExpandArgs = {scheme_id: string, c_id: string}; export type HeadApiConceptschemesSchemeIdCCIdExpandOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Check if a concept or collection can be expanded. * * HEAD /conceptschemes/{scheme_id}/c/{c_id}/expand */ export const headApiConceptschemesSchemeIdCCIdExpand = async (args: HeadApiConceptschemesSchemeIdCCIdExpandArgs, options: HeadApiConceptschemesSchemeIdCCIdExpandOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/conceptschemes/${encodeURIComponent(String(args.scheme_id))}/c/${encodeURIComponent(String(args.c_id))}/expand${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "HEAD", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };