MCPcopy Index your code
hub / github.com/fontsource/fontsource / getMetadata

Function getMetadata

api/download/src/util.ts:5–13  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

3import type { IDResponse } from './types';
4
5export const getMetadata = async (id: string) => {
6 const resp = await fetch(`https://api.fontsource.org/v1/fonts/${id}`);
7
8 if (!resp.ok) {
9 throw new StatusError(resp.status, `Unable to fetch metadata for ${id}.`);
10 }
11
12 return await resp.json<IDResponse>();
13};
14
15export const verifyAuth = (req: Request) => {
16 const authHeader = req.headers.get('Authorization');

Callers 1

router.tsFile · 0.90

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected