MCPcopy Create free account
hub / github.com/QuantumNous/new-api / parseTaskResultFunctionBody

Function parseTaskResultFunctionBody

pkg/jsplugin/cli.go:69–92  ·  view source on GitHub ↗
(source string)

Source from the content-addressed store, hash-verified

67}
68
69func parseTaskResultFunctionBody(source string) string {
70 marker := strings.Index(source, "function parseTaskResult")
71 if marker < 0 {
72 return ""
73 }
74 brace := strings.Index(source[marker:], "{")
75 if brace < 0 {
76 return ""
77 }
78 start := marker + brace
79 depth := 0
80 for i := start; i < len(source); i++ {
81 switch source[i] {
82 case '{':
83 depth++
84 case '}':
85 depth--
86 if depth == 0 {
87 return source[start : i+1]
88 }
89 }
90 }
91 return ""
92}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected