MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / read

Method read

packages/filesystem/onedrive/rw.ts:16–32  ·  view source on GitHub ↗
(type?: "string" | "blob")

Source from the content-addressed store, hash-verified

14 }
15
16 async read(type?: "string" | "blob"): Promise<string | Blob> {
17 const data = await this.fs.request(
18 `https://graph.microsoft.com/v1.0/me/drive/special/approot:${joinPath(this.file.path, this.file.name)}:/content`,
19 {},
20 true
21 );
22 if (data.status !== 200) {
23 throw new Error(await data.text());
24 }
25 switch (type) {
26 case "string":
27 return data.text();
28 default: {
29 return data.blob();
30 }
31 }
32 }
33}
34
35export class OneDriveFileWriter implements FileWriter {

Callers

nothing calls this directly

Calls 4

joinPathFunction · 0.90
requestMethod · 0.45
textMethod · 0.45
blobMethod · 0.45

Tested by

no test coverage detected