MCPcopy Create free account
hub / github.com/Xyntopia/taskyon / loadFile

Function loadFile

src/modules/loadFiles.ts:43–58  ·  view source on GitHub ↗
(file: File)

Source from the content-addressed store, hash-verified

41}
42
43export async function loadFile(file: File) {
44 console.log('load file: ' + file.type);
45 switch (file.type) {
46 case 'application/pdf':
47 return await read_pdf(file);
48 case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
49 return await read_docx(file);
50 default:
51 if (file.type.startsWith('text')) {
52 return file.text();
53 } else {
54 console.log(`unknown file type: ${file.type} from ${file.name}`);
55 return undefined;
56 }
57 }
58}

Callers 1

uploadToIndexFunction · 0.90

Calls 2

read_pdfFunction · 0.85
read_docxFunction · 0.85

Tested by

no test coverage detected