MCPcopy
hub / github.com/continuedev/continue / getCertificateContent

Function getCertificateContent

packages/fetch/src/certs.ts:8–21  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

6 * Extracts content from either a file path or data URI
7 */
8export function getCertificateContent(input: string): string {
9 if (input.startsWith("data:")) {
10 // Parse data URI: data:[<mediatype>][;base64],<data>
11 const [header, data] = input.split(",");
12 if (header.includes("base64")) {
13 return Buffer.from(data, "base64").toString("utf8");
14 } else {
15 return decodeURIComponent(data);
16 }
17 } else {
18 // Assume it's a file path
19 return fs.readFileSync(input, "utf8");
20 }
21}
22
23export class CertsCache {
24 private static instance: CertsCache;

Callers 4

getCachedCustomCertMethod · 0.85
getAgentOptionsFunction · 0.85
certs.test.tsFile · 0.85

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected