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

Function saveTempCode

src/pkg/utils/scriptInstall.ts:28–36  ·  view source on GitHub ↗
(tempUUID: string, code: string)

Source from the content-addressed store, hash-verified

26}
27
28const saveTempCode = async (tempUUID: string, code: string) => {
29 const folder = await navigator.storage
30 .getDirectory()
31 .then((root) => root.getDirectoryHandle("temp_install_codes", { create: true }));
32 const handle = await folder.getFileHandle(`${tempUUID}.user.js`, { create: true });
33 const writable = await handle.createWritable();
34 await writable.write(code);
35 await writable.close();
36};
37
38export const getTempCode = async (tempUUID: string): Promise<string | undefined> => {
39 try {

Callers 2

createTempCodeEntryFunction · 0.85
createScriptInfoLocalFunction · 0.85

Calls 2

writeMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected