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

Function parseExportValue

packages/cloudscript/cloudscript.ts:68–85  ·  view source on GitHub ↗
(script: Script, exportValue: string)

Source from the content-addressed store, hash-verified

66
67// 解析value表达式生成导出的value
68export async function parseExportValue(script: Script, exportValue: string): Promise<Value[]> {
69 const lines = exportValue.split("\n");
70 const result = [];
71 const values = await valueClient.getScriptValue(script);
72 for (let i = 0; i < lines.length; i += 1) {
73 const line = lines[i];
74 if (line.trim()) {
75 const s = line.split(",");
76 for (let n = 0; n < s.length; n += 1) {
77 const key = s[n].trim();
78 if (key && values[key]) {
79 result.push(values[key]);
80 }
81 }
82 }
83 }
84 return result;
85}

Callers 1

CloudScriptPlanFunction · 0.90

Calls 2

pushMethod · 0.80
getScriptValueMethod · 0.45

Tested by

no test coverage detected