MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / saveData

Function saveData

src/pages/components/ScriptStorage/index.tsx:35–42  ·  view source on GitHub ↗
(key: string, value: any)

Source from the content-addressed store, hash-verified

33
34 // 保存单个键值
35 const saveData = (key: string, value: any) => {
36 valueClient.setScriptValue({ uuid: script!.uuid, key, value, ts: Date.now() });
37 const newRawData = { ...rawData, [key]: value };
38 if (value === undefined) {
39 delete newRawData[key];
40 }
41 updateRawData(newRawData);
42 };
43
44 // 保存所有键值
45 const saveRawData = (newRawValue: { [key: string]: any }) => {

Callers 2

deleteDataFunction · 0.85
ScriptStorageFunction · 0.85

Calls 2

updateRawDataFunction · 0.85
setScriptValueMethod · 0.80

Tested by

no test coverage detected